An independent guide to the x402 protocol

The web finally has a way to charge by the request.

x402 turns the long-dormant HTTP 402 status code into a working payment rail — letting APIs, AI agents, and software pay each other in stablecoins, instantly, with no accounts or invoices. Here's what it actually does, and how to use it.

> GET /api/forecast/hourly
 
402 Payment Required
price: $0.004 USDC
network: base
pay-to: 0x4f2...e91a
 
> GET /api/forecast/hourly
X-PAYMENT: eyJzY2hlbWUiOi...
 
200 OK
{ "temp": 14.2, "conditions": "overcast" }

How x402 actually works

Four steps, no account required, settled on-chain in seconds.
STEP 01

Request

A client — a browser, an app, or an AI agent — requests a resource over normal HTTP. Nothing unusual yet.

More ↓

The client can be anything that speaks HTTP: a browser with a wallet extension, a script, an AI agent running autonomously, or another server. The initial request looks identical to any other HTTP request — no special headers, no payment information attached. The server decides whether the resource is paid or free; the client doesn't need to know in advance.

This is one of x402's design strengths: existing HTTP clients don't need to be rebuilt from scratch. Any client that can add a header to a request can participate in the x402 payment flow.

Read the full x402 explainer →
STEP 02

402 response

If the resource is paid, the server replies with status 402 and the exact terms: price, accepted token, network, and where to send it.

More ↓

The 402 response body contains a structured payment payload: the amount (in USDC or another supported stablecoin), the blockchain network to pay on (Base, Solana, or others), the wallet address to send to, and a time window within which the payment must be made. It also includes a nonce — a unique value that prevents the same payment being reused for multiple requests.

The HTTP status code 402 ("Payment Required") was reserved in the original HTTP specification in 1991 but never formally used until x402 gave it a concrete meaning. Every browser and server already understands the status code — the protocol adds the payment payload on top of existing infrastructure.

x402 terms explained →
STEP 03

Signed payment

The client signs a stablecoin payment (usually USDC) and retries the same request with the payment attached in a header.

More ↓

The client uses EIP-3009 (transferWithAuthorization) to sign a USDC transfer matching the exact terms from the 402 response — same amount, same recipient, same network. The signature is attached to the retried request in the X-PAYMENT header as a base64-encoded token.

Critically, the client doesn't need to broadcast a transaction to the blockchain at this point — the signed authorization is just a cryptographic proof of intent. The actual on-chain transfer happens in the next step, handled by the facilitator. This keeps the client-side flow simple and fast.

How to make your first x402 payment →
STEP 04

Settlement & delivery

A facilitator verifies the payment on-chain. Once confirmed, the server returns 200 OK with the resource. The whole loop takes seconds.

More ↓

When the server receives the retried request with the X-PAYMENT header, it passes the signed authorization to a facilitator — a service that submits the transaction to the blockchain, waits for confirmation, and returns a settlement receipt. Once the facilitator confirms payment, the server delivers the resource with a 200 OK response and an X-PAYMENT-RESPONSE header confirming settlement.

On Base, this settlement typically takes 1–3 seconds. On Solana, closer to 400 milliseconds. The facilitator handles all the blockchain interaction so neither the server nor the client needs to run their own blockchain infrastructure.

Compare facilitators →
WHY IT MATTERS

No accounts, no minimums

There's no signup, no card minimum, no subscription. A request costing a fraction of a cent is now economically possible — which it never was under card networks.

More ↓

Credit card processing has fixed costs — typically $0.20–0.30 per transaction plus a percentage — that make charging less than around $1 economically irrational. This is why the web defaulted to subscriptions and advertising: there was no viable way to charge small amounts for individual pieces of content or API calls.

x402 settles on Layer 2 blockchains where transaction costs are fractions of a cent. A payment of $0.001 is now economically viable, opening up pricing models that were never possible before: pay-per-article, pay-per-API-call, pay-per-second-of-compute. For AI agents making hundreds of calls per session, this changes the economics of what's worth building.

The agentic economy explained →
WHO BUILT IT

Open, not proprietary

Coinbase shipped the original spec; it's now stewarded by the x402 Foundation alongside Cloudflare, with Google, Visa, Stripe, and AWS among the members. No single company controls it.

More ↓

Coinbase published the original x402 specification in May 2025. In April 2026, governance transferred to the x402 Foundation, hosted under the Linux Foundation — the same neutral governance model used by Linux, Kubernetes, and other major open infrastructure projects. This means no single company can unilaterally change the protocol or lock in proprietary advantages.

Foundation members include Google, Visa, Stripe, AWS, Mastercard, American Express, Cloudflare, Circle, Shopify, and Fiserv — a coalition broad enough to signal that this is becoming shared internet infrastructure rather than one company's product. The protocol specification is open source and available on GitHub.

Full history and background →

Choosing a facilitator

A facilitator verifies and settles the on-chain side of a payment so you don't have to run blockchain infrastructure yourself. Here's how the main options differ.
Facilitator Networks Free tier Best for
Coinbase CDP Base, Polygon, Arbitrum, World, Solana 1,000 tx/mo, then $0.001/tx Most reference implementations; best documentation
Cloudflare Base (native Workers support) Included with Workers plans Teams already running on Cloudflare infrastructure
Solana-native facilitators Solana Varies by provider Sub-second finality, very high transaction volume

This table reflects the publicly documented state of each provider and changes as the protocol evolves. Always confirm current pricing and network support directly with the provider before integrating.

Guides

Plain explanations, written for people deciding whether and how to use x402 — not for protocol engineers.
Explainer What is x402? The HTTP status code that finally does something 7 min read
Comparison x402 vs. Stripe's Agent Commerce Protocol: what's the actual difference? 6 min read
Guide Should your API accept x402 payments? A practical checklist 8 min read
Reference x402 terms explained: facilitator, resource server, scheme, and more 5 min read
Guide How to actually pay an x402 request: a setup guide 9 min read
Safety Is x402 safe? How to spot scams trading on its name 6 min read
Comparison x402 vs MPP: comparing the two main agent payment protocols 7 min read
Use Case x402 for content creators: charge per article, per view, per minute 7 min read
Guide x402 on Base vs Solana: which network should you use? 6 min read
Explainer What is the agentic economy, and where does x402 fit? 8 min read
Technical x402 in production: the things nobody tells you 18 min read
Technical x402 and MCP servers: how AI tools get paid 14 min read
Legal x402 and the law: money transmission, MiCA, and the regulatory grey zone 12 min read
Guide How to price your x402 API: a practical guide 10 min read

New guides, sent occasionally

No spam, no daily digest — just a note when we add something genuinely new to the site.