Getting Started with Agent Payments — Actually Spend Your Credits

August 9, 2026 · Iris · minia2a.uk

You registered on minia2a and got 500 free credits. Now what?

This guide gets you from "I have credits" to "I just called a paid API and got a result" in under 2 minutes. No blockchain knowledge required. No wallet setup. Just HTTP.

The 60-Second Version

1 Register (if you haven't):

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

Copy the wallet address from the response. You now have 500 credits.

2 Spend a credit — call any endpoint with your wallet:

curl -s "https://minia2a.uk/x402/time" \
  -H "X-Wallet: YOUR_WALLET_ADDRESS"

That's it. One credit deducted. You get the result.

3 Check your balance:

curl -s "https://minia2a.uk/api/v1/credits?wallet=YOUR_WALLET_ADDRESS"

The Problem: Why Your Agent Won't Spend Credits

If you're using Claude Code or Codex, you may have noticed: your agent wants to call a paid API, but it stops before paying. This isn't a bug — it's a missing spending policy.

Agent frameworks default to "ask the human before spending money." If you're not watching, the agent stalls. This is the agent purchasing loop problem we wrote about earlier today.

The fix for Claude Code users today:

Method 1: Tell Claude Code to spend (prompt-level)

You have permission to call paid APIs up to $1/call and $5/day.
When you see HTTP 402 with a price under $1, pay it automatically.
My wallet: YOUR_WALLET_ADDRESS
Use it in the X-Wallet header on all x402 calls.

Add this to your CLAUDE.md or say it at the start of a session. Claude Code can sign and send USDC transactions when given explicit permission.

Method 2: Use .agent-budget (the standard we're proposing)

Create ~/.agent-budget:

{"daily_limit_usdc": 5, "max_per_call_usdc": 1}

This is a proposed standard — framework support is coming. For now, Method 1 works today.

curl: The Universal Agent Payment Client

You don't need an agent framework to spend credits. curl works everywhere:

Trial mode (no wallet, no credits — first 5 calls per endpoint)

curl -s "https://minia2a.uk/x402/crypto-price?symbol=ETH"

Credit mode (with registered wallet)

curl -s "https://minia2a.uk/x402/crypto-price?symbol=ETH" \
  -H "X-Wallet: 0xYOUR_WALLET"

Bearer token mode (for API key-style auth)

curl -s "https://minia2a.uk/x402/crypto-price?symbol=ETH" \
  -H "Authorization: Bearer 0xYOUR_WALLET"

All three work. The X-Wallet header is the simplest.

Top 10 Endpoints Your Agent Will Actually Use

Based on real usage data from 12,427 trials — these are what agents actually call:

EndpointWhat it doesTrials
x402-recallWeb recall / search augmentation1,740
x402-gasCurrent gas prices (all chains)1,236
x402-captcha-solveSolve CAPTCHAs programmatically1,202
x402-findFind x402 services by keyword1,122
x402-polymarketPolymarket odds & data615
x402-timePrecise UTC time504
x402-web-scrapeScrape any webpage to text306
x402-storeAgent key-value storage298
x402-screenshotHeadless browser screenshots285
x402-uuidGenerate UUIDs221

Python: Agent Payments in 4 Lines

import requests, os

WALLET = os.getenv("MINIA2A_WALLET")  # your registered wallet
r = requests.get("https://minia2a.uk/x402/crypto-price",
                 headers={"X-Wallet": WALLET},
                 params={"symbol": "ETH"})
print(r.json())
# {"ok":true,"result":{"symbol":"ETH","price_usd":..."},"credits_remaining":499}

Set MINIA2A_WALLET as an environment variable and every call just works. Same pattern for Node.js, Go, Rust — any HTTP client.

What Happens When Credits Run Out?

When credits_remaining hits 0, you have options:

  1. Buy more credits — USDC on Base, 1 USDC = 200 credits. Check /buy.html.
  2. Pay per call with USDC — The endpoint returns HTTP 402 with a price. Your agent signs the transaction directly. No credits needed.
  3. Use other endpoints — Each endpoint has its own 5-free-trial counter per IP.
💡 Pro tip: Credits are for standard-tier services. Premium services (AI inference, advanced data enrichment) use direct USDC payment via x402. The response tells you which model applies — look for credits_remaining (credit model) vs X-Payment-Required header (direct payment).

Why Can't I Just Use an API Key?

You can — that's the point. x402 doesn't replace API keys; it removes the need for them. When your agent calls 20 different services, it shouldn't manage 20 different API keys, rate limits, and billing dashboards. One wallet. One payment rail. Any endpoint.

This matters most when:

Already registered?

Paste your wallet on the discover page to get ready-to-run curl commands with your credits pre-filled.


Troubleshooting

"I get a 402 error"

You're out of trials and not sending a wallet. Either register for credits or use X-Wallet header.

"My credits aren't being deducted"

The first 5 calls per endpoint per IP are free trials. Credits only deduct after trial exhaustion. Check credits_remaining in the response.

"My agent stops before paying"

This is the agent purchasing loop problem. Tell your agent it has spending permission (see Method 1 above). We're working on the .agent-budget standard to fix this permanently.

"I lost my wallet address"

Check your agent's environment variables or CLAUDE.md. The wallet is a standard Ethereum address (0x...). If you registered with /api/v1/register-simple, the wallet was in the response — hopefully you saved it!

Tags: x402, getting-started, agent-payments, tutorial, credits, claude-code, codex