What is x402? How an AI agent pays with HTTP 402
What is x402: the open protocol that lets an AI agent pay an API inside the HTTP request, with stablecoins. The headers, the facilitator, who accepts it.
The looot team · , updated · 6 min read
On this page
x402 is an open protocol that lets a client, often an AI agent, pay for an API inside the HTTP request itself. The server answers with status 402 and its price, the agent signs a stablecoin payment and sends the request again, and the server returns the data. There is no account, no API key and no checkout page.
This post explains what x402 is, how the 402 and the payment headers work, what a facilitator does, who accepts x402 today, and what looot does instead. Every fact comes from the x402 repository, x402.org and Coinbase's developer docs, read on 2026-10-14.
What is x402, in one paragraph
HTTP has had a status code for payment since the early web. MDN calls 402 Payment Required "a nonstandard response status code reserved for future use", created "to enable digital cash or (micro) payment systems" (MDN). x402 gives that code a format. x402.org calls it "an open, neutral standard for internet-native payments" (x402.org). The reference code is open source under the Apache 2.0 license, now in the x402 Foundation repository.
How an x402 payment works, step by step
The x402 repository lists the flow. In short:
- The agent sends a normal request, for example `GET /company?domain=stripe.com`.
- The server answers `402 Payment Required` with a `PAYMENT-REQUIRED` header. It holds, base64 encoded, the payment options it accepts: network, token, amount and where to pay.
- The agent picks one option and signs a payment payload with its wallet.
- The agent sends the same request again with a `PAYMENT-SIGNATURE` header that carries the signed payload.
- The server checks the payload, on its own or through a facilitator's `/verify` endpoint, then does the work.
- The server settles the payment through the facilitator and returns the data with a `PAYMENT-RESPONSE` header that holds the settlement result.
The agent never holds an account with the seller. Its wallet signature is the proof of payment, and the signed payload limits what can move. The repository says no scheme may let "the facilitator or resource server to move funds, other than in accordance with client intentions".
What a facilitator does in x402
A facilitator is the service that checks and settles payments so the seller's server does not talk to a blockchain itself. Coinbase runs one. Its docs say it "validates signed payments, screens transactions, submits settlement onchain", with OFAC checks (CDP facilitator).
- Networks: Base, Polygon, Arbitrum, World and Solana, among others listed on the same page.
- Tokens: any ERC-20 token on its EVM networks through EIP-3009 or Permit2, and SPL tokens on Solana.
- Price for the seller: the first 1,000 onchain transactions a month are free, then $0.001 each, and verification is free (CDP facilitator, read 2026-10-14).
x402.org itself says the protocol charges "zero protocol fees". Network fees and a facilitator's fee are separate.
Who accepts x402 today
Sellers can list x402 endpoints in Coinbase's Bazaar, which its docs call a marketplace for x402 endpoints. Coinbase says it "has processed more than 100 million x402 payments across Base and Solana" (CDP x402 overview).
On the buyer side, some agent wallets speak it:
- Ramp lets an agent pay x402 from "a separately funded x402 wallet" (Ramp agents).
- The AgentCard CLI from Alchemy has an `x402 fetch` command that pays from its USDC wallet (AgentCard skill page).
- Stripe and Tempo's MPP added "x402 exact flows" to its SDK on June 8, 2026 (mpp.dev).
Our agentic payments roundup ranks these wallets by setup steps.
x402 vs a prepaid balance
| x402 | Prepaid balance | |
|---|---|---|
| Account with the seller | None | One workspace |
| Money | Stablecoins from the agent's wallet | Card on a hosted checkout, paid by a person |
| When money moves | Each call | Once per top-up |
| What the agent holds | A wallet key | An API key |
| Who approves a payment | Nobody, the wallet signs | A person, once per top-up |
A prepaid balance asks a person once, then the agent runs alone until it is empty. x402 asks nobody, but the agent must hold funds and a key that can sign. That key is money: anyone who reads it can spend the wallet.
Is the 402 that looot returns an x402 payment?
No. When a looot workspace runs out of credit, a run answers `402 insufficient_balance` with a Stripe Checkout link, as the skill file says. That 402 is a message for a person. It has no `PAYMENT-REQUIRED` header, and an x402 wallet cannot pay it.
What it cannot do
x402 moves stablecoins only. A buyer with cards and no wallet cannot use it. The seller must accept it, and many data APIs do not yet. A signed payment cannot be reversed by a card network, so a buyer has no chargeback. On looot, x402 does not work today. Last checked 2026-10-14.
Try it
Prompt for your agent
Check how an API wants to be paid
For x402 marketplaces next to other API marketplaces, see RapidAPI alternatives for AI agents. For the card and Stripe side, read the MPP explainer.
Questions
Keep reading
Agentic payments: 7 ways an AI agent can pay for an API
Agentic payments in 2026, ranked by setup steps: Stripe Link, x402, MPP, Slash, Ramp, AgentCard and Crossmint, and how each one would pay an API seller.
The looot team · · 10 min read
Machine payments protocol: Stripe MPP explained for agents
The Machine Payments Protocol (Stripe MPP) explained: the 402 flow, shared payment tokens, Link's wallet for agents, and what a seller must build to accept it.
The looot team · · 6 min read
RapidAPI alternatives for AI agents, compared by how you pay
RapidAPI alternatives for AI agents compared on billing and fit: Apify, Bright Data, Composio, x402 marketplaces and a pay-per-call gateway, with dated prices.
Walid Boulanouar · · 7 min read
Try it with the agent you already use
Start your workspace, top up, and paste one prompt into your agent.