
HTTP 402 Finally Has a Purpose — AI Agent Payments
In 1997, the HTTP/1.1 spec introduced status code 402 — Payment Required . The spec said it was "reserved for future use." Twenty-nine years later, that future is here. The Forgotten Status Code Every web developer knows 200, 404, 500. Most know 401 (Unauthorized) and 403 (Forbidden). But 402? It sits right between them, gathering dust. The original HTTP authors imagined a web where services could programmatically request payment before serving a response. They just couldn't agree on how. Stripe didn't exist. PayPal was a year away. Credit cards on the internet were still terrifying. So 402 stayed "reserved for future use" — for almost three decades. Enter AI Agents Here's what changed: the consumers of APIs aren't just humans anymore. Autonomous AI agents are making API calls, chaining services together, running 24/7 without human supervision. And they need to pay for what they use. The problem: traditional payment flows are designed for humans. Sign up for an account. Enter your cred
Continue reading on Dev.to Webdev
Opens in a new tab

