You have an API. AI agents want to call it. But you don't want to manage API keys, rate limits, or billing for thousands of machine clients.
Here's the alternative: x402 pay-per-call. You publish a JSON endpoint, minia2a wraps it with the x402 payment challenge, and agents pay in USDC. You get 95% of every paid call. No sign-ups, no dashboards, no API key management.
This tutorial gets you from zero to earning USDC in 5 minutes. You'll need: a JSON endpoint on HTTPS, a self-custody wallet, and 2 minutes to register + publish on minia2a.
Agent minia2a gateway Your API
β β β
ββ GET /x402/your-api βββββΆβ β
βββ HTTP 402 + accepts[] βββ€ β
β (agent settles USDC) β β
ββ retry + proof ββββββββββΆβ β
β ββ POST /run (paid) ββββββββΆβ
β βββ 200 JSON ββββββββββββββββ€
βββ 200 + data βββββββββββββ€ β
Three parties. You set the price and serve the data. minia2a handles the 402 challenge, payment, settlement, and receipts. The agent gets the result. You get USDC auto-settled to your wallet.
Your endpoint must accept a JSON POST and return JSON. Here's a minimal example:
# Python (Flask)
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/run', methods=['POST'])
def run():
# minia2a's gateway already verified payment before forwarding this call.
data = request.get_json(silent=True) or {}
return jsonify({
"ok": True,
"data": "Hello, paying agent!",
"echo": data,
"timestamp": "2026-08-09T17:00:00Z"
})
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8000)
application/json) Β· median response time < 10s Β· idempotent (same input β same output). Endpoints that fail health probes are deactivated automatically.
Registration binds 5 free trial calls to a wallet you control. You sign a message to prove ownership; the platform never generates or holds a wallet for you. No KYC.
# message to sign (EIP-191 personal_sign):
minia2a register: 0xYOUR_WALLET
# then register:
curl -X POST https://minia2a.uk/api/v1/register-simple \
-H "Content-Type: application/json" \
-d '{"name":"my-first-agent-api","wallet":"0xYOUR_WALLET","signature":"0xSIG"}'
Response:
{
"ok": true,
"wallet": "0xYOUR_WALLET",
"credits": 500,
"message": "5 free trial calls bound to your wallet"
}
Save your wallet address β it's your identity and where your USDC revenue settles.
# message to sign:
minia2a publish: 0xYOUR_WALLET
# JavaScript (ethers.js):
const sig = await wallet.signMessage(`minia2a publish: ${wallet.address}`);
# then publish:
curl -X POST https://minia2a.uk/api/v1/publish-service \
-H "Content-Type: application/json" \
-d '{
"name": "My First Agent API",
"endpoint": "https://your-server.com/run",
"price_cents": 1,
"category": "tools",
"wallet": "0xYOUR_WALLET",
"signature": "0xSIG"
}'
Fields:
name | Display name for your service |
endpoint | HTTPS URL. Accepts JSON POST, returns JSON. SSRF-checked. |
price_cents | Price in US cents (integer 1β10000) |
category | Optional: tools Β· premium Β· defi Β· data. Default tools. |
wallet | Your wallet address (0x + 40 hex) |
signature | EIP-191 signature of minia2a publish: <wallet> |
Call your service through minia2a's gateway to see the full flow. Your service gets an id like x402-my-first-agent-api:
# First call β agent gets HTTP 402 challenge with accepts[] offers
curl -i https://minia2a.uk/x402/my-first-agent-api
# Registered agent with credits calls directly (auto-debit):
export WALLET=0xYOUR_WALLET SERVICE=x402-my-first-agent-api TS=$(date +%s)
export SIG=0xYOUR_SIGNATURE # EIP-191 personal_sign of: minia2a trial:$WALLET:$SERVICE:$TS
curl "https://minia2a.uk/x402/my-first-agent-api?wallet=$WALLET" \
-H "X-Wallet-Signature: $SIG" -H "X-Trial-Timestamp: $TS"
Update price/endpoint/name or delist at any time using your service id:
# update β sign: minia2a update: <id>
curl -X PUT https://minia2a.uk/api/services/x402-my-first-agent-api \
-H "Content-Type: application/json" \
-d '{"wallet":"0xYOUR_WALLET","signature":"0xSIG","price_cents":3}'
# delist β sign: minia2a deregister: <id>
curl -X DELETE https://minia2a.uk/api/services/x402-my-first-agent-api \
-H "Content-Type: application/json" \
-d '{"wallet":"0xYOUR_WALLET","signature":"0xSIG"}'
| Timeframe | What Happens |
|---|---|
| Immediate | Your service appears in discover-new.html and /api/services |
| Within minutes | Health probe verifies your endpoint is live and gives it a reliability score |
| First call | Agent discovers, pays in USDC (or credits), gets your data |
| Settlement | USDC settles to your wallet on Base L2 |
x402 works best for APIs priced $0.01β$0.10 per call. Here's what minia2a's own data shows:
| Price | Trial β paid conversion |
|---|---|
| $0.01β$0.10 | ~1.7% |
| $0.50 | ~0.7% (several 1,000+ trial endpoints have zero paid calls) |
price_cents, integer 1β10000). High-priced endpoints convert only when the value is unmistakably worth it.
The agent economy needs API providers more than it needs infrastructure. Every new paid endpoint makes the ecosystem more useful. Your API β whether it's a niche data transform, a domain-specific AI prompt, or a proprietary algorithm β could be the one that 10,000 agents call tomorrow.
Ready to earn from AI agents?
Register a wallet, sign a publish message, go live. No KYC. USDC on Base.
Register Your API βPublished August 9, 2026. x402 is an open protocol governed by the Linux Foundation. minia2a is an independent marketplace implementing the x402 standard.