Agentic AI
Cloudflare opens paid tool access for AI agents—putting spending control at the runtime level
A new monetization gateway lets domain owners charge AI agents for API access, but proper budget enforcement requires careful design at the agent runtime, not the model.
The New Stack
Cloudflare has launched a closed beta of its Monetization Gateway, establishing a framework through which website and API owners can charge AI agents for resource access. Payments flow through the x402 protocol embedded in HTTP requests and settle in USDC on the Base blockchain, releasing the resource only once funds clear.
The beta currently extends to select U.S. participants, with Cloudflare's own AI Gateway already applying the system to charge for model inference on a per-request basis. For teams deploying agents, the introduction of paid tool calls introduces new complexity: the agent runtime must now evaluate whether it holds sufficient spending authority before executing a resource request.
Where spending authority should live#
Proper spending controls belong in the agent runtime rather than with the language model itself. Cloudflare's planned Virtual Wallets feature moves in this direction by allowing account owners to set an allowance ceiling, an allowlist of approved services, and per-transaction caps that apply universally across any tool the agent selects.
The Agents SDK's withX402Client wrapper accepts a confirmation callback that evaluates payment requirements before execution. Developers can pass null to enable automatic payment, or implement approval workflows that mirror MCP's elicitation pattern—pausing tool execution to request human sign-off.
The limits of per-call spending caps#
Restricting individual calls to $0.10 provides minimal protection when an agent performs dozens of calls during complex research or coding tasks. A task could easily spend $10 while respecting each per-call limit. Wallet-level allowances set a ceiling, but without separate Virtual Wallets per task, teams lose visibility into how much a single workflow is consuming.
Some agent platforms are addressing this by embedding budget enforcement into their infrastructure. TrueFoundry's TrueForge, for instance, routes model and tool calls through its gateway to enforce budgets and rate limits across entire agent deployments.
Variable pricing creates uncertainty#
The x402 protocol supports both fixed pricing—where the cost is known upfront—and variable pricing, where clients authorize a maximum ceiling and the service reports the actual charge afterward. API2PDF, a launch customer, relies on variable pricing because PDF generation costs depend on document complexity. This forces the runtime to make conservative assumptions: treat each call as consuming its full authorized ceiling until settlement confirms the true amount.

