The 402 "Payment Required" status code sat unused for ~30 years. Now it's how agents pay for APIs — here's how x402 actually works

Reddit r/AI_Agents Tools

Summary

Explains how the long-unused HTTP 402 status code has become the foundation of x402, a protocol that lets AI agents pay for APIs by signing USDC transactions on-chain without accounts or KYC.

A status code reserved in the web's original spec back in the late '90s — 402 Payment Required — was never standardized. It just sat there. In the last year it became the backbone of machine-native payments, and since most explanations are either marketing or whitepapers, here's the practical version. The flow: your agent requests a paid endpoint → the server responds with a 402 and the payment requirements (asset, amount, network, recipient) → the agent signs a USDC payment locally (EIP-712/EIP-3009 — keys never leave the machine) → it retries the request with the signed payload attached → the server verifies, settles on-chain, and returns the data. Seconds, no account, no card. Why it matters for agent builders specifically: agents can't pass KYC or click checkout. x402 gives them a native way to buy data, tools and compute. The scary part — runaway spend — is handled at signing time: per-transaction, daily and monthly limits enforced before a signature exists. The two halves people conflate: the merchant side (issue the 402 challenge, verify the signature, settle) and the buyer side (read the challenge, sign, retry). You can build either yourself, or use a facilitator that runs verification + settlement so you don't manage gas wallets. Current state of the ecosystem: roughly 200k transactions a day, average payment well under a dollar, mostly USDC on Base and Solana. It's early — the whole market is a few thousand active sellers — which is exactly why it's interesting now. Happy to answer questions on the protocol mechanics — I work on this at a facilitator, so I'm keeping links out of the post (details on request).
Original Article

Similar Articles