Understanding x402: Internet-Native Payments for AI and APIs

The internet is entering its next era. In this new era, AI agents, APIs, and autonomous apps transact on their own. But today’s payment rails weren’t built for this world. We need a system that’s as native to machines as HTTP is for data.
Enter x402, an open payment protocol developed by Coinbase, now supported by the newly formed x402 Foundation from Coinbase and Cloudflare. x402 brings new life to the little-used HTTP 402 “Payment Required” status code, using it to enable instant, onchain payments as part of a standard web request.
Why We Need Machine-Native Payments
Legacy payment systems like credit cards, banks, and online payment services weren’t built for machines. They rely on accounts, sessions, and manual authentication flows that make sense for humans but are clunky, expensive, and impossible for autonomous agents to navigate at scale.
x402 solves this by embedding payments directly into web interactions, letting:
- AI agents pay for API access autonomously.
- Developers charge per API call or inference without forcing users into subscriptions.
- Content creators monetize articles, datasets, or videos on a pay-per-use basis.
- IoT and machine-to-machine transactions happen automatically, without manual setup.
x402 enables money to move just like data.
How x402 Works
Here’s how the x402 payment flow works, step by step:
- Client makes a request: The buyer (human or AI) calls an API or requests a resource.
- Server replies with 402 Payment Required: The server includes payment instructions in the response.
- Client constructs payment: Using a wallet, the client builds a payment payload.
- Client resends the request with payment: This time, it includes the signed payment in the header.
- Server verifies the payment: Either locally or using a facilitator service.
- Settlement happens onchain: The facilitator (or server) submits the payment to the blockchain.
- Resource is delivered: The server responds and delivers the requested data.
This process is stateless, meaning no sessions or user accounts are required. It’s HTTP-native, so it works with existing infrastructure, and it’s blockchain-agnostic, supporting multiple networks through facilitators.
The Role of Facilitators
One of the biggest challenges for developers is blockchain infrastructure. x402 solves this by introducing facilitators; services that verify and settle payments on behalf of the seller.
Coinbase Developer Platform (CDP) offers a hosted facilitator that provides:
- Fee-free USDC payments on Base
- Fast settlement with onchain finality
- Built-in compliance checks and OFAC screening
- Simplified setup so developers can get started with minimal overhead
Future roadmap items include service discovery for buyers, credit-based billing, additional networks, and optional seller attestations (such as geo-blocking).
The Benefits that x402 Brings to Builders
x402 is more than just another payment API. It simplifies approaches that were previously hard to implement, making them practical at scale:
- Micropayments made simple: Charge fractions of a cent per call without dealing with card minimums or expensive fees.
- Enhanced user experience: Remove the friction of accounts and checkout flows so users (or agents) can pay and move on instantly.
- Compliance handled for you: Built-in KYT and risk screening reduce the overhead of managing compliance yourself.
- Clear visibility into revenue: Real-time dashboards make it easy to track transactions, balances, and performance.
The x402 Foundation: A Universal Standard for AI-Powered Commerce
The launch of the x402 Foundation signals a bigger vision: to make x402 the universal standard for AI-driven payments. Coinbase and Cloudflare will work together to advance the protocol, support builders, and enable a new era of open, permissionless programmatic commerce. As AI agents become a key part of the internet economy, protocols like x402 will let them participate in real markets by paying for compute, APIs, and data autonomously without human intervention.
The future of payments is machine-native, onchain, and frictionless, and x402 is leading the way.
Share this article