x402 — The Simplest Way for a Web Page to Charge a Fee (2/5)
Put a coin in a vending machine, out comes a drink. x402 recreates that exact simple exchange on the web.
Picture a vending machine
Standing at a vending machine is beautifully simple. You drop in a coin, a drink comes out. No sign-up, no ID, no card approval. Just the coin and the drink — that one exchange.
That’s exactly what x402 does. It turns a website into a vending machine.
When an AI asks a service “give me this data,” the server replies “that’ll be 0.3 cents,” the AI drops in a digital coin (USDC) on the spot, and the data comes out. No account, no card number, no human click.
A traffic light switched off for 30 years
Here’s a fun fact: the signal for this was built into the web from the very beginning.
Back in the 1990s, the web’s designers created a set of “response signals.” The famous “404 – Page Not Found” is one of them. And alongside it, they also created “402 – Payment Required.”
The problem was, there was no way to actually use it back then. The internet had no way to pass a few cents back and forth. So this “402” traffic light sat switched off for over 30 years.
x402 is what finally turned that old light on. That’s where the name comes from.
Here’s how it actually flows
Put the process of an AI buying paid data into plain words, and it goes like this:
- AI: “Give me this data, please.”
- Server: “That’s 0.3 cents. (flips on the 402 signal) Payment required.”
- AI: checks its wallet → “0.3 cents? Within budget. Here’s a digital coin.”
- Server: verifies the payment → “Confirmed. Here’s your data.”
The whole thing wraps up in a couple of seconds, no human involved — just like dropping a coin and grabbing a drink from a machine.
Why developers love it
x402’s biggest appeal is its simplicity.
If you’re the one selling a service, you don’t have to bolt on some complex payment system. Add a few lines to your web service and you can start taking money from AI right away. No membership management, no approval flow, no middleman.
So the approach caught on fast. Coinbase created it, then internet-infrastructure company Cloudflare and payments company Stripe joined in. Even Amazon (AWS) picked x402 first when adding payment features to its AI service.
It has weak spots too
Nothing’s perfect, of course. x402 has limits.
- Crypto only. The AI must hold stablecoins, and the seller must be willing to settle in crypto.
- It leans on a “gatekeeper.” x402 uses a middle verifier (a “facilitator”) that confirms whether a payment is real. If that gatekeeper goes down, the whole system stalls. It calls itself decentralized, but at this one point, everything funnels through a single spot.
Think of this less as a flaw and more as a clue — it hints at why the other approaches we’ll cover next even exist.
This part in one line
x402 = tech that turns a web page into a vending machine. The AI drops in a coin (stablecoin) and the service comes right out.
Next time we look at AP2 and MPP. One works like “an allowance limit your parent set in advance,” the other like “running a tab at a bar and settling up all at once later.”
This is Part 2 of ChainLab’s series, “Agent Payments, Explained Simply.”