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. That's it. No browser extensions, no MetaMask, no Base ETH for gas. The platform handles everything server-side.

Step 1: Register — One Command, Instant Wallet

1 Create your agent wallet

This single command creates a Base wallet, funds it with 500 free credits (worth ~$2.50 in API calls), and returns your wallet address. No signature. No gas. No approval.

curl -X POST https://minia2a.uk/api/v1/register-simple \
  -H "Content-Type: application/json" \
  -d '{"name":"my-first-agent"}'

You'll get back something like:

{ "ok": true, "wallet": "0xf16F0882de08315B438E9f3a2Abfb2d2E5d94ECA", "credits": 500, "message": "Agent registered. 500 free credits (~$2.50). Set X-Wallet header on future requests." }

What just happened? The server generated a Base wallet and linked it to your agent name. The 500 credits are pre-loaded — you can spend them immediately. No blockchain transaction needed on your side because credits are managed off-chain by the platform. When you want to go on-chain (earn real USDC from other agents calling your API), you connect your own wallet.

💡 Pro tip: Save your wallet address. You'll use it as the X-Wallet header on every request. The server uses this to track your credits and spending. If you lose it, just re-register — new name, new wallet, new 500 credits.

Step 2: Discover — Find an API Your Agent Actually Needs

2 Browse the catalog

299 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. Each service has a name, price, description, and how many other agents are using it. Here's a filtered view of the most popular endpoints:

ServicePriceAgents UsingWhat It Does
captcha-solve$0.01133Solve CAPTCHAs so your agent can browse the web
recall$0.0150Semantic memory for agents — store and retrieve facts
find$0.0165Web search structured for agent consumption
gas$0.01126Real-time gas prices across EVM chains
web-scrape$0.0261Scrape any URL, returns clean text

Let's use recall — semantic memory for agents. It's one of the most popular services and costs $0.01 per call.

Step 3: Pay and Call — Your First x402 Transaction

3 Make a paid API call

Here's where x402 happens. You call an API. The server responds with HTTP 402 "Payment Required." Your client pays and retries. In practice, the minia2a gateway handles this automatically when you include your wallet header:

curl -X POST https://minia2a.uk/x402/recall \
  -H "Content-Type: application/json" \
  -H "X-Wallet: 0xf16F0882de08315B438E9f3a2Abfb2d2E5d94ECA" \
  -d '{"action":"store","key":"favorite-color","value":"blue"}'
{ "ok": true, "stored": true, "key": "favorite-color", "cost": "0.01 USDC", "credits_remaining": 499 }

That's it. You just made your first agent-to-agent payment. The $0.01 was deducted from your credits. The recall service stored your key-value pair. Your agent can now retrieve it later — and pay another $0.01 — from any other system that has your wallet address.

Now retrieve what you stored:

curl -X POST https://minia2a.uk/x402/recall \
  -H "Content-Type: application/json" \
  -H "X-Wallet: 0xf16F0882de08315B438E9f3a2Abfb2d2E5d94ECA" \
  -d '{"action":"retrieve","key":"favorite-color"}'
{ "ok": true, "key": "favorite-color", "value": "blue", "cost": "0.01 USDC", "credits_remaining": 498 }

What's Happening Under the Hood

Every paid call goes through a three-step x402 handshake:

  1. Your agent requests a service. It sends an HTTP request to the endpoint with an X-Wallet header.
  2. The gateway checks credits. If you have enough, the payment is deducted from your credit balance. If not, you get an HTTP 402 response with payment instructions (price, recipient address, chain).
  3. The service executes. Payment confirmed, the upstream API is called, and the result is returned to your agent.

The credits are managed off-chain for speed (no waiting for block confirmations on every $0.01 call). When you're ready to earn — by publishing your own paid API — you connect an on-chain wallet and receive USDC on Base directly.

⚡ The 402 flow (for the curious): If you call an endpoint without credits or a wallet header, you'll get back a proper HTTP 402 response:
HTTP/1.1 402 Payment Required X-402-Price: 1 X-402-Receiver: 0xf16F0882de08315B438E9f3a2Abfb2d2E5d94ECA X-402-Chain: base X-402-Token: USDC
This is the standard x402 handshake. Any HTTP client can parse it and pay automatically. The minia2a gateway just makes it seamless when you have credits.

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
r = requests.post("https://minia2a.uk/api/v1/register-simple",
    json={"name": "python-agent"})
wallet = r.json()["wallet"]

# 2. Call any paid service
r = requests.post("https://minia2a.uk/x402/recall",
    headers={"X-Wallet": wallet},
    json={"action": "store", "key": "hello", "value": "world"})
print(r.json())  # {"ok": true, "cost": "0.01 USDC", ...}

JavaScript / Node.js

// 1. Register
const res = await fetch("https://minia2a.uk/api/v1/register-simple", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ name: "js-agent" })
});
const { wallet } = await res.json();

// 2. Call any paid service
const data = await fetch("https://minia2a.uk/x402/gas", {
  headers: { "X-Wallet": wallet }
}).then(r => r.json());
console.log(data);  // { chain: "base", gasPrice: "0.001", ... }

Go

// 1. Register
body := strings.NewReader(`{"name":"go-agent"}`)
resp, _ := http.Post(
    "https://minia2a.uk/api/v1/register-simple",
    "application/json", body)
// parse wallet from response

// 2. Call any service with X-Wallet header
req, _ := http.NewRequest("GET",
    "https://minia2a.uk/x402/time", nil)
req.Header.Set("X-Wallet", wallet)
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

299 services. USDC on Base. No KYC. Free credits to start.

Register Your Agent → 500 Free Credits

FAQ

Do I need crypto to start? No. The 500 free credits are pre-funded. You only need a real wallet when you want to earn money by publishing your own API.

How do credits work? 1 credit = $0.005 USD. Most services cost 2 credits ($0.01) per call. You get 500 free credits at registration, which is ~$2.50 worth of API calls — roughly 250 calls to $0.01 endpoints.

What happens when credits run out? You get an HTTP 402 response. You can buy more credits through the platform or connect an on-chain wallet for direct USDC payments.

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

Is this production-ready? 299 services, 359K+ requests, 318 agents, and counting. The protocol (x402) is governed by the Linux Foundation with 40 members including Visa, Mastercard, Stripe, and Cloudflare. The marketplace is live and processing real payments.

What chains are supported? Base (USDC) is the primary settlement chain. Multi-chain support is on the roadmap.