What Is x402? The HTTP 402 Payment Protocol for AI Agents
x402 is an open payment protocol that puts payments inside normal web requests. When a client asks for a paid resource, the server answers with HTTP status 402 (Payment Required) and a price. The client, often an AI agent, signs a stablecoin payment, usually in USDC, and sends the same request again with the payment attached. There is no account to create, no API key to manage and no checkout page.
This guide explains how x402 works step by step, the terms you will see in the spec, what changed in x402 V2, which networks it runs on, what it costs, and when a regular crypto checkout is the better fit. OrcaRail does not offer x402 payments today, and the end of this post explains what it offers instead.
What is x402
x402 describes itself as "an open, neutral standard for internet-native payments" (x402.org). Coinbase's x402 documentation puts it more concretely: x402 "lets a server charge for a resource through the same request used to fetch it" (x402 FAQ).
The name comes from HTTP status code 402, Payment Required. The HTTP standard defines the code but leaves it unused: "The 402 (Payment Required) status code is reserved for future use" (RFC 9110). x402 gives that code a real job.
- Who made it. Coinbase started the work on x402 (Cloudflare and Coinbase announcement), and the protocol launched in May 2025 (x402 V2 announcement).
- Who runs it now. On 14 July 2026, the Linux Foundation announced the operational launch of the x402 Foundation, "a new open-governance body formed to steward the x402 protocol," which Coinbase contributed (announcement).
- Where the code is. github.com/x402-foundation/x402, under the Apache-2.0 license, with SDKs for TypeScript, Python and Go.
The protocol facts in this post come from x402.org, the x402 Foundation repository and Coinbase's x402 FAQ, checked on 12 November 2026.
How x402 works, step by step
The repository describes the typical flow. In short:
- The client asks for a resource, for example
GET /api/report. - The server answers
402 Payment Required. APAYMENT-REQUIREDheader lists the payment options it accepts: scheme, network, token, amount and the address to pay. - The client picks one option and signs a payment with its wallet.
- The client sends the same request again, with the signed payment in a
PAYMENT-SIGNATUREheader. - The server verifies the payment, on its own or by calling a facilitator's
/verifyendpoint. - The server does the work and settles the payment on-chain, on its own or through the facilitator's
/settleendpoint. - The server returns
200 OKwith the resource and aPAYMENT-RESPONSEheader that holds the settlement result.
If the client already knows the price, it can skip the first round trip and pay with its first request.
On the wire, it looks like this. Each header value is base64-encoded JSON:
GET /api/report HTTP/1.1
Host: api.example.com
HTTP/1.1 402 Payment Required
PAYMENT-REQUIRED: <price, network, token and pay-to address>
GET /api/report HTTP/1.1
Host: api.example.com
PAYMENT-SIGNATURE: <the signed payment>
HTTP/1.1 200 OK
PAYMENT-RESPONSE: <settlement result>
x402 terms: client, server, facilitator and scheme
| Term | What it means |
|---|---|
| Client | The app, script or AI agent that pays. It needs a wallet with a token balance, usually USDC. |
| Resource server | The API or website that charges. It answers unpaid requests with 402 and a price. |
| Facilitator | "A server that facilitates verification and execution of payments for one or many networks." It is optional: a resource server can verify and settle payments itself. |
| Scheme | How the payment works. The repository lists exact (a set amount, such as $1 to read an article), upto (the client allows a maximum, and the seller settles the actual usage up to that cap) and batch-settlement (EVM only: many small charges settled on-chain in batches). |
What changed in x402 V2
The V2 announcement and Coinbase's FAQ list these changes:
- New headers.
PAYMENT-REQUIRED,PAYMENT-SIGNATUREandPAYMENT-RESPONSEreplace V1'sX-PAYMENTandX-PAYMENT-RESPONSE. All payment data now travels in headers; V1 sent the payment requirements in the response body. - Standard network names. Networks use CAIP-2 IDs. Base is
eip155:8453, and a Solana network issolana:followed by its genesis hash. - Sessions. V2 "adds wallet-based identity (skip repaying on every call)."
- Extensions and plugins. New features ship as extensions instead of changes to the spec. One example is Discovery, which lets x402 services publish metadata that facilitators can index. In the SDKs, chains, tokens and schemes are plugins.
- Backward compatibility. The reference SDKs are "fully backward-compatible with V1."
Which networks and tokens x402 supports
x402.org says the protocol "is blockchain-agnostic and supports all EVM-compatible chains, Solana, and more," and that "stablecoin payments are the primary use case." It is also designed to extend to traditional payment methods.
What works in practice depends on the facilitator you use. Coinbase's hosted facilitator, for example, settles on Base, Polygon, Arbitrum, Monad, World and Solana mainnets (FAQ). It accepts ERC-20 tokens on those EVM networks and SPL or Token-2022 tokens on Solana. Tokens that implement EIP-3009, such as USDC and EURC, settle without the buyer holding a gas token. Other ERC-20 tokens go through Permit2, which can add a one-time approval that the buyer pays gas for.
What x402 costs
- Protocol fee: none. x402.org lists "Zero protocol fees" and says the protocol is "free for the customer and the merchant—just pay nominal payment network fees."
- Network fee. Each settlement is a blockchain transaction, and someone pays its gas. Coinbase's facilitator pays it and covers it with its per-transaction price.
- Facilitator fee. Each facilitator sets its own. Coinbase's facilitator makes the first 1,000 transactions each month free, then charges $0.001 per transaction. Verification is free.
x402 vs a crypto payment gateway
| x402 | Crypto payment gateway | |
|---|---|---|
| Who pays | Software: an AI agent, a script or an app with a wallet | People, on a payment page |
| When payment happens | Inside the HTTP request, per call | At checkout, per order or billing period |
| Pricing | Per request: an exact amount, or up to a cap | Orders, invoices and subscriptions |
| How the payer pays | The client signs in code, with no page | The customer pays from a wallet on a hosted page |
| How your backend learns about it | The PAYMENT-RESPONSE header of the same request | Webhooks and a dashboard |
| OrcaRail today | Not offered | Yes |
The two solve different problems. x402 suits APIs, data and content that software buys on its own, one request at a time. A payment gateway suits selling to people: a product page, an invoice or a monthly plan.
Who x402 is for
- API and data providers that want to charge per call without accounts or API keys.
- AI agent builders whose agents must pay for tools, data or content on their own.
- Publishers that want to charge per article or per request instead of a subscription.
If your customers are people buying products, plans or services, a hosted checkout is still the simpler path. People expect a payment page, a receipt and a way to manage their subscription.
How to start with x402
- Read the spec in the x402 Foundation repository and pick a scheme.
exactis the simplest. - Install an SDK. The README lists TypeScript packages under
@x402/, a Python package (pip install x402) and a Go module. - Test on a testnet first, for example Base Sepolia (
eip155:84532). Our testnet faucets guide lists where to get free test USDC. - Choose a facilitator, or verify and settle payments in your own server.
- Move to mainnet once test payments settle as expected, with a wallet you control as the pay-to address.
What OrcaRail offers instead
OrcaRail does not support x402 today. It is a crypto payment gateway for selling to people. Customers pay on a hosted checkout (payment intents), through a payment link, or with a subscription, in USDC, USDT or other tokens on EVM chains, Solana and Bitcoin. Each payment is forwarded to your own wallets. OrcaRail charges 0.5% per completed transaction, and the first 100 transactions are free (pricing).
AI agents can still run those payments for you. The OrcaRail MCP server lets Claude Code, Cursor and Codex create checkouts and subscriptions from a prompt; AI agent payments shows how to connect it in a sandbox. To build an integration with an AI coding agent, give it llms.txt and see Build with AI.
Want USDC from customers today? See how to accept USDC payments.
FAQ
What does x402 stand for?
It is named after HTTP status code 402, Payment Required, which the HTTP standard reserves for future use. x402 is a protocol, not a coin: payments move existing tokens, mostly stablecoins such as USDC.
Is x402 free to use?
The protocol itself has no fees. You still pay network fees, and a facilitator may charge for verifying and settling payments. Coinbase's facilitator, for example, makes the first 1,000 transactions each month free and then charges $0.001 per transaction (checked on 12 November 2026).
Does x402 work on Solana?
Yes. x402.org lists EVM chains and Solana, and Coinbase's facilitator settles on Solana mainnet. In V2, a Solana network is named solana: followed by its genesis hash.
Where is the x402 GitHub repository?
At github.com/x402-foundation/x402, under the Apache-2.0 license. The older coinbase/x402 repository is now a development fork, and its issues and pull requests moved to the x402 Foundation repository.
Does OrcaRail support x402?
Not today. OrcaRail offers hosted checkouts, payment links and subscriptions for people who pay in USDC, USDT and other tokens, and an MCP server that lets AI agents create those payments for you.
