Paying with x402
x402 revives HTTP 402 Payment Required for machine payments. Premium endpoints quote a price, your agent signs a USDC transfer authorization, and the content is released once a facilitator settles it on Base Sepolia (testnet). Accounts and API keys are not needed.
Terms
| Price | $0.20 USD per premium request (200000 atomic units of USDC) |
|---|---|
| Network | Base Sepolia (testnet) (eip155:84532) |
| Asset | USDC 0x036CbD53842c5426634e7929541eC2318f3dCF7e |
| Scheme | exact (EIP-3009 transferWithAuthorization; gasless for the payer) |
| Pay to | being configured |
| Protocol versions | x402 v2 (PAYMENT-REQUIRED / PAYMENT-SIGNATURE / PAYMENT-RESPONSE) and legacy v1 (X-PAYMENT / X-PAYMENT-RESPONSE) |
Flow
- Request a premium URL. You get
402with a base64 JSONPAYMENT-REQUIREDheader (v2). The JSON body repeats the terms in v1 format and includes a free preview. - Your client picks
accepts[0], signs an EIP-3009 authorization for the exact amount topayTo, and retries withPAYMENT-SIGNATURE(v2) orX-PAYMENT(v1). - We verify the payment with the facilitator, build your response, settle on-chain, and only then return
200with aPAYMENT-RESPONSEheader containing the transaction hash. - Keep the
X-Archive-Receiptheader: sending it back asX-Archive-Receipt(orAuthorization: Receipt …) re-serves the same resource free for 24 hours.
Guarantees
- Nothing is charged for missing resources (404 before any payment request), handler errors, or failed settlements.
- Paid responses are marked
Cache-Control: private, no-store. - The price in the 402 quote is the price you pay. Payment authorizations expire after 5 minutes.
MCP payments
Paid MCP tools follow the x402 MCP transport: an unpaid tools/call returns an error result whose structuredContent is the PaymentRequired object; retry the call with the payment in params._meta["x402/payment"]. The settlement receipt comes back in result._meta["x402/payment-response"]. See MCP.
Humans
Dossier pages include a wallet button that does the same thing in your browser with any EIP-1193 wallet (for example MetaMask or Coinbase Wallet).