The reserved status code
Defined in HTTP/1.1 (RFC 2616, 1997) as "Payment Required" and marked "reserved for future use." The x402 pattern finally uses it: a server replies 402 with machine-readable payment terms (amount, asset, chain, pay-to address) in headers.
Why stablecoins, why Base
Card rails charge ~$0.30 + 2.9% per transaction — impossible for a 5-cent API call. USDC on an L2 like Base settles in ~2 seconds for a fraction of a cent, making true micropayments viable for machine-to-machine commerce.
No accounts, no API keys
Classic paid APIs require a human: create account, verify email, enter a card, copy an API key. The 402 flow replaces all of that with a cryptographic payment proof attached to the retried request — the payment is the authentication.
The loop
1) Agent calls the tool. 2) Server returns 402 + terms. 3) Agent's wallet signs a USDC transfer and re-sends the request with an X-PAYMENT proof header. 4) Server verifies, runs the job, returns 200.
Worked example: a research agent's day
Say an autonomous agent scrapes 40 pages, calls a summarizer 12 times, and geocodes 30 addresses. Every call is pay-per-use via 402:
| Tool | Calls | Unit price | Subtotal |
|---|---|---|---|
| Web scraper actor | 40 | $0.005 | $0.200 |
| Summarizer API | 12 | $0.020 | $0.240 |
| Geocoder | 30 | $0.002 | $0.060 |
| Total spent autonomously | $0.500 | ||
With card rails the fixed fees alone would be $24.60 (82 × $0.30). With USDC on an L2, network fees total under a penny — a ~2,500× cost reduction on payment overhead. That gap is the whole reason this pattern exists.