A status code with a 30-year backlog
When the HTTP/1.0 spec was published in 1996, the authors reserved status code 402 for future use. Their reasoning was prescient: the internet would eventually need a standardized way to express "this resource requires payment." The note in the original RFC read simply: "Payment Required — reserved for future use."
That future arrived slowly. The problem was never technical — it was a coordination problem. For 402 to be useful, both the client and server needed to agree on what payment looked like. Credit card numbers in a header? An API key tied to a billing account? The ecosystem never converged.
Then AI agents started browsing the web autonomously. And suddenly, the coordination problem had a natural forcing function.
What x402 changes
x402 is an open protocol — backed by Coinbase, Google, Anthropic, Stripe, Visa, and others — that standardizes how a server can request payment and how a client can fulfill that request, all within a single HTTP exchange.
The core idea is elegant: when a server needs payment before serving a resource, it returns a 402 response with a machine-readable payment descriptor in the body. The client parses the descriptor, executes the payment, and retries the original request with a X-Payment header containing the transaction receipt. The server validates the receipt and serves the resource.
No redirects. No OAuth. No billing portal. Just HTTP.
Why this matters for AI agents: An autonomous agent can't click a "subscribe" button or enter a credit card number. x402 gives agents a machine-native payment interface that works within their existing HTTP call patterns.
The x402 payment flow
Here's the complete interaction sequence:
The X-Payment header contains a signed JWT proving the transaction was executed. The server can verify this receipt against the payment network without a round-trip — the signature is self-contained.
Implementing an x402 endpoint with Proco
If you're building a service that agents will pay to access, here's how to add x402 support using Proco's server SDK:
Handling 402 responses in your agent
On the agent side, Proco's client SDK intercepts 402 responses automatically and handles the payment flow before retrying:
Who's behind x402
The x402 protocol was proposed by Coinbase and has gathered backing from Google, Anthropic, Stripe, and Visa — a rare cross-industry alignment that signals this is becoming a real standard, not just an experiment. The spec is open and the reference implementation is on GitHub.
Proco's role is as payment infrastructure: we issue the agent wallets, enforce spending policies, validate payment receipts, and provide the settlement layer. You get x402 support out of the box — no blockchain integration required on your end.
What to read next
- Why Your AI Agent Needs Its Own Wallet — spending policies, agent identity, and non-custodial design
- LangChain + Proco — add a payment tool to a LangChain agent in 8 steps
- x402 reference documentation — full spec, payment descriptor schema, receipt validation