x402 Explained: How AI Agents Pay for Things
HTTP 402 sat unused since 1997. Now Coinbase's x402 protocol uses it to let any API or website charge per request in stablecoins, the payment rail for the agent economy. What it is, how it works, and where it stands.
Guillaume Rufenacht
AI Product Manager · Lisbon
There’s an HTTP status code that has sat unused since 1997: 402, Payment Required. The web reserved it for a future that never arrived, paying for things online without accounts, subscriptions, or card fees. That future is finally being built, and it’s aimed less at humans clicking buttons than at AI agents transacting at machine speed. The protocol is called x402.
I build in this space, so let me give you the clear version: what x402 is, how it works, why it matters now, and where it actually stands.
Key takeaways
- x402 is an open protocol (from Coinbase) that lets any website or API charge per request in stablecoins, over plain HTTP.
- It revives HTTP 402 'Payment Required': hit an endpoint, get a price, pay, retry with proof, receive the goods. No signup or API keys.
- It exists because card fees make sub-cent payments impossible and the ad model breaks down for agents, which are now most web traffic.
- Backers include the Cloudflare + Coinbase x402 Foundation and a Google agent-payments extension; Gartner sees machine customers in $30T of purchases by 2030.
- It's real but early: a huge surge, then a sharp cooldown. The infrastructure works; the use cases are still forming.
What x402 actually is
In one sentence: x402 is an open payment protocol, developed by Coinbase, that lets websites and APIs charge per request using stablecoins like USDC, built directly into normal web traffic. You (or your agent) ask for something, the server names a price, you pay, you get it, no subscription, no account, no API key to juggle. The name comes from HTTP 402, the “Payment Required” status code that has been a placeholder for decades. x402 is what finally fills that hole: a standard way for software to negotiate and settle tiny payments instantly.
How it works
Request
402 with a price
Pay and retry
Verify and deliver
For a seller, this is roughly one line of middleware: wrap the route, set a price and a network, done. That low friction is the whole point, it turns a normal web request into a one-time micro-purchase that code can handle on your behalf.
Why it matters now
Two structural problems make this more than a crypto curiosity. First, card rails can’t do micropayments: a 30-cent-plus fee per transaction means charging a penny per API call runs at an absurd loss, so everyone defaults to logins, subscriptions, and prepaid credits. Second, the ad model that funds the open web assumes humans who click banners, and bots and agents, already the majority of internet traffic, don’t. As more of the web is consumed by agents, “pay a fraction of a cent per request” starts to look like the natural business model. Gartner projects that machine customers, agents acting as buyers, will influence $30 trillion in purchases by 2030.
The ecosystem forming around it
x402 is chain-agnostic, shipping on Base (an Ethereum L2) and Solana, with facilitators competing to process payments and a discovery layer so agents can find paid endpoints, effectively a directory for machines. The seriousness shows in the boring-but-critical parts: Cloudflare and Coinbase formed an x402 Foundation to push a neutral open standard, Google’s agent-payments protocol added an x402 extension, and a proposed standard for portable agent identity (ERC-8004) would pair cleanly with it, who the agent is, plus how it pays.
The honest status
What to watch
The signal worth tracking isn’t the token charts, it’s utility: pay-per-call APIs that beat monthly plans, media that charges cents per unlock without a login, and agents that buy data mid-workflow with no human at the keyboard. When those markets ramp, the picture changes. This is the machine-native payment layer the agent economy needs, and the reason I’ve been building in it.
The takeaway
Building at the edge of AI and payments is part of what I do, see my work (including x402.new) and seven years across crypto and markets, or get in touch.
Frequently asked questions
What is x402?
An open payment protocol from Coinbase that lets websites and APIs charge per request using stablecoins like USDC, built directly into HTTP. It revives the long-dormant HTTP 402 “Payment Required” status code.
How does an x402 payment work?
You hit a paid endpoint, the server returns a 402 with the price and network, your wallet or agent pays the exact amount and retries with proof, and the server verifies and delivers, no signup or API keys.
Why does x402 matter for AI agents?
Card fees make sub-cent payments impossible and agents don't click ads, so the old web business models break for them. x402 lets an agent pay a fraction of a cent per request on its own, enabling machine-to-machine commerce.
Is x402 widely adopted yet?
It's early. Activity surged then cooled sharply, but the infrastructure works and serious backers (a Cloudflare + Coinbase foundation, a Google agent-payments extension) are building around it.
Work with me
Want a system like this built for your pipeline?
I help teams take AI from a clever prototype to dependable production, outbound engines, lead intelligence, and the LLM pipelines underneath. See what I have shipped or get in touch.