Skip to content

x402

x402, the open protocol that uses HTTP 402 Payment Required for per-request payments, mostly in stablecoins: how it works, agent uses and the x402 Foundation.

Updated October 4, 2026 5 min read .md

In short: x402 is an open payment protocol that puts the payment step inside an HTTP request. A server answers with status 402 Payment Required and its price, the client retries with a signed payment, and the server delivers the resource. Coinbase released it in May 2025, mainly for stablecoin payments. It is aimed at AI agents and software paying per request for APIs, data and content. Since July 2026 it has been run by the x402 Foundation under the Linux Foundation.

Why HTTP 402

The HTTP specification has reserved status code 402, “Payment Required,” since the 1990s, but never defined how to use it. x402 fills that gap. The idea is that paying for a web resource should work like any other HTTP exchange, with no account signup, API key, subscription or card form. That matters for AI agents. An agent may need data from hundreds of services it has never used before, often for amounts too small for card fees to make sense.

How it works

Version 2 of the protocol defines three HTTP headers, each carrying a Base64-encoded JSON object:

  1. Request. The client (for example an agent) requests a resource.
  2. 402 response. The server returns 402 Payment Required with a PAYMENT-REQUIRED header. It lists the accepted payment options: scheme, network, asset, amount and recipient address.
  3. Payment. The client picks an option, signs a payment authorization with its wallet, and retries the request with a PAYMENT-SIGNATURE header.
  4. Verification and settlement. The server checks the payment, usually through a facilitator, then delivers the resource with a PAYMENT-RESPONSE header confirming settlement.

Facilitators

A facilitator is an optional service with /verify and /settle endpoints. It checks payment payloads and submits them to the blockchain for the server, so the server doesn’t need its own blockchain infrastructure. x402.org runs a free facilitator for testing only. Commercial facilitators support production networks, and teams can also run their own.

Schemes and networks

  • exact: a fixed price per request, for example $0.01 per API call.
  • upto: the client authorizes a maximum, and the server charges actual usage up to that cap. This suits metered work such as LLM tokens.
  • batch settlement / deferred: the payment is authorized up front and settled later in aggregate. Cloudflare proposed a deferred scheme for high-frequency uses such as paying per crawl.

The protocol is designed to work with any network, token or currency. Implementations cover EVM chains (such as Base and Polygon), Solana and several others. Most volume is in USD stablecoins such as USDC. The Linux Foundation reported that Solana carried nearly 65% of x402 transaction volume in 2026. Card and fiat payments are described as future or partner-provided options. SDKs exist in TypeScript, Python and Go. x402 runs over plain HTTP and also defines an MCP transport for paid tool calls.

Use by AI agents

Typical agentic uses include:

  • Paid APIs and data: an agent pays per call for market data, search, inference or enrichment, without an account.
  • Content and crawling: publishers charge AI crawlers and agents per page or per session. Cloudflare connected x402 to its pay-per-crawl work and its Agents SDK.
  • Paid MCP tools: an MCP server prices individual tools, and the agent pays when it calls one.
  • Agent-to-agent services: one agent buys a service from another.

In consumer retail, x402 is less common than card-based flows. Its main overlap with shopping is through AP2. Google released an x402 extension for AP2 in September 2025, so an agent can settle in stablecoins under an AP2 mandate. AP2 then supplies the proof of user authorization and x402 handles the payment.

Strengths and limits

StrengthsLimits
No accounts or API keys; works at the HTTP layerRequires a crypto wallet and stablecoin balance on the client side
Low-cost, fast settlement suits sub-cent paymentsCard-style consumer protections (chargebacks) don’t apply by default
Open, network-agnostic spec with several implementationsMerchant accounting, tax and compliance tooling is less mature than for cards
Fits automated, per-request pricingProving which agent is paying needs a separate layer such as Web Bot Auth

Governance: the x402 Foundation

  • May 2025: Coinbase releases x402.
  • September 2025: Coinbase and Cloudflare announce plans for an x402 Foundation to steward the protocol.
  • April 2, 2026: the Linux Foundation announces it will host the x402 Foundation. Coinbase contributes the protocol. Initial members include Adyen, AWS, American Express, Base, Circle, Cloudflare, Coinbase, Fiserv, Google, KakaoPay, Mastercard, Microsoft, Polygon Labs, PPRO, Shopify, Solana Foundation, Stripe, thirdweb and Visa.
  • July 14, 2026: the foundation becomes operational with about 40 member organizations. Premier members include Adyen, AWS, American Express, Circle, Cloudflare, Coinbase, Fiserv, Google, Mastercard, Shopify, Solana Foundation, Stripe and Visa.

The spec repository is licensed under Apache 2.0 and has a technical steering committee.

Relationship to other payment protocols

  • AP2 is about authorization and evidence. x402 is about moving the money. They are used together through the AP2 x402 extension.
  • Card-network programs (Visa, Mastercard) serve card-based consumer purchases. Mastercard’s 2026 “Agent Pay for Machines” and Stripe and Tempo’s Machine Payments Protocol (MPP) compete with x402 for machine-to-machine payments. Several card networks and PSPs are also x402 Foundation members.
  • Checkout protocols (ACP, UCP) cover carts, shipping and orders, which x402 doesn’t attempt.

Practical notes

  • API and content providers can add x402 through middleware for common web frameworks, or through edge providers.
  • Agent developers need a wallet with spending limits and a policy for which 402 prices the agent may pay without asking the user.
  • Finance teams should plan for stablecoin treasury, accounting and tax treatment before taking significant volume.

Sources

The newsletter

Agentic commerce, explained as it happens.

New protocols, launches and what they mean for you. Plain language, no hype.

I'm a…