What x402 Is
The HTTP 402 status code has existed since the earliest web specifications, originally reserved for "Payment Required" but never formally defined. x402 fills that gap. It is a protocol specification — originally open-sourced by Coinbase in 2025 and now under Linux Foundation governance — that defines a structured, machine-readable payment flow over standard HTTP.
The core insight is that AI agents operating autonomously need to pay for services the same way they call APIs: programmatically, without a human in the loop for each transaction. x402 makes that possible by defining exactly what a server must return when payment is required, and what a client (an agent) must include when submitting payment proof.
Settlement happens in stablecoins — primarily USDC on Base — because stablecoins provide the price stability needed for predictable machine-speed transactions. The agent never needs a credit card, a billing account, or a human approval chain.
The 4-Step HTTP Payment Cycle
Every x402 payment follows the same four-step cycle:
- 1 Request: the agent sends a standard HTTP request to a resource or tool endpoint, with no payment attached on the first attempt.
- 2 402 Response: if payment is required, the server returns HTTP 402 with a machine-readable body specifying the amount, currency, recipient wallet address, and payment network.
- 3 Payment: the agent constructs and signs a stablecoin transaction, broadcasts it on-chain, and receives a transaction hash as payment proof.
-
4
Retry with proof: the agent resends the original request with the payment proof attached in the
X-Paymentheader. The server verifies on-chain and returns the resource.
This cycle completes in seconds. No billing dashboard, no invoice, no API key purchase. The entire authorization process is embedded in standard HTTP headers.
Why x402 Matters for AI Agents
Traditional payment infrastructure was designed for humans. Credit card flows require cardholder authentication. OAuth tokens tie to user accounts. Subscription billing assumes a person manages payment methods. None of these assumptions hold when the buyer is an autonomous AI agent operating at API speed, potentially across hundreds of transactions per minute.
x402 is payment infrastructure designed from the ground up for machine actors. Because the payment requirement lives in the HTTP response itself, any agent that can read JSON and sign a blockchain transaction can pay for any x402-gated service — without any prior relationship with the provider, without account creation, and without per-transaction human approval.
For builders of agent systems, this dramatically reduces friction when connecting agents to paid services. For service providers, it creates a revenue model for API endpoints that previously had to rely on API key subscriptions or OAuth flows.
Who Is Implementing x402
Adoption has moved rapidly since the Coinbase open-source release. The following organizations have production or near-production x402 implementations:
withX402 and paidTool helpers for server-side gating; withX402Client for automatic client-side payment handling.Beyond these infrastructure players, open-source MCP server projects — including Apify's MCP Server, Civic's x402-mcp package, and AurelianFlo's compliance tooling — have built x402 payment gating into agent tool calls.
x402 and the Model Context Protocol
x402 and MCP (Model Context Protocol) operate at different layers of the agent stack and are designed to compose with each other. MCP defines how AI agents discover tools, connect to servers, and invoke tool calls. x402 defines how agents pay for access to those tools.
In a typical combined flow: an MCP client invokes a tool call, the MCP server returns an x402 payment requirement, the client resolves the payment using its embedded wallet, and then the tool call completes. The two protocols hand off cleanly — MCP handles the tool invocation lifecycle; x402 handles the payment settlement lifecycle.
Cloudflare's paidTool helper is the clearest example of this composition in production: it wraps an MCP tool definition with x402 payment gating, so the server enforces payment before executing the tool's logic. See Issue 5 for AWS x402 coverage and Issue 1 for x402 benchmark data.
Current Status and Governance
x402 is under Linux Foundation governance, which moved the specification from a Coinbase-owned project to a neutral multi-stakeholder standards body. This governance transition matters for enterprise adoption: procurement teams and legal departments are more willing to build on a specification that no single vendor controls.
The specification is actively developed. Current work tracks the agent commerce infrastructure layer — including facilitator API standards, compliance requirements under the GENIUS Act for stablecoin settlement, and interoperability with enterprise payment rails like Visa TAP and Mastercard AP4M.