The x402 protocol is an open payment standard that uses the HTTP 402 status code to enable AI agents and software to make instant stablecoin payments onchain. Developed by Coinbase and backed by the x402 Foundation, it turns any API endpoint into a paywall that machines can navigate without human intervention, credit cards, or subscription accounts.
When an AI agent requests a resource that costs money, the server replies with an HTTP 402 Payment Required response. The agent reads the payment instructions, signs a stablecoin transaction, attaches the proof, and retries the request. The server verifies the payment and returns the data. The entire cycle takes seconds, requires no login, and settles onchain.
This guide covers what x402 is, how it works at the protocol level, which blockchains and stablecoins it supports, who is building with it, and how it fits alongside related standards like Google's Agent2Agent (A2A) and Agent Payments Protocol (AP2).
Why x402 Exists
HTTP 402 Payment Required has been a reserved status code since the early 1990s. The original HTTP specification set it aside for future use in digital payments, but no standard ever materialized. Credit cards, OAuth tokens, and API keys filled the gap instead.
Those mechanisms work for humans but break down for autonomous software. An AI agent cannot sign up for a SaaS account, enter credit card details, or negotiate an enterprise contract. It needs a payment method that is native to the web's request-response model, settles in seconds, and requires no pre-existing relationship between buyer and seller.
The x402 protocol solves this by embedding stablecoin payments directly into HTTP. Any server can require payment for a resource, and any client, whether human-operated or fully autonomous, can pay for it with a single additional header. There are no subscriptions, no prepayments, and no lock-in.
How the x402 Protocol Works
The x402 payment flow operates through a simple request-response cycle between three parties: the client (the AI agent or application making the request), the resource server (the API or service requiring payment), and the facilitator (an onchain verification and settlement service).
Step-by-Step Payment Flow
Request: The client sends a standard HTTP request to the resource server.
402 Response: If payment is required, the server responds with HTTP 402 and includes payment instructions in a structured header. These instructions specify the price, accepted tokens, recipient address, and the network to settle on.
Payment Construction: The client reads the payment instructions and constructs a signed payment payload. For EIP-3009 tokens like USDC, this uses a gasless authorization signature. For other ERC-20 tokens, it uses Permit2.
Retry with Payment: The client retries the original request with the signed payment attached in a header.
Verification and Settlement: The resource server forwards the payment to a facilitator, which verifies the signature, checks the client's balance, and settles the payment onchain. Once confirmed, the server delivers the requested resource.
The facilitator is a critical piece of the architecture. It abstracts away onchain complexity so that resource servers do not need to run blockchain nodes or manage wallets. Coinbase and other providers operate public facilitators that handle verification and settlement for free on supported networks.
The Facilitator's Role
A facilitator is a trusted intermediary that sits between the resource server and the blockchain. When a resource server receives a payment header, it sends the payload to the facilitator for verification. The facilitator checks that the signature is valid, the payer has sufficient balance, and no replay attack is occurring. If everything checks out, it submits the transaction onchain and confirms settlement to the resource server.
Public facilitators from Coinbase (via CDP) are available for Base, Solana, and Stellar at no cost. Third-party facilitators can also be deployed for custom settlement logic, alternative chains, or specialized compliance requirements. This open facilitator model means x402 is not locked to a single chain or token. It supports any ERC-20 via Permit2 and works natively with USDC and EURC via EIP-3009 for gasless transfers.
Supported Blockchains and Tokens
The x402 protocol is chain-agnostic by design. Its payment header format does not assume a specific blockchain; it describes the network, token, amount, and recipient, and leaves settlement to the facilitator. As of early 2026, x402 is live on multiple networks:
Network | Token Support | Facilitator | Finality |
Base | USDC, EURC, ERC-20s | Coinbase CDP (free) | ~2 seconds |
Solana | USDC, SPL tokens | Coinbase CDP (free) | ~400ms |
Stellar | USDC, Stellar assets | OpenZeppelin Relayer | ~5 seconds |
Arbitrum | USDC, ERC-20s | Third-party | ~1 second |
Polygon | USDC, ERC-20s | Coinbase CDP | ~2 seconds |
Ethereum L1 | USDC, ERC-20s | Third-party | ~12 seconds |
Base and Solana are the most commonly used networks for x402 payments due to low fees and fast finality. Most x402 transactions settle in stablecoins, primarily USDC, which is the dominant settlement token across the protocol. For applications that need to route payments across chains, cross-chain intent protocols and intent-based solvers can abstract away the chain selection entirely.
The x402 Foundation and Ecosystem
Coinbase and Cloudflare co-founded the x402 Foundation in September 2025 to establish x402 as the universal standard for internet-native payments. The foundation oversees protocol governance, ecosystem growth, and interoperability across implementations.
Foundation membership has expanded rapidly. Core members now include Google, Visa, AWS, Circle, Anthropic, and Vercel alongside the founding partners. The breadth of this coalition, spanning cloud infrastructure, payments, AI, and crypto, signals that x402 is being positioned as foundational plumbing for the agentic economy rather than a crypto-only standard.
Who Is Building with x402
The ecosystem spans several categories of builders and integrations:
Infrastructure providers: Cloudflare integrated x402 into its Workers platform and is piloting a pay-per-crawl product. Vercel supports x402 middleware for serverless functions. Zuplo offers x402 paywalls for API gateway customers.
AI agent frameworks: MCP (Model Context Protocol) servers are adding x402 support so that AI models can pay for tool calls and data access autonomously. Developers are building x402-enabled MCP servers that let agents purchase compute, data, and API access without pre-provisioned keys.
Identity and verification: World (formerly Worldcoin) launched AgentKit in March 2026 to attach cryptographic proof of human identity to AI agent transactions, integrating directly with x402 for stablecoin micropayments.
Payment aggregators: Kobaru provides a transparent proxy layer that lets vendors add x402 paywalls to existing APIs without modifying backend code. Agently operates a routing and settlement layer for agent-to-agent commerce.
Financial institutions: Visa added x402 support through its Trusted Agent Protocol (TAP), and Stripe integrated x402 through its Agent Commerce Protocol (ACP), connecting the protocol to traditional payment rails.
On Solana alone, the protocol has processed over 35 million transactions and more than $10 million in volume since launching support in mid-2025. Across all networks, adoption is accelerating as more APIs add x402 paywalls and more AI agents gain wallet capabilities.
Key Use Cases for x402
x402 is purpose-built for scenarios where one piece of software needs to pay another piece of software. The most active use cases include:
AI agent API access: An agent that needs weather data, financial quotes, or geolocation services can pay per request instead of managing API keys and subscription tiers.
Machine-to-machine micropayments: IoT devices, automated trading bots, and backend services can settle sub-cent payments for data feeds, compute cycles, or storage access.
Content paywalls: Websites can charge per article, per data export, or per search query. The x402 header makes the cost transparent and the payment automatic.
MCP tool monetization: Developers building MCP servers can monetize tool access. An AI model calling a translation tool, a database query tool, or an image generation tool can pay the provider directly per invocation.
Data marketplace access: Agents that need training data, market research, or proprietary datasets can purchase access in real time without negotiating contracts.
The common thread is removing friction from machine-to-machine payments. Where traditional payment infrastructure requires accounts, credentials, and human approval, x402 requires only a wallet with a stablecoin balance and the ability to sign a transaction. This aligns with the growing use of stablecoin payments for programmatic settlement across crypto and traditional finance.
x402 vs. Agent2Agent (A2A) vs. Agent Payments Protocol (AP2)
Three protocols are shaping the AI agent economy, and they serve different functions. Understanding where each fits prevents confusion between communication, payment, and authorization layers.
| x402 | A2A (Agent2Agent) | AP2 (Agent Payments) |
Purpose | Onchain payment settlement | Agent-to-agent communication | Payment authorization framework |
Created by | Coinbase | ||
Layer | Payment execution (HTTP) | Communication (agent interop) | Authorization and governance |
Settlement | Stablecoins onchain | N/A (not a payment protocol) | Supports fiat + crypto via extensions |
Launched | May 2025 | April 2025 | 2026 |
Relationship | Can integrate with A2A and AP2 | Can use x402 for payments | Uses x402 as crypto payment rail |
A2A is a communication protocol. It allows agents built on different frameworks to discover each other, exchange messages, and coordinate tasks. It does not handle payments.
AP2 is a payment authorization framework. It defines how agents identify themselves, what credentials they carry, and how payment requests are approved across platforms. It supports both fiat and crypto rails.
x402 is a payment execution protocol. It handles the actual movement of money onchain. When an AI agent needs to pay for something, x402 is the mechanism that transfers stablecoins from buyer to seller.
These three protocols are complementary. Google launched an official A2A x402 extension that lets agents using A2A for communication settle payments via x402. AP2 uses x402 as its stablecoin payment rail. In practice, a fully autonomous AI agent might use A2A to find a service, AP2 to authorize the transaction, and x402 to settle the payment.
x402 and Onchain Standards
x402 operates at the HTTP layer, but it depends on onchain token standards for settlement. The protocol uses EIP-3009 (transferWithAuthorization) for gasless USDC transfers and Permit2 for other ERC-20 tokens. Emerging standards like ERC-8004 are also relevant, as they define trustless payment channels that could further reduce settlement latency for high-frequency x402 transactions.
The interaction between HTTP-level payment negotiation (x402) and onchain settlement standards (EIP-3009, Permit2, ERC-8004) is what makes the protocol efficient. The agent never submits a raw blockchain transaction. Instead, it signs an authorization that the facilitator executes, keeping the agent's interaction at the HTTP level while settlement happens onchain in the background.
Getting Started with x402
For developers who want to accept x402 payments, the integration is lightweight:
Add x402 middleware to your server. SDKs are available for Node.js, Python, and Go. The middleware intercepts requests, checks payment status, and returns 402 responses with payment instructions for unpaid requests.
Configure pricing. Set per-endpoint or per-resource pricing in the stablecoin of your choice. Most implementations use USDC on Base for lowest fees.
Point to a facilitator. Use Coinbase's free public facilitator or deploy your own. The facilitator handles all onchain verification and settlement.
Test and deploy. The x402 GitHub repository includes sample applications, integration tests, and testnet configurations.
For AI agents and clients, x402 support means equipping the agent with a wallet (or access to a wallet service) and adding logic to handle 402 responses. Most agent frameworks are adding this as a built-in capability.
Frequently Asked Questions
What is the x402 protocol?
The x402 protocol is an open payment standard that uses the HTTP 402 status code to enable instant stablecoin payments over the web. When a server requires payment for a resource, it responds with a 402 status code and payment instructions. The client signs a stablecoin transaction and retries the request with the payment attached. A facilitator verifies and settles the payment onchain.
Is x402 the same as Agent2Agent (A2A)?
No. x402 and A2A are separate protocols that serve different functions. x402 is a payment execution protocol that moves stablecoins onchain. A2A is Google's agent communication protocol that lets agents discover and coordinate with each other. They are complementary: Google launched an A2A x402 extension so agents can use A2A for communication and x402 for payment settlement.
What stablecoins does x402 support?
x402 supports USDC and EURC natively via EIP-3009 for gasless authorization. It also supports any ERC-20 token through Permit2 and SPL tokens on Solana. USDC is the most widely used settlement token across the x402 ecosystem.
Which blockchains support x402?
x402 is live on Base, Solana, Stellar, Arbitrum, Polygon, and Ethereum mainnet. Base and Solana are the most active networks, with free public facilitators from Coinbase. The protocol is chain-agnostic, and new networks can be added by deploying a facilitator.
Who created x402?
Coinbase created and open-sourced the x402 protocol in May 2025. The x402 Foundation, co-founded by Coinbase and Cloudflare in September 2025, now governs the protocol. Foundation members include Google, Visa, AWS, Circle, Anthropic, and Vercel.
How much does it cost to use x402?
The protocol itself is free and open source. Coinbase operates free public facilitators on Base, Solana, and other supported networks. The only costs are the underlying blockchain gas fees, which on L2 networks like Base are typically fractions of a cent per transaction. There are no subscription fees, platform fees, or percentage-based charges.
Can x402 handle micropayments?
Yes. x402 is specifically designed for high-frequency, low-value transactions. On Base and Solana, gas fees are low enough to make sub-cent payments economically viable. This makes x402 well-suited for per-request API pricing, pay-per-query data access, and other machine-to-machine micropayment use cases.
How does x402 relate to MCP (Model Context Protocol)?
MCP defines how AI models interact with external tools and data sources. x402 provides the payment layer that lets those tools charge for access. Developers are building MCP servers with x402 paywalls, enabling AI models to pay for tool invocations, data retrieval, and compute resources autonomously.
The Bottom Line
The x402 protocol fills a gap that has existed since the web's inception: a native way for software to pay for resources over HTTP. By embedding stablecoin payments into the request-response cycle, x402 gives AI agents, automated services, and MCP tool providers a frictionless way to transact. With backing from the x402 Foundation and integration into Google's agent protocols, x402 is becoming the default payment rail for the machine economy.
As AI agents become more autonomous and the demand for machine-to-machine payments grows, x402 provides the infrastructure to make those payments instant, programmable, and settled onchain.
