AI agents can browse the web, write code, and call APIs. But until recently, they could not pay for anything. If an agent hit a paid API, it needed a human to sign up, enter a credit card, and manage billing. That bottleneck breaks the entire promise of autonomous agents.

x402 fixes this. It is an open payment protocol, developed by Coinbase, that lets any HTTP client pay for any HTTP resource using stablecoins. One request, one payment, no accounts. The protocol shipped in early 2026 and has already processed over 165 million transactions across 69,000 active agents.

The Core Idea

HTTP status code 402 has existed since 1997. The spec reserved it for “Payment Required,” but nobody built the payment layer to back it up. For almost 30 years, 402 was a placeholder with no implementation.

x402 finally fills that gap. When a server wants payment before serving a response, it returns a 402 Payment Required status with a structured payment envelope. The client reads the envelope, signs a stablecoin transfer, and retries the request with a payment header attached. The server verifies the payment onchain and returns the response.

No API keys. No OAuth. No billing portals. The payment is inline with the HTTP request itself.

How It Works

The protocol follows a simple request-retry pattern:

1. Initial request. The client sends a normal HTTP request to the server.

2. Payment challenge. The server responds with 402 Payment Required and a JSON body containing: the blockchain network (Base, Solana, or Stellar), the token contract (usually USDC), the amount, and the recipient wallet address.

3. Payment signature. The client reads the challenge and signs a transferWithAuthorization payload (EIP-3009 on EVM chains). This authorizes the exact amount to be transferred from the client’s wallet to the server’s wallet.

4. Retry with payment. The client retries the original request, this time including a X-PAYMENT header with the signed authorization.

5. Verification and settlement. The server submits the signed transfer onchain, confirms settlement, and returns the requested resource.

On Base, settlement typically takes under two seconds. On Solana, it is even faster. Gas fees are negligible on both chains, usually under $0.01 per transaction.

The entire flow happens programmatically. An AI agent with a funded wallet can pay for services without any human in the loop.

Why It Matters for AI Agents

Traditional payment systems were built for humans. They require account creation, identity verification, credit card numbers, and billing cycles. None of that works for an autonomous agent making thousands of API calls per hour.

x402 was designed specifically for this use case. Three things make it work for agents:

No accounts. An agent only needs a wallet address and enough USDC to cover the transaction. There is no signup, no onboarding, and no subscription management.

Per-request pricing. Instead of monthly plans or rate limits, x402 enables true micropayments. A server can charge $0.001 per API call. This lets agents pay only for what they use.

Programmable spending. Because payments are just signed messages, agents can implement spending policies: per-transaction limits, daily budgets, or category-based rules. AWS Bedrock AgentCore Payments ships with these guardrails built in.

The protocol also works with MCP servers. The AgentNDX directory tracks x402 support as a filter, and several servers already accept x402 payments natively.

x402 in Practice

Here is what a real x402 exchange looks like. An AI agent calls an MCP server for premium data:

GET /api/market-data HTTP/1.1
Host: example-mcp.com

The server responds:

HTTP/1.1 402 Payment Required
Content-Type: application/json

{
  "network": "base",
  "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "amount": "5000",
  "recipient": "0xServerWallet...",
  "description": "Market data query - $0.005 USDC"
}

The agent signs the transfer and retries:

GET /api/market-data HTTP/1.1
Host: example-mcp.com
X-PAYMENT: eyJ0eXBlIjoiZXhhY3QiLCJuZXR3b3JrIjoiYmFzZSIs...

The server verifies, settles onchain, and returns the data. Total time: about two seconds.

Batch Settlement: The Latest Update

Five days ago, x402 added batch settlement support. Instead of settling each microtransaction individually onchain, servers can now bundle multiple payments and settle them in a single transaction. This reduces gas costs significantly for high-frequency use cases where agents are making hundreds or thousands of calls per minute.

Batch settlement is optional. Servers can still settle per-request for maximum trust, or batch for cost efficiency. The client experience does not change either way.

Who Supports x402 Today

The protocol has picked up serious backing in its first few months:

  • Coinbase built and maintains the protocol. Their AgentKit MCP server provides wallet creation and x402 payment handling.
  • Stripe added x402 support in February 2026, alongside their existing card payment rails.
  • Cloudflare co-founded the x402 Foundation and ships a reference implementation in their Agents SDK.
  • AWS launched Bedrock AgentCore Payments with native x402 support, IAM guardrails, and CloudTrail logging.

On Solana alone, x402 has processed over 35 million transactions and more than $10 million in volume.

FAQ

Do I need to understand crypto to use x402? Not really. The protocol uses USDC, a stablecoin pegged to the US dollar. You fund a wallet with USDC, and the protocol handles the rest. Coinbase AgentKit and AWS AgentCore both abstract the blockchain layer so you can work with familiar HTTP patterns.

How does x402 compare to Stripe’s Metered Payment Protocol? x402 is best for micropayments, cross-border transactions, and fully autonomous agents. Stripe MPP works better when your users already have Stripe accounts and you want traditional currency settlement. Many teams support both.

Which blockchains does x402 support? Base, Solana, and Stellar are the most widely used. Base and Solana are preferred for their low fees and fast finality. More chains are expected as the protocol matures.

Can I add x402 to my existing MCP server? Yes. Coinbase publishes middleware and reference implementations. The basic pattern is: intercept tool calls, return a 402 challenge if unpaid, verify the payment header on retry, settle onchain, then serve the response. Most implementations take a few hours to integrate.