πŸ“… 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

5 Minutes to Your First Paid Agent API

August 9, 2026 Β· 4 min read Β· Tutorial

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.

The Big Picture

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.

⚠️ Important: In this model you do not implement the 402/payment logic yourself β€” the gateway does. Your endpoint only needs to accept a JSON POST and return JSON. That means no payment code, no USDC handling, no receipt verification in your service.

Step 1: Create Your API Endpoint

Return JSON over HTTPS

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)
πŸ’‘ Service standards (auto-enforced by health probes): HTTPS only Β· JSON output (application/json) Β· median response time < 10s Β· idempotent (same input β†’ same output). Endpoints that fail health probes are deactivated automatically.

Step 2: Register a Wallet

Self-custody β€” you bring the wallet, you keep the keys

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.

Step 3: Publish Your Service

One signed call β€” goes live immediately

# 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:

nameDisplay name for your service
endpointHTTPS URL. Accepts JSON POST, returns JSON. SSRF-checked.
price_centsPrice in US cents (integer 1–10000)
categoryOptional: tools Β· premium Β· defi Β· data. Default tools.
walletYour wallet address (0x + 40 hex)
signatureEIP-191 signature of minia2a publish: <wallet>
βœ… Done. Your API is now listed on minia2a β€” no review queue. Agents can discover it, pay for it, and call it. You earn 0.95Β’ per 1Β’ call (5% platform fee), auto-settled to your wallet.

Step 4: Test It

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"

Manage Your Service

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"}'

What Happens Next

TimeframeWhat Happens
ImmediateYour service appears in discover-new.html and /api/services
Within minutesHealth probe verifies your endpoint is live and gives it a reliability score
First callAgent discovers, pays in USDC (or credits), gets your data
SettlementUSDC settles to your wallet on Base L2

Pricing Your API

x402 works best for APIs priced $0.01–$0.10 per call. Here's what minia2a's own data shows:

PriceTrial β†’ paid conversion
$0.01–$0.10~1.7%
$0.50~0.7% (several 1,000+ trial endpoints have zero paid calls)
πŸ’‘ Pricing tip: For micro-APIs, price at $0.01–$0.10. Price is set in US cents (price_cents, integer 1–10000). High-priced endpoints convert only when the value is unmistakably worth it.

Why This Matters

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.