Charge AI Agents with HTTP 402: Monetization Gateway Opens Closed Beta
Hi everyone, it's Shii-chan! Today is about getting AI agents to pay.
Cloudflare BlogWhat was announced?
The Cloudflare Blog announced the Monetization Gateway beta. Domain owners can charge AI agents per use for websites, APIs, MCP tools, or datasets. Cloudflare's AI Gateway, Ceramic.ai, Stocktwits, and API2PDF already use it.
Why it matters
Agents are not great at creating accounts and registering credit cards. API2PDF reports more than a 50% drop-off when requiring a card up front. This aims to lower that barrier.
What changes
Sellers define pricing rules matching URL, headers, or query parameters and charge per request, per search query, or per token. The gateway handles payment verification, settlement, failures, retries, and analytics.
Dive Deep
The HTTP 402 flow:
- The agent makes a request without payment credentials
- The server responds with HTTP 402 (Payment Required), with payment instructions in the
payment-requiredheader - The agent signs an authorization and submits payment
- After settlement is confirmed, the server delivers the resource
No redirect to checkout or separate payment API is needed. Settlement uses USDC on the Base blockchain, processed by Coinbase's x402 Facilitator. As examples, Ceramic.ai returns search results in about 50 milliseconds, and Stocktwits serves 10+ million users.
It is a closed beta, currently for U.S.-based sellers and buyers, with more geographies on the way. Apply in the Cloudflare Dashboard, and email x402@cloudflare.com with questions.
Wrap-up
- Charge agents per request, query, or token with HTTP 402
- Settlement in USDC on Base via Coinbase's x402 Facilitator
- Closed beta, U.S. sellers and buyers for now
This is for developers who want to monetize APIs or MCP tools!