Live
Coinweb
Web3 Definition· 1 min read
Markdown

x402 Protocol (HTTP 402 Payments for AI Agents)

Quick Definition

x402 is an open internet payment protocol that activates the long-unused HTTP 402 'Payment Required' status code, letting autonomous AI agents and browsers pay per API call instantly in stablecoins like USDC without accounts or API keys.

What Is the x402 Protocol?

When HTTP was designed in the 1990s, status code 402 Payment Required was reserved for future digital cash—but credit cards could never profitably process $0.001 API calls or let software pay autonomously without human KYC. Introduced by Coinbase Developer Platform and adopted rapidly across the 2025–2026 AI-agent ecosystem, the x402 protocol finally activates HTTP 402 using low-fee stablecoin rails (such as USDC on Base and Solana) so AI agents, MCP servers, and browsers can pay for data, compute, or market access on demand.

How an x402 Micropayment Flow Works

  1. Request: An AI agent sends a normal HTTP GET or POST request to a paid API or data endpoint (e.g., live market odds or research feed).
  2. HTTP 402 Challenge: The server responds with status 402 Payment Required and machine-readable JSON specifying the exact asset (e.g., USDC), amount (e.g., $0.01), network, and destination address.
  3. Signed Payment Header: The agent's wallet signs an EIP-3009 / gasless stablecoin authorization and retries the exact same HTTP request with an X-PAYMENT header.
  4. Instant Verification & Delivery: A facilitator verifies and settles the on-chain transfer in under a second, and the server immediately returns 200 OK with the requested payload.
Feature Traditional API Billing (Stripe/Cards) x402 Protocol (Stablecoin HTTP 402)
Minimum Viable Payment ~$0.50+ (due to $0.30 + 2.9% card fee) $0.0001+ sub-cent micropayments
Onboarding & Accounts Human signup, credit card, API key management Zero signup—any wallet-equipped AI agent pays per call
Settlement Speed T+2 to T+7 days + chargeback risk <2 seconds final on-chain settlement, zero chargebacks

Why x402 Matters for Autonomous AI Agents

Autonomous trading bots and forecasting agents increasingly combine prediction markets for AI agents, Model Context Protocol (MCP) tools, and real-time data feeds. With x402, an agent no longer needs a human to pre-register credit cards on 50 different SaaS dashboards—it simply holds a budgeted USDC wallet with spending limits and pays pennies only for the exact inference calls, news scrapes, or odds feeds it actually uses.

Frequently Asked Questions

Does x402 work only on Base?

No. x402 is chain-agnostic—while Base USDC was the initial reference rail due to sub-cent gas and EIP-3009 gasless authorizations, x402 facilitators support multiple EVM Layer-2s and Solana.

Do AI agents need ETH for gas to use x402?

With EIP-3009 ('transferWithAuthorization') supported by USDC, the AI agent signs an off-chain authorization and an x402 facilitator sponsors the minimal on-chain gas—meaning agents only need to hold USDC.

How do operators prevent AI agents from overspending via x402?

Agent operators enforce hard per-call price ceilings, daily spend caps, and allowlisted vendor domains inside the agent's smart wallet or MCP payment middleware.

Julia Zakharchuk
Written by7+ Years Experience
Julia Zakharchuk· Senior Crypto Author & Web3 Analyst

Julia, an accomplished crypto and blockchain professional, is known for her insightful YouTube channel "MoneyFest."

Crypto Exchanges & TradingNFTs & Digital CultureHardware & Software WalletsDeFi & Yield Protocols
Phillip Lord

Independently Fact-Checked by Phillip Lord

President of Oobit ($25M Raised) · Former Investment Banker in Hong Kong & Tokyo · Crypto Since 2017

Editorial Standards

Related Comparisons & Crypto Wiki Terms

Explore independently benchmarked comparisons and fact-checked Coinweb research on this topic.