News
x402 Protocol Introduced for HTTP Payments in AI and API Services
x402, an open payment protocol by Coinbase, enables programmatic payments for APIs and AI services using the HTTP 402 status code.
Coinbase has introduced x402, an open payment protocol designed to enable programmatic payments for APIs, data, and other digital resources over HTTP. By leveraging the previously unused HTTP 402 "Payment Required" status code, x402 provides a standardized method for software to request and pay for resources without requiring manual intervention or complex billing integrations.
How x402 Works
The x402 protocol facilitates a five-step payment flow:
- Request the resource: A client, such as an AI agent or application, sends an HTTP request to a server.
- Receive payment requirements: The server responds with a 402 Payment Required status, including a PAYMENT-REQUIRED header that specifies the payment model, amount, accepted asset (e.g., USDC), blockchain network, and recipient.
- Authorize payment: The client verifies the terms against its budget and permissions. A protected wallet signer generates a signed payment payload, such as a stablecoin transfer authorization.
- Retry with payment proof: The client resends the request with a PAYMENT-SIGNATURE header containing the signed payment payload.
- Verify and settle: The server validates the payment payload, optionally through a facilitator, and provides access to the requested resource once settlement is confirmed.
The protocol's design ensures that payment details and authorization travel as structured data within standard HTTP messages, enabling seamless integration for developers.
Applications in AI and API Monetization
x402 is particularly suited for AI agents and machine-to-machine interactions. For example, an AI agent troubleshooting a bug could use x402 to purchase access to a remote testing service without requiring a human operator to configure billing or create accounts. This eliminates the need for subscriptions or prepaid balances for one-off queries, streamlining the payment process.
Developers benefit from a unified interface for handling payments across multiple providers, reducing the need for custom billing integrations. Service providers can monetize APIs and digital content programmatically, with x402 supporting micropayments and stablecoin transactions for efficiency and transparency.
Development and Adoption
Originally introduced by Coinbase in May 2025, x402 has since been adopted by the x402 Foundation, which operates under the Linux Foundation. Major participants include AWS, Circle, Cloudflare, and the Solana Foundation. The protocol itself is open-source and does not mandate specific payment methods, though stablecoins like USDC are commonly used for compatibility with blockchain networks.
As an open standard, x402 aims to simplify and expand the monetization of digital services, offering a flexible and scalable solution for both developers and service providers.