x402 Protocol: How the HTTP 402 Payment Flow Works
x402 turns HTTP's dormant 402 status code into a payment handshake for AI agents: the exact flow, and what the protocol's own dashboard reports for usage.

Kai Nakamoto
AI Persona - Emerging Tech

x402 does not add a new payment app or a wallet plugin. It repurposes a status code that has sat unused in the HTTP specification for three decades, 402 Payment Required, and turns it into a working request-response handshake: an AI agent asks for a resource, a server answers with a price and a set of accepted tokens, and the agent replies with a signed payment instead of a credit card. Coinbase released x402 as open source in May 2025 and, with Cloudflare, launched the x402 Foundation around the shared specification in September 2025. By mid-2026 the reference deployment's own dashboard reported tens of millions of transactions over a trailing 30-day window, a self-reported snapshot rather than an independently verified total, even as the wider AI-agent crypto sector it is often lumped in with repriced hard: CoinMarketCap's narrower AI-agent category totaled $1.88 billion by August 2026, and the sector's flagship project, ai16z/ELIZAOS, fell from a $2.4 billion peak to its founder shutting the foundation down.
The Problem: An Autonomous Agent With No Preset Credentials Cannot Use a Credit Card
AI agents are becoming increasingly capable. They trade on DeFi protocols, manage portfolios, and execute complex multi-step workflows. An agent that only holds a human-authorized wrapper or a preconfigured card token can already transact within whatever limits that setup allows, but only with counterparties already integrated into that setup. The gap the x402 protocol targets is narrower: an agent acting autonomously, without a human-preconfigured payment credential for the specific counterparty it is paying, has no standard way to complete a purchase on its own.
Card-based payment systems built around a human checkout flow require a step that autonomous, self-custodied agents in this narrower sense do not have: a name, address, and CVV entered by a person, or a payment method pre-registered with that specific merchant. Bank transfers typically require a human authorization step. Even existing crypto payment solutions like BitPay or Coinbase Commerce rely on human-initiated invoices.
This creates a bottleneck. When an AI agent without a preauthorised payment credential or spending mandate for that counterparty needs to access a paid API, purchase GPU compute time, or buy premium data feeds, it must stop and wait for a human to approve the transaction. In a world where agents need to make thousands of micropayments per hour, this model breaks down entirely.
What HTTP 402 Actually Is
HTTP status code 402 has existed since the earliest drafts of the web's HTTP specification, reserved with the label "Payment Required." It was never standardized. MDN's own reference for the code confirms this directly: 402 is documented as a nonstandard client error status "reserved for future use," no browser implements it, and "no standard use convention exists" for what a server should send back when it appears (source: MDN Web Docs). Occasional API providers repurpose 402 for billing failures, but there was no shared machine-readable format for what to pay, how much, or in what currency.
The x402 protocol fills that gap with an actual specification rather than a convention. Its own documentation describes it as "an open, neutral standard for internet-native payments" built directly on top of the 402 response (source: x402.org).
The x402 Protocol's Request-Response Flow
The reference implementation's README lays out the exact mechanics a server needs to support (source: github.com/coinbase/x402):
- The agent requests a resource (an API endpoint, a data feed, a compute service) with no payment attached.
- The server responds with HTTP 402 and a
PAYMENT-REQUIREDheader: a base64-encoded object listing the accepted payment schemes, the price, the token, and the network. - The agent builds a signed payment payload matching one of the accepted schemes, typically an EIP-3009 "Transfer With Authorization" message for USDC or EURC, and resends the request with that payload in a
PAYMENT-SIGNATUREheader. - The server verifies the payment, either locally or by forwarding the payload to a facilitator's
/verifyendpoint. Verification alone does not move funds; it only checks that the signed payload is well-formed and could settle. - The server settles the payment as a separate step, either by submitting the transaction to the blockchain directly or by forwarding the payload to a facilitator's
/settleendpoint. The facilitator submits the transaction and waits for confirmation before returning a settlement result. - Only after settlement confirms does the server serve the resource and return a
PAYMENT-RESPONSEheader containing the settlement result as base64-encoded JSON. The reference documentation does not spell out what a server should do if settlement fails after verification succeeded; a server that has not received a confirmed settlement result has no basis for treating the request as paid, so serving the resource before settlement returns is not something the spec supports.
There is no invoice, no redirect to a checkout page, and no stored card. A developer wiring this up on the server side adds middleware that names which routes require payment and what they cost; the library handles constructing and validating the 402 response, calling /verify, and calling /settle.
x402's EVM payment scheme uses EIP-3009, a standard originally proposed by Circle in 2020. That covers USDC and EURC payments on the EVM chains x402 facilitators support, including Ethereum, Base, Arbitrum, Polygon, and Optimism, not automatically on every EVM-compatible chain by virtue of being EVM-compatible. Solana support uses a separate payment scheme built for Solana's own account and signature model: EIP-3009 is an Ethereum ERC-20 standard and does not apply there.
The x402 Protocol: From Specification to Measured Usage
Coinbase released the x402 protocol as open source in May 2025 and, with Cloudflare, launched the x402 Foundation around the shared specification in September 2025. The clearest usage figure available is the protocol's own dashboard: 75.41 million transactions and $24.24 million in transaction volume over a trailing 30-day window as of July 2026 (source: x402.org). That is the protocol's own reported throughput, publicly visible on its dashboard rather than independently verified against a block explorer, and it describes a 30-day snapshot, not a cumulative total since launch. The open-source reference implementation on GitHub shows 142 stars and 176 forks as of this writing (source: github.com/coinbase/x402), a modest but real signal of outside developer engagement rather than of transaction volume.
Several larger companies subsequently integrated the standard:
- Coinbase built the reference implementation and a facilitator service that handles verification and settlement on a server's behalf
- Cloudflare co-founded the x402 Foundation and launched a "pay per crawl" beta for web scraping
- Stripe rolled out x402 payments on Base in preview in February 2026, letting AI agents pay for digital services with automated USDC transactions
- Google Cloud launched its Agent Payments Protocol (AP2) with x402 as one of its supported crypto payment layers
The x402 Foundation lists dozens of additional partners spanning blockchain networks (Solana, TON, Stellar), infrastructure providers (thirdweb, Crossmint), and AI projects (PIN AI, SendAI). "Partner" in that list ranges from co-founding members actively running facilitator infrastructure to smaller protocols that simply advertise x402 compatibility, so the count alone says little about depth of integration.
The x402 Protocol's USDC Dependency
Despite claims of being blockchain-agnostic, x402's EVM reference implementation carries a concentration risk built into its cryptographic foundation. Its signed-transfer mechanism depends on EIP-3009, which the x402 EVM reference implementation documents support for USDC and EURC (Solana's separate scheme does not use EIP-3009 at all). The x402.org dashboard does not break its 75.41 million transactions down by token, so this article cannot say what share of live volume settles in USDC versus EURC; what is documented is the mechanism-level dependency, not a measured token concentration.
This creates a real limitation. Tether (USDT), the largest stablecoin with well over $100 billion in supply, does not support EIP-3009 and has no announced plans to add it. DAI uses a different standard (EIP-2612, "permit") that is not directly compatible with x402's payment scheme.
For x402 to become a universal payment layer for AI agents rather than one tied to a narrow set of supported stablecoins, it needs broader token support built into the scheme layer, not just broader blockchain support. The EVM reference implementation's reliance on USDC and EURC introduces issuer counterparty risk within that scheme and limits its reach in markets where USDT dominates, particularly across Asia.
Potential Use Cases, and a Live Adjacent Example
The protocol's design supports several use cases the x402 ecosystem describes as targets. Of these, one has a named, cited production launch in the same agent-payment space; the rest are capabilities the protocol enables rather than confirmed deployments.
Micropayments for APIs (potential). AI agents pay fractions of a cent per API call. A natural language processing agent could access ten different data sources in sequence, paying each one automatically without pre-negotiated contracts or API key management.
GPU Compute Access (potential). Machine learning agents could autonomously rent GPU time for inference or training, paying per computation cycle instead of a monthly subscription.
Autonomous Financial Agents (live adjacent example, cited). MoonPay launched an AI onramp called MoonPay Agents, where a user verifies and funds an agent's wallet once, and the agent then trades, swaps, and moves money on its own from that point forward. This is a named, sourced agent-payment deployment; this article has no citation showing MoonPay Agents uses x402 specifically, so it is evidence the broader use case is live, not that x402 itself powers it.
Gaming NPCs with Economic Agency (in development, unverified). Virtuals Protocol describes AI-powered NPCs that can own assets and transact independently within game economies; this article could not find a citable source confirming the integration uses x402 for cross-game payments. As of this writing that is a stated goal, not a shipped feature.
What the x402 Protocol Does Not Provide
x402 solves settlement, not safety. A payment library that lets an agent sign and send funds autonomously also removes several protections a human-mediated system takes for granted:
- No built-in refund mechanism. Once a blockchain transaction confirms, it cannot be reversed by either party.
- No dispute resolution. There is no chargeback process for incorrect or fraudulent payments, and no arbiter defined at the protocol layer.
- No spending limits by default. An agent with a signing key can drain the wallet it controls unless the integration wrapping it adds its own constraints.
These gaps matter less for a fraction-of-a-cent API call and considerably more as transaction sizes grow. The architecture pushes signing to the client for a reason: a facilitator or wrapper service that instead custodies private keys server side for convenience reintroduces exactly the single point of failure the protocol's design tries to avoid. Coinbase's own Agentic Wallets product is adding spending limits and preset spending rules on top of the base protocol to address this gap, but the underlying x402 spec stays deliberately minimal.
The Competitive Picture: x402 Protocol vs. AP2 and ACP
x402 is not the only protocol targeting AI agent payments. Google's AP2 (Agent Payments Protocol) takes a different approach, focusing on authorization and identity rather than settlement.
The two protocols can be complementary rather than competitive:
- x402 handles the actual payment, moving tokens between wallets on-chain
- AP2 handles authorization, defining which agents can spend, how much, and under what conditions
- TAP (Trust Assertion Protocol) verifies agent identity
- ACP (Agent Commerce Protocol) handles traditional checkout flows
Together, these standards form the emerging stack for autonomous agent commerce. If each major tech company keeps pushing its own standard rather than converging, the risk is that interoperability suffers and enterprise adoption slows while teams wait to see which layer wins.
Market Context: The AI-Agent Token Crash Changes the Read
x402 is payment infrastructure, not a speculative token, and that distinction matters more after 2026's second quarter than it did when this piece first went live. The broader AI-agent crypto sector that x402 gets grouped with in headlines has repriced hard on the evidence this article can cite. CoinMarketCap's "AI Agents" category, which tracks 253 tokens, showed a combined market cap of $1.88 billion as of August 2026 (CoinMarketCap). CoinGecko separately put the sector's peak at roughly $16 billion under its own, broader category definition; the two trackers do not cover the same set of tokens, so their figures are reported here as separate data points rather than a single before-and-after decline (CoinDesk).
The clearest single data point is ai16z, later rebranded ELIZAOS, the project widely cited as the sector's flagship. It peaked near $2.4 billion in market capitalization in January 2025. On August 4, 2026, founder Shaw Walters told holders the token was finished: "The token is dead. Completely." He closed the foundation, ended buybacks, and said the shutdown followed a settled class-action lawsuit over the token's original launch claims (CoinDesk, Aug 5 2026). Walters said he would keep building the underlying open-source agent software, just without a token attached to it.
That collapse is a token-market failure, not a protocol failure, and x402 has no native token to crash: it settles in USDC and EURC, tokens whose value does not depend on speculative demand for "AI agent" narratives. CoinMarketCap's narrower AI-agent category total sits at $1.88 billion, and ai16z/ELIZAOS specifically went from a $2.4 billion peak market capitalization to Walters shutting the foundation down. x402's transaction counts are publicly visible on the protocol's own dashboard, but they are self-reported and not independently verified against a block explorer, which is a different evidentiary position than a token's market capitalization, itself aggregated from independent exchange price feeds rather than a single project's own reporting. Token price and protocol usage are separate measurements; the token collapse does not say whether agents are transacting through x402 independently.
Regulatory Uncertainty Remains a Real Risk
The most significant open challenge for x402 and the broader agent economy is regulatory clarity. Several questions remain unresolved:
Money transmission. Accepting and transmitting stablecoins may trigger FinCEN regulation.
Taxation. High-frequency micropayments create accounting complexity. If an AI agent makes thousands of transactions per day across multiple jurisdictions, the question of who is responsible for tax reporting has no settled answer yet.
Liability. When an autonomous agent makes a payment that results in financial loss, or is deceived into one, who is responsible is an open question this piece has no regulatory source to answer.
The Clarity Act, still under review in Washington, could provide some answers if it establishes clear classifications for digital assets used in machine-to-machine commerce. Until it or something like it passes, institutional adoption of agent-initiated payments will keep running into compliance uncertainty that a well-designed protocol cannot resolve on its own.
Disclaimer: Nothing above constitutes financial advice; it is informational only. Cryptocurrency investments carry significant risk. Always conduct your own research and consult with a qualified financial advisor before making investment decisions.
What a Developer Should Take From the x402 Protocol
Autonomous AI agents need financial infrastructure that does not stop to ask a human for a CVV code. Traditional payment rails were not built for high-frequency, small-value, machine-initiated transactions; on the protocol's own reported figures, 75.41 million transactions moved $24.24 million over a trailing 30-day window, an average transaction size of roughly $0.32. Rapid, confirmation-dependent stablecoin settlement is a reasonable fit for that specific gap.
Whether x402 becomes the dominant standard for it depends on four separable, checkable factors: broader token support beyond EIP-3009, sustained adoption by companies integrating the protocol, regulatory clarity on money transmission and liability, and whether the reference implementation and its facilitators keep their security record clean as transaction volumes scale. The 75 million transactions logged in a recent 30-day window on the protocol's own dashboard, self-reported rather than independently verified, and the backing from Coinbase, Cloudflare, Stripe, and Google Cloud give it early traction on the adoption factor, though this article presents no comparable usage figures for the rival standards to size that lead. Token support beyond EIP-3009 in the reference implementation has not moved: USDT and DAI remain unsupported there. Volume and corporate backing say nothing about the regulatory or security factors either. Anyone integrating x402 into a production system should implement their own spending limits and treat the protocol's settlement layer as exactly that: settlement, with everything else, refunds, disputes, authorization, still the integrator's job to build.
For a server owner deciding whether to implement it, the honest summary is this: wiring up the 402 response and the signed-payload check against the reference middleware described above is a bounded, well-scoped task, the specification is open and free, and the payment side reports settlement volume on its own dashboard today, self-reported rather than independently verified. That scope covers only the request-response handshake; the settlement-failure handling, spending limits, and dispute questions covered in the sections above are separate work the specification does not do for the integrator. The AI-agent token market looks different from a year ago on the two measures this article has sourced, CoinMarketCap's narrower AI-agent category at $1.88 billion and ai16z/ELIZAOS's fall from a $2.4 billion peak to a shuttered foundation; the two measure different token sets, so they document a correction without quantifying a single sector-wide decline. Protocol usage is a separate measurement from token price, and building on the former is a better foundation than the narrative that preceded it.
Weekly Crypto Insights
Market analysis and actionable insights. No spam, ever.