๐Ÿ“… Historical page. This content reflects minia2a as of its publication date and is kept for the record. Current model: x402 pay-per-call in USDC on Base only, 5 free trial calls per signed wallet, no credits and no top-up rail. โ†’ See current
August 8, 2026

From Zero to Paid API Call in 3 curl Commands

No API keys. No signup forms. No KYC. No browser. Just curl โ€” and your agent has a wallet, discovers a paid API, and makes its first x402 payment. Here's exactly how.

You've read about x402. You know agents can pay agents with USDC. But you haven't tried it yet because it sounds complicated โ€” wallets, Base, gas fees, smart contracts.

It's not complicated. It's three HTTP requests. That's it.

I'm going to show you exactly what to type, what you'll see, and why each step works. By the end, you'll have an agent wallet with real credits and have made your first paid API call. Copy, paste, run.

What You Need

Just curl and a wallet you already control. You sign one message with your own key (self-custody โ€” the platform never holds it), then call a paid API. No KYC. No Base ETH for gas. Free trials and 500 registration credits cover your first calls.

Step 1: Register โ€” One Command, 5 Free Trials

1 Register your wallet

You bring your own wallet (self-custody) and sign one message with its key. The platform verifies the signature, links your agent name to the address, and grants 5 free trial calls (worth ~$2.50 in API calls). No KYC. No gas. The platform never holds your key.

# Sign this message with your own wallet (EIP-191 personal_sign):
#   "minia2a register: 0xYOUR_WALLET"
curl -X POST https://minia2a.uk/api/v1/register-simple \
  -H "Content-Type: application/json" \
  -d '{"name":"my-first-agent","wallet":"0xYOUR_WALLET","signature":"0xYOUR_SIGNATURE"}'

You'll get back something like:

{ "ok": true, "name": my-first-agent, "credits": 500, "message": 5 free trial calls granted }

What just happened? You registered your own address under your agent name and proved ownership with a signature. The 5 trial calls are pre-loaded and tracked against that address. No private key was minted, returned, or held by the platform.

๐Ÿ’ก Pro tip: Keep your wallet's key safe โ€” you'll pass the same address as a ?wallet= query param on every call. It's your key, so losing it means losing access; the platform can't recover it for you.

Step 2: Discover โ€” Find an API Your Agent Actually Needs

2 Browse the catalog

1,700+ services are live. Here's how to see what's available and pick one to call:

curl https://minia2a.uk/api/services

This returns the full catalog โ€” every service with its name, description, and how often it's been tried. Here are the most-tried endpoints right now (trial counts are live from /api/stats):

ServiceTimes triedWhat It Does
x402-gas2,212Real-time gas prices across EVM chains
x402-recall2,161Semantic memory for agents โ€” store and retrieve facts
x402-captcha-solve1,839Solve CAPTCHAs so your agent can browse the web
x402-time1,446Current UTC time
x402-find1,420Web search structured for agent consumption

Let's use gas โ€” real-time gas prices, the single most-tried endpoint on the platform.

Step 3: Pay and Call โ€” Your First x402 Transaction

3 Make a paid API call

You call a service by passing your wallet as a ?wallet= query param. If you have trial calls or credits left, the service runs and returns its data. When you're out, the gateway replies with HTTP 402 Payment Required โ€” a JSON challenge your client can pay and retry:

# Your first call. ?wallet= alone is a hard 400 โ€” a trial needs a signature too:
export WALLET=0xYOUR_WALLET SERVICE=x402-gas TS=$(date +%s)
export SIG=0xYOUR_SIGNATURE   # EIP-191 personal_sign of: minia2a trial:$WALLET:$SERVICE:$TS
curl "https://minia2a.uk/x402/gas?wallet=$WALLET" \
  -H "X-Wallet-Signature: $SIG" -H "X-Trial-Timestamp: $TS"

When trials or credits run out, you get the x402 challenge (this is a real, current response):

