Research · Agent economy · updated 2026-11-20
HTTP 402 & x402: How AI Agents Pay for Content
x402 uses the reserved HTTP 402 Payment Required status so a server can quote a price and an AI agent can pay with a signed payload and retry in one exchange, with no accounts or API keys. It is open source and hosted under the Linux Foundation.
You're reading the full report — free for humans and search engines.
The same content ships as a structured JSON dataset (normalized facts, sources and
citation arrays, no HTML parsing) so AI agents can consume it directly — metered per fetch via the open
HTTP 402 payment protocol.
crawlerAutoPrice=true · verify at https://esa.aisa.one/api/v1/access/verify
HTTP 402 Payment Required sat reserved for future use in the HTTP specifications for decades with no standard flow behind it. x402, built by Coinbase, gives it one. A server states what payment it accepts, the client attaches a signed payment payload, and the server verifies and settles before returning the resource. This matters for AI agents because they cannot fill in checkout forms, store cards or navigate consent screens. With x402 they can pay for APIs, data and compute inline, provided their wallet already holds spending authority. This brief covers the request flow, the three V2 headers, the role of facilitators, governance, reported usage figures, and how x402 differs from card-network approaches to agent payments.
Key concepts
- HTTP 402 Payment Required
- A status code reserved for future use in HTTP specifications. x402 activates it with a concrete flow: the server states accepted payment, the client attaches a signed payload, and the server settles before responding. S1 · metamask.comS3 · stablecoininsider.org
- Facilitator
- An optional but widely used service that checks a payment payload against server requirements and submits settlement onchain. It verifies and executes signed payloads but does not hold buyer funds or act as custodian. S1 · metamask.comS4 · spark.money
- V2 payment headers
- Three Base64-encoded JSON headers: PAYMENT-REQUIRED (server to client), PAYMENT-SIGNATURE (client to server) and PAYMENT-RESPONSE (server to client). They replace the deprecated V1 headers. S1 · metamask.comS3 · stablecoininsider.org
- Agentic wallet
- The wallet decides custody, permissions and signing for an agent, while x402 decides how a payment is priced and settled. Hands-free payment requires the wallet to hold spending authority already. S1 · metamask.com
- Gasless authorization and Permit2
- For EIP-3009 tokens such as USDC, the client signs a gasless authorization. For other ERC-20 tokens, the client uses Permit2. S7 · eco.com
The x402 request, pay and retry flow
- Client requests a resourceA human-operated app or autonomous agent sends a standard HTTP request to a paid endpoint, with no special headers.
- Server answers 402 with termsThe server returns 402 Payment Required and a PAYMENT-REQUIRED header describing accepted options: scheme, network, price and destination address.
- Client signs a payment payloadThe client selects one accepted option and uses its wallet to build a signed payment payload matching it.
- Client retries with PAYMENT-SIGNATUREThe original request is resubmitted with the signed payload attached in the PAYMENT-SIGNATURE header.
- Server verifies and settlesThe server verifies the payload locally or through a facilitator, and the payment settles onchain.
- Resource returned with receiptThe server responds with the requested resource and a PAYMENT-RESPONSE header reporting the settlement result, success or failure.
Challenge, retry and the V2 headers
x402 turns the reserved 402 status into a challenge-and-retry exchange, a pattern familiar from 401 and 407 flows. A client requests a resource, and the server replies with 402 Payment Required and a PAYMENT-REQUIRED header listing accepted options such as scheme, network, price and destination. The client signs a payload for one of those options and retries with a PAYMENT-SIGNATURE header. The server verifies the payload, directly or through a facilitator, settles onchain, and returns the resource with a PAYMENT-RESPONSE header reporting success or failure. In x402 V2 all three headers carry Base64-encoded JSON and replace the deprecated V1 headers. V2 is the recommended version, with standardized identifiers, better type-safety and more modularity. The PAYMENT-REQUIRED payload includes the token contract address, amount in atomic units, network in CAIP-2 format, recipient wallet address, accepted schemes and a resource description.
Governance, openness and reported usage
Coinbase built x402 and published its whitepaper in May 2025. Coinbase and Cloudflare co-founded the x402 Foundation in September 2025, and in April 2026 the Linux Foundation formally adopted the protocol at the MCP Dev Summit, with 22 founding members including Visa, Mastercard, Google, Stripe, AWS and Circle. The Linux Foundation now hosts the independent x402 Foundation. The protocol is open source under the Apache 2.0 license, with reference implementations in TypeScript, Python and Go. By April 2026 Coinbase reported 165 million cumulative transactions, roughly $50 million in volume and 69,000 active AI agents. Facilitators are live across Base, Solana, Polygon, Avalanche and other networks, so sellers are not tied to a single chain. Unlike Stripe's proprietary Machine Payments Protocol, x402 is an open specification.
Implementation: facilitators, tokens and middleware
For sellers, the facilitator absorbs the blockchain work. It checks the payload against the server's requirements and submits settlement, so the server needs no blockchain nodes or wallet management. A facilitator verifies and executes signed payloads but does not hold buyer funds or act as custodian, and it also checks the client's balance before settling. On the client side, payment construction depends on the token. EIP-3009 tokens such as USDC use a gasless authorization signature, while other ERC-20 tokens use Permit2. One source describes adding x402 to an API as comparable to adding an API key check, roughly 10 lines of middleware code, and notes that Cloudflare supplies Workers-native middleware for APIs deployed there. Custody, permissions and signing remain the wallet's responsibility, not the protocol's.
x402 versus card-network agent payments
| Aspect | x402 | Card-network approaches |
|---|---|---|
| Payment rail | Stablecoins on blockchain rails | Existing tokenization infrastructure behind global card commerce |
| Named offerings | Open-source protocol supported by Coinbase | Mastercard Agent Pay (April 2025) with Agentic Tokens; Visa Intelligent Commerce APIs |
| Account or key model | No API keys, monthly subscriptions or minimum transaction amounts | Extends the trust layer of card-on-file and contactless transactions to AI-initiated purchases |
| Spending limits | Wallet must already hold the authority to spend | Visa lets users specify what an agent can purchase and the limits on it |
Timeline
- 1997HTTP specification reserves status code 402 for Payment Required.spark.money
- 2025-04Mastercard introduces Agent Pay, built on existing tokenization infrastructure.ctse.aei.org
- 2025-05Coinbase Developer Platform publishes the x402 whitepaper.spark.money
- 2025-09Coinbase and Cloudflare co-found the x402 Foundation.spark.money
- 2026-04Linux Foundation formally adopts x402 at the MCP Dev Summit.spark.money
Common pitfalls
- Build against V2. The PAYMENT-REQUIRED, PAYMENT-SIGNATURE and PAYMENT-RESPONSE headers replace the deprecated V1 headers, and V2 is the recommended version.
- x402 prices and settles payments but does not grant spending authority. The agent's wallet must already be authorized to spend, and it controls custody, permissions and signing.
- Do not treat a facilitator as a custodian. It verifies and executes signed payloads but does not hold buyer funds.
- The signed payload must match one of the options the server listed. The token and network choice differ by scheme: EIP-3009 tokens use gasless authorization, other ERC-20 tokens use Permit2.
Key takeaways
- x402 gives the reserved HTTP 402 status a working flow: price in the 402 response, signed payload on retry, resource after verification and settlement.
- V2 standardizes on three Base64-encoded JSON headers, and facilitators spare sellers from running their own blockchain infrastructure.
- The protocol is open source under Apache 2.0 and hosted under the Linux Foundation, while the agent's wallet still governs custody and spending permissions.
FAQ
What is the x402 protocol?
x402 is an open payment protocol that uses the HTTP 402 Payment Required status code. A server requests payment, and the client responds with a signed payment payload in the same HTTP exchange, so agents can pay for APIs, data and compute without accounts or checkout flows.
Which headers does x402 V2 use?
PAYMENT-REQUIRED carries accepted payment options from server to client. PAYMENT-SIGNATURE carries the client's signed payload to the server. PAYMENT-RESPONSE carries the settlement result back. All three are Base64-encoded JSON and replace the deprecated V1 headers.
Do I need a facilitator to accept x402 payments?
A facilitator is optional but widely used. It verifies the payment payload against your requirements and submits settlement onchain, so your server needs no blockchain infrastructure. Servers can also verify locally. Facilitators do not hold buyer funds.
Who governs x402?
Coinbase built x402. Coinbase and Cloudflare co-founded the x402 Foundation in September 2025, and the Linux Foundation formally adopted the protocol in April 2026 with 22 founding members. The protocol is open source under the Apache 2.0 license.
How this page is made. Built from the full text of 8 sources found with the AISA Tavily API (advanced search), refreshed weekly. A language model organizes what those sources state into the blocks above; each block links the sources it draws on, and figures that do not appear in the sources are removed.
Sources & citations
- What is x402? HTTP 402 payments for AI agents metamask.com
- Explainer: How will AI Agents pay each other using the x402 payments protocol cfotech.ca
- x402 Explained: HTTP 402 Payments for AI Agents in 2026 stablecoininsider.org
- x402: The HTTP Payment Protocol That Lets AI Agents Spend Money on the Internet | Spark spark.money
- How AI Agents Pay for Things: x402 on Solana Explained youtube.com
- x402 Payment Protocol: How AI Agents Will Pay Online digitalapplied.com
- x402 Protocol Explained: How AI Agents Pay Onchain | Support eco.com
- 402 "Payment Required": The HTTP Code That Waited 30 Years and Why It Matters Today - Center for Technology, Science, and Energy ctse.aei.org