What is "x402"?
x402 is an internet-native payment protocol that enables AI agents to make autonomous payments for digital resources. The protocol revives the long-unused HTTP 402 « Payment Required » status code originally reserved in early web specifications. Coinbase and Cloudflare developed x402 to address a structural limitation in current payment systems. Traditional payment authorization requires humans, preventing AI services from completing transactions independently without manual intervention.
The protocol allows servers to request payment directly through HTTP responses. AI agents then automatically execute stablecoin transactions on-chain to access the requested resources immediately. x402 eliminates traditional payment barriers including accounts, API keys, subscription billing, and manual credential management. This enables AI agents to conduct verifiable, secure, and permissionless payments directly on blockchain networks. The protocol settles payments in seconds using on-chain transactions. In contrast, traditional systems like Visa or Stripe typically settle over one to three business days.
How the x402 payment flow works from request to resource delivery
The x402 payment process follows a structured sequence that enables AI agents to complete transactions autonomously. First, an AI agent sends a request for an API endpoint, dataset, or other digital resource. The service responds with an HTTP 402 status code indicating payment is required. This response includes price, token type, payment address, and expiration details for the transaction. Next, the AI agent automatically executes the payment based on these provided parameters. Most payments use USDC stablecoin on networks like Base or Ethereum for fast settlement. The agent signs the transaction and obtains the on-chain transaction hash as proof of payment.
Then, it resubmits the original request along with this payment evidence to the server. A payment facilitator service such as Coinbase’s x402 Facilitator verifies the blockchain to confirm the payment. Once validated on-chain, the server fulfills the request and returns the requested data. The response includes an X-PAYMENT-RESPONSE header confirming the successful transaction. This entire flow happens within seconds without manual billing or account management.
The different use cases
x402 enables AI agent commerce where autonomous agents in chatbots or IoT devices pay for resources on demand. For example, an AI model can pay for GPU cycles per second without human intervention. This allows dynamic scaling based on actual resource consumption rather than fixed subscriptions. Similarly, OpenAI agents or large language models could autonomously fetch additional training data instantly. They can subscribe to real-time data feeds by paying with USDC for each update received. Google’s Agent Payments Protocol incorporates x402 to enable agent-to-agent crypto payments. This expands the standard beyond human-initiated transactions into fully autonomous machine economies.
Additionally, the protocol supports micropayments for content access at scale. AI agents can pay cents for individual articles, images, or API calls rather than monthly subscriptions. Cryptographically signed instructions act like contracts, creating a verifiable audit trail for every transaction. Traditional payment infrastructure expects logins, billing dashboards, and delayed bank transfers. In contrast, x402 embeds value transfer directly into internet protocol layers for seamless automation. The protocol transforms every API into an on-demand service without subscriptions or stored credentials.
Sources:







