x402: What Happens When an API Asks to Be Paid?
An AI agent is trying to price a shipment. It asks a carrier’s API for a quote. The server sends back neither a number nor a link to a signup page. It sends a price for the quote itself: two cents. If the agent is allowed to spend that amount, it can authorize the payment, repeat the request, and get the answer. Nobody has to open an account with the carrier just to find out what a box costs to ship.
Now suppose the two cents leave the wallet, but the quote never arrives. Should the agent try again? That sounds like a minor customer-service issue until the same software is buying ten thousand quotes a day. The first scenario explains why x402 is interesting. The second explains why it’s a payments story rather than just a clever way to call an API.
The web had a code for this, but no agreed way to pay
If you’ve ever followed a broken link, you’ve seen HTTP 404. Its less famous neighbor, 402, is named “Payment Required.” The HTTP semantics standard published in June 2022 still described that code as reserved for future use. The label was there; an agreed set of instructions for turning that reply into a payment wasn’t.
x402 gives software a way to act on that reply. Coinbase created the protocol, and on July 14, 2026, the Linux Foundation announced that the x402 Foundation was operational and that Coinbase had completed its contribution of the protocol. The distinction matters: x402 is a specification that services can implement. It isn’t a stablecoin, a blockchain, or a feature that automatically comes with an ordinary web browser.
Follow the two cents
In our shipping example, the agent asks for a quote and receives a 402 response. The response includes machine-readable terms: what the carrier is charging, which asset and network it accepts, and where the payment should go. Say the carrier wants 0.02 USDC on a supported network. The agent checks whether that offer fits its spending policy. If it does, its wallet signs a payment authorization and the agent resends the request with that signed information attached.
The carrier can handle verification and settlement itself or use a service called a facilitator. These are two different jobs. Verification checks whether the signed payment information meets the terms. Settlement is what executes the payment under the chosen scheme. In a straightforward fixed-price flow, the service can return the quote with a payment result. Other schemes can handle the timing differently, so a successful verification by itself is not a reason to mark the invoice paid.
The HTTP exchange tells each side how to ask for payment and respond to it. It does not, by itself, move the money. In this example, the transfer of USDC happens on a blockchain. And the agent’s wallet signature answers a narrower question than it might seem: it authorizes a particular payment under the scheme’s rules. It does not tell the carrier whether the company actually wanted the agent to buy this quote, at this price, for this job. That decision still lives with the buyer’s own controls.
When two cents beats a monthly invoice
Imagine a small importer needs 30 shipping quotes in a month, spread among several providers. It might happily pay two cents per quote rather than set up separate accounts or commit to several subscriptions. For the providers, it’s a way to earn something from occasional customers who would never get through a sales call. The case is especially strong when the thing being sold can be priced and delivered in one request: a shipping estimate, a single data lookup, or a small unit of compute.
The calculation changes when the buyer knows it will use the same provider heavily. At two cents per call, 1,000 calls cost US$20, but 50,000 cost US$1,000. A negotiated plan may come with a lower price, a service-level commitment, a predictable bill, and someone to call when the data is wrong. The seller also has costs beyond moving the money. If a two-cent transaction creates a support ticket that takes ten minutes to resolve, it takes a lot of clean sales to make up for that one.
That points to a plausible business use: let an unfamiliar customer buy a few calls without committing, then offer a contract once its usage justifies one. The value isn’t necessarily that the money settles faster. It’s that the first sale can happen before either side has invested much time in the relationship.
There’s a third option between a subscription and paying every time: prepaid credits. Suppose a data provider asks for US$20 upfront and deducts two cents for every lookup. A customer who needs only 30 lookups uses US$0.60 and has US$19.40 left on that provider’s ledger. If the customer goes elsewhere for the next job, that balance may sit unused. With x402, a buyer can pay for just the 30 lookups without leaving the rest of the money with that particular seller.
But the buyer still needs a way to fund the wallet, and the seller still has to account for what it receives. Imagine ten providers that all accept the same token on the same network. A buyer could use one balance across all ten instead of topping up ten separate accounts. If those providers accept different assets or networks, the buyer may be back to managing several balances. And for a buyer that already uses one supplier every day, a prepaid balance can be simpler: the supplier can count calls on its own ledger without settling each one separately. The economic advantage depends on how many sellers the buyer uses and how often it switches.
The expensive part is figuring out what happened
Return to the missing quote. A timeout could mean the payment never went through. It could also mean the transfer settled and the response was lost on the way back. If the agent signs a new payment every time it sees a timeout, it risks paying twice for the same answer. If the carrier serves quotes whenever it sees a signature without checking the payment state, the reverse problem is possible: it could deliver without getting paid.
The foundation’s facilitator documentation recognizes this ambiguity. It describes a pending result when a transaction has been broadcast but confirmation is uncertain, and a way to reconcile against that transaction on retry. That helps with the money leg. The carrier still needs to decide how to identify the original quote request, whether to return the same result on retry, and what to do if payment settled but the quote cannot be delivered. Recording only a wallet transfer leaves half the story missing.
The refund matters for the same reason. In a simple on-chain transfer, the merchant should not assume the buyer can initiate a card-style chargeback that unwinds the original payment. The service needs a way to identify the disputed charge and route a refund if one is owed. The buyer needs something more useful than a list of wallet transfers: a record of which calls were made, what they returned, and which charges were refunded. The two cents that arrive on-chain are easy to count. The two cents that belong to this failed quote are the ones that take work.
Give the software a budget, not a blank check
A person normally notices when a quote tool starts charging for things that used to be free. A software loop may notice only that another request needs to be made. A per-request limit helps, but it doesn’t catch volume: a hundred thousand requests at two cents each is US$2,000, with no single purchase large enough to look alarming. A buyer can set a cap for the whole job, restrict which services the agent can pay, and stop the workflow if failures pile up instead of letting it keep buying its way through them.
For a pilot, the revealing test isn’t whether the first two-cent payment works. It’s what both sides can prove after they deliberately interrupt the connection. Can the buyer tell whether it paid? Can the seller return the original result without collecting again? Can both tie the charge to the work it was supposed to buy?
A subscription asks the customer to make a buying decision before it knows exactly what it needs. x402 can move that decision all the way down to a single request. That makes small purchases easier to start. Whether it makes them worth repeating depends on what happens to the second request when the first one goes wrong.
Important sources
IETF, RFC 9110: HTTP Semantics, Section 15.5.3:
https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.3
x402 Foundation, HTTP Transport Specification:
https://github.com/x402-foundation/x402/blob/main/specs/transports-v2/http.md
x402 Foundation, Facilitator and Settlement:
https://github.com/x402-foundation/x402/blob/main/docs/core-concepts/facilitator.md
The Linux Foundation, Operational Launch of the x402 Foundation:
