What x402 is
x402 is an open protocol that revives the HTTP 402 "Payment Required" status code for per-request payments, mostly USDC stablecoin on Base. AI agents and scripts use it to pay APIs without accounts or API keys. A typical exchange:
- The client requests a resource and gets 402 back, with the requirements in the body and, in protocol v2, in a
PAYMENT-REQUIREDheader. - The client signs a payment authorization (EIP-3009
transferWithAuthorization) and retries with anX-PAYMENT(v1) orPAYMENT-SIGNATURE(v2) header. - The server settles through a facilitator and returns the data, plus an
X-PAYMENT-RESPONSE/PAYMENT-RESPONSEheader with the transaction hash.
Reading amounts
Amounts are integers in the token's smallest unit. USDC has 6 decimals, so "1000" is 0.001 USDC and "1000000" is 1 USDC. Networks can be legacy names (base, base-sepolia) or CAIP-2 IDs (eip155:8453, eip155:84532). Known USDC contract addresses are labelled automatically.
Decoding is local. Nothing is signed or sent, and the tool never asks for a wallet.
FAQ
Can this tool pay a 402 for me?
No. It only reads headers. Paying needs a wallet and an x402 client library such as x402-fetch or x402-axios.
Where can I find x402 APIs to try?
Directories such as x402scan list live services. The sample above is a real 402 response from ScrapeMole, which runs pay-per-call data APIs for agents.