HTTP's 402 Error Sat Dead for 29 Years — It Just Became a Cash Register for AI Agents
Author(s): Chew Loong Nian – AI ENGINEER Originally published on Towards AI. HTTP's 402 Error Sat Dead for 29 Years — It Just Became a Cash Register for AI Agents There's a status code in the HTTP spec that has been reserved since 1997 and almost never used: 402 Payment Required. For 29 years it sat there as a placeholder, a joke among backend developers, the "we'll figure out internet money later" IOU of HTTP/1.1. After the introduction, the article explains why x402 is arriving now: AI agents generate traffic that breaks the old ad/subscription/click-through monetization model, and blocking alone protects costs without earning revenue. x402 fixes this by turning HTTP into a payment flow where servers can respond with 402 plus a machine-readable price, then accept a signed payment proof in a follow-up request for edge verification and settlement (typically USDC stablecoins). It details the protocol handshake and how AWS CloudFront/WAF and Cloudflare’s Monetization Gateway implemented it at the edge with minimal overhead and optional outcome-based pricing, then shows how to wire x402 into an API and an agent using open-source SDKs. The piece also compares x402 to other “agents + money” standards (ACP/AP2) and addresses skeptics’ concerns—bot impersonation, accounting/tax invoicing, and attempts to route around paid access—before concluding who should adopt it (API/dataset/MCP sellers, Cloudflare users via the waitlist, and agent builders) and how to get started quickly with a testnet demo. Read the full blog for free on Medium. Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming a sponsor. Published via Towards AI
