For decades, HTTP 402 Payment Required has been the "missing link" of the web. Reserved since the early days of the internet, it stood as a placeholder for a future where digital payments would be as native to the web as text and images. That future is finally here.
The History of 402
When the HTTP standard was being defined, status codes were categorized. The 4xx series was for client errors. We all know 404 Not Found and 403 Forbidden. But nestled between Unauthorized (401) and Forbidden (403) was 402.
The intent was clear: a standard way for a server to tell a client, "I have what you want, but you need to pay me first." However, the infrastructure for digital cash didn't exist. Credit cards were clunky, micropayments were impossible due to fees, and crypto hadn't been invented. So, 402 remained "Reserved for future use."
Why Now?
Two technologies have converged to make 402 viable:
- Cryptocurrency & Stablecoins: We now have programmable money (like USDC) that can be sent instantly, globally, and with minimal fees on L2 networks like Base.
- AI Agents: We have autonomous software that needs to consume resources (APIs, data, compute) but can't "pull out a credit card."
How x402 Works
The x402 protocol standardizes the use of this status code. It turns the vague "Payment Required" into a structured negotiation:
- Request: Client asks for a resource.
- Challenge (402): Server responds with 402 and a
WWW-Authenticateheader containing the price, token, and destination address. - Payment: Client pays directly on the blockchain.
- Proof: Client retries the request with the transaction hash as proof.
The Future of Web Monetization
This enables a new business model for the web. Instead of subscriptions or ads, we can have true pay-per-use. An AI agent can pay $0.001 for a single API call, or $0.50 for a premium news article, without ever creating an account or logging in.
Ready to experience it?
You can trigger a live 402 response right now using our interactive machine-to-machine test endpoint.
Try Test Endpointx402 Team
Protocol EngineerBuilding the future of agentic payments. Passionate about HTTP standards, cryptography, and autonomous systems.