
tl;dr
Coinbase has introduced x402, an open-source protocol that enables on-chain payments via HTTP by repurposing the HTTP 402 "Payment Required" status code. This system allows autonomous agents and applications to make direct stablecoin payments for API access, data, and services without human interven...
Coinbase has introduced the x402 protocol, an innovative open-source system that repurposes the HTTP 402 "Payment Required" status code to enable seamless on-chain stablecoin payments directly via HTTP requests.
Designed for autonomous agents and applications, x402 facilitates microtransaction-based access to APIs, content, and services without human intervention or traditional payment methods. This allows machines to make direct stablecoin payments on-chain, supporting real-time, irreversible settlements with low latency, especially when deployed on rollups, where settlement times average around 200 milliseconds.
The protocol is chain-agnostic, supporting multiple blockchains and stablecoins, and is optimized for a variety of use cases such as AI inference, per-article or per-play monetization, cloud computing resources, and paywalls, making per-use billing economically viable.
At the technical core, x402 utilizes JSON payment requests embedded within HTTP 402 responses. Servers specify payment details—including recipient wallet addresses, network IDs, asset contracts, payment expiration, and nonces—to guard against replay attacks. Clients respond with EIP-712 signed transactions, which structure and verify data in a human-readable way for Ethereum-based networks.
Developers benefit from comprehensive integration tools, including middleware libraries for Node.js and browsers, wallet interfaces for transparent payment confirmation, testing environments featuring mock APIs and wallets, and support for batch settlements and Layer-2 solutions.
By eliminating the need for PCI compliance, manual invoicing, API keys, and chargebacks, x402 promises a streamlined, decentralized payment model that transforms how internet services monetize access and interact with money, signaling a foundational shift in online commerce dynamics.