Cloudflare launches beta of a gateway where AI agents pay via HTTP 402
Cloudflare has opened a closed beta of Monetization Gateway. The service lets domain owners charge AI agents for access to websites, APIs, MCP tools and datasets. Payment happens inside the HTTP request itself via the 402 Payment Required status code, with no redirect to a checkout page and no separate payment API. Settlement runs in the USDC stablecoin on the Base network through the Coinbase x402 Facilitator. Four customers already use the service in production, and for now only sellers and buyers from the US have access. • AI Gateway: inference payment via the Payment-Method: x402 header • API2PDF was losing more than 50% of conversions at the card entry step • Ceramic.ai: an index of 40+ billion pages, responses from 50 ms
AI-processed from Cloudflare AI Blog; edited by Hamidun News
Cloudflare has launched a closed beta of Monetization Gateway, a tool that turns the HTTP 402 Payment Required status code into a working "paid turnstile for agents." A domain owner can put a paywall in front of a website, API, MCP tools or datasets in a few clicks. The agent receives payment instructions, signs an authorization and gets the resource once payment settles. Three months after announcing the plan, the service already has four live customers: Cloudflare AI Gateway, Ceramic.ai, Stocktwits and API2PDF.
Why subscriptions don't suit agents
Most software companies sell their product through subscriptions or prepaid credits. Buyers commit money upfront, so they keep only a couple of services that fit the budget. An agent works differently: it looks for a result, and to get it, it may visit a new site, call an MCP tool or download a data feed. In that mode, it makes sense to pay per unit of consumption: a request, a search query, a token.
Current payment rails are not built for this. They assume high latency, large amounts and a buyer the seller knows personally. Agents need the opposite: cheap, fast and with no human in the loop. Cloudflare argues that stablecoins and their blockchains currently meet these requirements. The company does not rule out that other networks or solutions from existing players may appear over time.
How the gateway works
Payment is built into the request itself. There is no redirect to a payment page and no separate payment API. The seller defines which requests are paid, how much they cost and where to send the money. Pricing rules can be tied to any part of a request: the URL, headers or query parameters. Several pricing schemes are available. Cloudflare handles payment verification and settlement through the Coinbase x402 Facilitator, failure and retry handling, analytics, and support for changes to the x402 protocol. Settlement runs in USDC on the Base blockchain.
For high-value content that someone could bypass once and then use a thousand times, there is a separate Pay Per Use mode. It is a network of verified buyers who report every use themselves and pay for it.
Four customers in production
- Cloudflare AI Gateway. A control plane and marketplace for hundreds of models behind a single API key. Customers in the US can now pay for inference at the moment of the request for a selected set of models by adding the Payment-Method: x402 header. The example in the documentation uses z-ai/glm-4.7-flash. It uses origin-controlled pricing: the gateway asks the seller itself, which here is AI Gateway, for the price, and does not duplicate its complex per-token billing.
- Ceramic.ai. A search API for agents with its own index of more than 40 billion pages and responses from 50 ms. It uses a fixed price, and the agent pays for search without an API key. Founder Anna Patterson stresses that search should be one of the first things an agent buys on its own. That way, the agent won't have to ration queries to fit a preset budget.
- Stocktwits. A social network for investors, launched in 2008, with an audience of more than 10 million people. It sells agents signals: sentiment for a ticker (bullish or bearish), message volume relative to the norm, the number of ticker followers and trends. For this, the company built a separate agent-facing path behind the gateway. Existing APIs and enterprise data products were not changed, and each request is priced separately.
- API2PDF. A REST API for generating PDFs from HTML and office documents, operating since 2018. It used to require an account and an API key, and after the first month, a bank card as well. At that step, conversion dropped by more than 50%. Now the service answers a request without a key with a 402 and a payment-required header. The price is variable: the agent is told the maximum for a single request, and only actual consumption is charged.
API2PDF's argument is simple: an agent can spend tokens and generate a PDF itself, or it can pay a specialized API a fraction of a cent.
What sellers and developers should do
Access is currently closed and limited to eligible sellers and buyers from the US; other regions are promised later. Onboarding requests are submitted in the Cloudflare dashboard, and the documentation is open. The practical order for a seller is this: pick a resource where each request is the unit of consumption (an API, a tool, a dataset), and set up a separate path for agents, as Stocktwits did. Then choose a pricing scheme: fixed for uniform requests, or variable with a cap for compute with a floating cost.
Agent developers should plan ahead for a wallet with USDC and for handling the 402 response: read the instructions, sign the authorization, repeat the request. Cloudflare's roadmap includes service discovery by agents, logs of all transactions, additional payment rails and identity primitives. With these, sellers will be able to decide who gets their resources and at what price.
- Oct 30, 2026Google's Gemini 4 Carbon Scores 88.2% on Vulnerability-Finding Benchmark, Access Remains Restricted
- Oct 29, 2026Google lets third-party AI agents into Android Studio: Claude, Codex and 40+ more
- Oct 29, 2026A Swarm of AI Agents Builds the Game Spawn, and Tokens Cost $3 Million a Month
- Oct 29, 2026Mistral Releases Large 4 Weights: Open 1T-Parameter Model for Coding
Key Questions Answered
Why subscriptions don't suit agents?
Most software companies sell their product through subscriptions or prepaid credits. Buyers commit money upfront, so they keep only a couple of services that fit the budget. An agent works differently: it looks for a result, and to get it, it may visit a new site, call an MCP tool or download a data feed. In that mode, it makes sense to pay per unit of consumption: a request, a search query, a token. Current payment rails are not built for this. They assume high latency, large amounts and a buyer the seller knows personally. Agents need the opposite: cheap, fast and with no
How the gateway works?
Payment is built into the request itself. There is no redirect to a payment page and no separate payment API. The seller defines which requests are paid, how much they cost and where to send the money. Pricing rules can be tied to any part of a request: the URL, headers or query parameters. Several pricing schemes are available. Cloudflare handles payment verification and settlement through the Coinbase x402 Facilitator, failure and retry handling, analytics, and support for changes to the x402 protocol. Settlement runs in USDC on the Base blockchain. For high-value content
What are the key details on Four customers in production?
Cloudflare AI Gateway. A control plane and marketplace for hundreds of models behind a single API key. Customers in the US can now pay for inference at the moment of the request for a selected set of models by adding the Payment-Method: x402 header. The example in the documentation uses z-ai/glm-4.7-flash. It uses origin-controlled pricing: the gateway asks the seller itself, which here is AI Gateway, for the price, and does not duplicate its complex per-token billing. Ceramic.ai. A search API for agents with its own index of more than 40 billion pages and responses from 50
Build & Ship Production AI Agents Without Boilerplate Code
Start your free 72-hour trial at Hamidun Academy (academy.hamidun.com) — interactive lessons on Claude Code & Cursor, live Tech Radar, and production agent templates.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.