x402 and Cloudflare: How Cloudflare Supports Agent Payments
Cloudflare supports x402 in three ways. It co-announced the x402 Foundation with Coinbase in September 2025 and is a premier member of the Linux Foundation project that now governs it. Its Agents SDK and MCP tooling let developers charge per tool call and let agents pay x402 responses. And its Wallets product, announced in 2026, builds on x402.
The foundation
On September 23, 2025, Coinbase and Cloudflare announced their intent to create the x402 Foundation to steward the protocol. In April 2026 the Linux Foundation announced it was launching the x402 Foundation with Coinbase contributing the protocol, and in July 2026 it announced the operational launch with premier members including Cloudflare, Coinbase, Stripe, Visa, Mastercard, Google, and others.
Why Cloudflare cares
Cloudflare sits in front of a large share of web traffic, including traffic from AI crawlers and agents. A standard way for agents to pay for content and services gives site owners a business model beyond blocking or allowing bots, and fits Cloudflare's role as an intermediary for web requests.
x402 in the Agents SDK
Cloudflare's Agents documentation describes adding x402 to agents and MCP servers. Server-side, developers can mark MCP tools as paid, so each call requires payment. Client-side, a wrapper lets an agent detect x402 responses, pay, and retry. Both the exact and up-to payment schemes are documented.
Networks supported
Cloudflare's x402 documentation lists many networks, including Base, Ethereum, Polygon, Optimism, Arbitrum, Avalanche, Solana, and others. USDC is the usual payment asset. For development, the docs recommend Base Sepolia with testnet USDC from Circle's faucet.
Charging per MCP tool call
MCP servers expose tools that AI clients can call. With paid tools, a provider can price each tool call, for example a lookup or a computation, and receive payment before returning results. This turns MCP servers into metered services without separate billing systems.
Pay per crawl and deferred payments
Cloudflare's pay per crawl beta used HTTP 402 to charge AI crawlers, and its September 2025 x402 post proposed a deferred payment scheme that aggregates charges, for example daily, for high-volume crawling. Pay per crawl is now part of AI Crawl Control.
Cloudflare Wallets
In August 2026 Cloudflare announced Wallets, giving agents capped Virtual Wallets that pay via x402 within merchant restrictions set by a human account. At announcement, payments were described as coming soon.
Building an x402 service on Cloudflare
A typical setup runs a Worker or MCP server, declares a price and accepted network and asset, sets a receiving address, and uses a facilitator to verify and settle payments. Agents pay with USDC and receive the response once payment is verified.
Paying x402 services from any agent
x402 is an open protocol, so services on Cloudflare can be paid by agents built anywhere, including those using non-custodial wallets on Base. The agent needs a funded wallet, a client that handles 402 responses, and spending limits.
Limits for paying agents
Cloudflare's tooling handles the payment mechanics. The agent operator still sets budgets and rules: maximum price per call, period caps, approved services, and revocation. Enforce these in the wallet or session key, not just in the agent's instructions.
Considerations for x402 and Cloudflare
Check current pricing for Cloudflare services and facilitators, which networks your counterparties use, and how refunds or failed calls are handled. Keep payment logic simple at first and expand once you see real usage.
Exact versus up-to schemes
With the exact scheme, a client pays a fixed price per call, which suits simple lookups. With the up-to scheme, the client authorises a maximum and the server charges actual usage, which suits variable work such as generation or processing. Cloudflare's documentation covers both, and providers choose per tool or endpoint.
Example: a paid MCP lookup tool
A provider runs an MCP server on Cloudflare with a tool that returns company data. The tool is marked paid at a small price in USDC on Base. When an AI client calls it, the client receives a payment requirement, its x402 wrapper pays from the agent's wallet, and the tool returns data once the payment is verified. The provider receives USDC at its address without any billing system.
Observability
Log each paid request with its payment reference, price, and outcome, so revenue, failures, and disputes can be traced. On the payer side, agents should log the same data and their decision to pay, which supports budgeting and incident review.
Moving from testnet to mainnet
After testing on Base Sepolia, switch the network to Base mainnet, set a production receiving address controlled by secure keys, choose a production facilitator, and start with conservative prices. Monitor payment success rates and adjust prices once usage patterns are clear.
Pricing paid tools
Set prices that cover the cost of serving each call and reflect its value to the caller. Cheap lookups can be priced at fractions of a cent, while expensive operations can carry higher prices or use the up-to scheme. Publish prices clearly so agent builders can budget.
Frequently asked questions
- What does Cloudflare have to do with x402?
- Cloudflare co-announced the x402 Foundation with Coinbase in September 2025, is a premier member of the Linux Foundation project that now governs x402, supports x402 in its Agents SDK and MCP tooling, and builds its 2026 Wallets product for agents on x402.
- How do I charge for MCP tool calls on Cloudflare?
- Use the x402 support in Cloudflare's Agents SDK to mark MCP tools as paid, specifying price, network, asset, and receiving address. Clients calling the tool receive a payment requirement, pay in USDC, and get the result once payment is verified. Test on Base Sepolia first.
- Which networks does Cloudflare's x402 support use?
- Cloudflare's documentation lists many networks, including Base, Ethereum, Polygon, Optimism, Arbitrum, Avalanche, and Solana, with USDC as the usual asset. For development, the docs recommend Base Sepolia with testnet USDC from Circle's faucet before moving to mainnet. Confirm your counterparties' networks.
