x402 API Market
The NoelClaw API Market (/api-market in the webapp) lets anyone sell an HTTPS API per call and lets agents buy calls with USDC on Base — no account or API key required. Payments use the x402 protocol pattern: HTTP 402 Payment Required as the challenge, a payment header as the receipt.
How a paid call works
Agent NoelClaw Seller
│ 1. GET /market/call/slug │ │
│──────────────────────────────>│ │
│ 2. 402 + PAYMENT-REQUIRED │ │
│<──────────────────────────────│ │
│ 3. pay USDC on Base │ │
│ 4. retry + PAYMENT-SIGNATURE │ │
│──────────────────────────────>│ 5. verify tx, dedupe │
│ │─────────────────────────────>│
│ 7. 200 + PAYMENT-RESPONSE │ 6. proxy response │
│<──────────────────────────────│<─────────────────────────────│Call
GET/POSThttps://api.noelclaw.com/market/call/{slug}with no payment.The server responds
402with aPAYMENT-REQUIREDheader — base64-encoded JSON (x402 v2 shape with anaccepts[]array).X-Payment-Requiredis set too for legacy clients. The challenge includes:network:eip155:8453(Base mainnet)asset: USDC0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913payTo: the settlement wallet (read it from the challenge — never hardcode)maxAmountRequired: price in USDC micro-units (6 decimals)requestId: unique id for this challenge
Pay the amount in USDC on Base to
payTo(schemeexact, settled as a plain ERC-20 transfer — the tx hash is your receipt).Retry the same request with the header
PAYMENT-SIGNATURE: base64("txHash:requestId").X-Paymentis accepted as a legacy alias.The server verifies the transfer on-chain (recipient + amount), rejects reused tx hashes and request ids, then proxies the request to the seller's private endpoint.
The response carries a
PAYMENT-RESPONSEheader — base64 settlement receipt with the tx hash.
Free listings (price = 0) skip the challenge entirely and proxy directly.
Example
Selling an API
List any HTTPS endpoint from the Sell tab on /api-market:
The endpoint URL is never exposed to buyers — calls proxy through NoelClaw.
Pricing is a flat USDC amount per call (cap: 100 USDC).
Settlement: seller keeps 95%, platform fee 5%. Payout wallet is your NoelClaw Base wallet.
Every purchase is recorded in a ledger (
apiMarketplacePurchases) with request id, tx hash, and fee split — the same dual-write pattern used by Surplus-style markets.
Replay protection
Each payment is single-use, enforced at two levels:
requestId— one challenge, one fulfillment.txHash— one on-chain transfer can never pay for a second call, even with a new request id.
MCP tool payments
The same machinery backs paid MCP tools (X-Payment header on api.noelclaw.com tool routes). All MCP tools are currently free — prices in TOOL_PRICES are set to 0 and can be re-enabled per tool. All x402 flows attach the Base Builder Code (builderCode) for attribution in the Base Dashboard.
Related
Environment Variables —
NOEL_WALLET_ADDRESS,BASE_RPC_URL,BASE_BUILDER_CODE
Last updated
Was this helpful?