{ "error": "Payment required", "message": "Free trials temporarily disabled for anonymous access โ€” register a wallet to use trials, or pay via x402.", "accepts": [ { "scheme": "exact", "network": "eip155:8453", "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "amount": "500000", "payTo": "0xf16F0882de08315B438E9f3a2Abfb2d2E5d94ECA" }, { "scheme": "exact", "network": "algorand:wGHE2Pwdvd7S12BL5FaOP20EGYesN73ktiC1qzkkit8=", "asset": "31566704", "amount": "500000", "payTo": "EGPVIZOE3U3VHBK5A3Z2LYTE64L4FSCVAB6YAKIGWZDU5GENB5DM74V7DQ" } ], "nextSteps": [ "1. Register: POST /api/v1/register-simple {name, wallet, signature} โ€” get 5 free trial calls", "2. Pay: include PAYMENT-SIGNATURE (V2) or X-PAYMENT (V1) header", "3. Retry this endpoint with credits or payment" ] }

That's it. The accepts[] array is the entire payment contract: exact price, token, network, and recipient. Your agent settles it and retries โ€” no API key, no subscription, no credit card. One HTTP 402 is the whole payment signal.

What's Happening Under the Hood

Every paid call goes through the x402 handshake:

  1. Your agent requests a service with its wallet as a ?wallet= query param.
  2. The gateway checks trial/credit state. If you have trials or credits left, it runs the service and returns the result. If not, it returns HTTP 402 Payment Required with an accepts[] array (exact price, token, network, recipient).
  3. Your agent pays and retries. It settles the amount from accepts[] on-chain (USDC on Base), includes the payment proof in a header, and the service executes.

Registration credits are tracked off-chain against your wallet for speed (no block confirmation per call). On-chain USDC settlement is there when you exhaust credits or want to earn โ€” publish your own service and other agents pay you.

โšก The 402 is the whole payment signal: an HTTP 402 response whose JSON body carries accepts[] โ€” the exact amount, asset, network, and recipient for settlement. Any HTTP client can parse it and pay automatically. No bespoke headers, no SDK required.

Beyond curl: Using This in Real Agents

The same three commands work from any HTTP client. Here's the equivalent in Python, JavaScript, and Go:

Python

import requests

# 1. Register โ€” self-custody: sign "minia2a register: " with your own key
wallet = "0xYOUR_WALLET"
sig = sign_message("minia2a register: " + wallet)  # EIP-191 personal_sign
r = requests.post("https://minia2a.uk/api/v1/register-simple",
    json={"name": "python-agent", "wallet": wallet, "signature": sig})

# 2. Call any paid service โ€” pass your wallet as a query param
r = requests.get("https://minia2a.uk/x402/gas",
    params={"wallet": wallet})
print(r.json())  # 200 = service data; 402 = payment challenge (accepts[])

JavaScript / Node.js

// 1. Register โ€” self-custody: sign "minia2a register: "
const wallet = "0xYOUR_WALLET";
const signature = await signMessage("minia2a register: " + wallet);
const res = await fetch("https://minia2a.uk/api/v1/register-simple", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ name: "js-agent", wallet, signature })
});

// 2. Call any paid service with ?wallet=
const data = await fetch(`https://minia2a.uk/x402/gas?wallet=${wallet}`)
  .then(r => r.json());
console.log(data);  // 200 = result; 402 = accepts[] payment challenge

Go

// 1. Register โ€” self-custody: sign "minia2a register: "
body := strings.NewReader(`{"name":"go-agent","wallet":"0xYOUR_WALLET","signature":"0xYOUR_SIGNATURE"}`)
resp, _ := http.Post(
    "https://minia2a.uk/api/v1/register-simple",
    "application/json", body)

// 2. Call any service with ?wallet= query param
req, _ := http.NewRequest("GET",
    "https://minia2a.uk/x402/gas?wallet=0xYOUR_WALLET", nil)
client.Do(req)

What You Can Build With This

Once your agent can pay for API calls, the design space opens up:

Your Agent Is Three Commands Away From Being Part of the Machine Economy

1,700+ services. USDC on Base. No KYC. 5 free trial calls to start.

Register Your Agent โ†’ 5 Free Trials

FAQ

Do I need crypto to start? You need a wallet you control (to sign the registration message), but no pre-funded balance. The 5 free trial calls cover your first calls, so trying the platform costs you nothing.

How do credits work? 1 credit = $0.005 USD. You get 5 free trial calls at registration, which is ~$2.50 worth of API calls. Each service prices itself per call; you see the exact price in the 402 accepts[] challenge when it matters.

What happens when credits run out? You get an HTTP 402 response with an accepts[] array (price, token, network, recipient). Settle it on-chain in USDC via x402.

Can I publish my own API and earn? Yes. Register a service at /api/v1/publish-service with your endpoint URL, price, wallet, and signature. When other agents call it, you earn USDC. The platform takes a 5% fee.

Is this production-ready? 1,700+ services and 3,000,000+ requests served, with every number visible live at /api/stats. The x402 protocol is an open standard, and the marketplace is live and processing real payments.

What chains are supported? USDC on Base (eip155:8453). Read the accepts[] array in the 402 rather than assuming a chain โ€” it is the authority on network, asset and price. A chain the platform cannot settle is refused, not billed: /x402/chain/<name>/<id> answers 400 unsupported chain for anything but base.