Back to blog

x402 moves payment into the HTTP request

The x402 protocol gives APIs and content endpoints a machine-readable way to quote a price, receive payment, and return a resource.

Sep 23, 2025Cloudflare Wallets EditorialCloudflare Wallets Editorial

HTTP has long reserved status code 402 for payment requirements. The x402 protocol turns that dormant idea into a practical flow for machine-to-machine commerce.

A payment-aware request

A client requests a protected resource. The server returns payment instructions. The client pays using a compatible wallet and retries with proof that the merchant can verify.

For AI agents, this removes several human assumptions: account creation, checkout forms, copied API keys, and a person present to approve every low-value purchase.

What makes the protocol useful

Open interoperability matters more than any single wallet. Agents need a predictable way to compare prices, understand payment requirements, prove settlement, and receive the resource they requested.

Risks remain

Wallet security, refund handling, malicious endpoints, ambiguous pricing, and identity verification still require careful controls. Protocol simplicity does not eliminate the need for policy.

Read Cloudflare's x402 announcement.