Cloudflare merges Workers AI and AI Gateway behind one control plane

One API and prepaid balance now cover hosted and third-party models; model-first failover and prompt-based routing remain in testing.

By · Published

Why it matters

Cloudflare is positioning AI models as replaceable infrastructure behind one API, bill and policy layer. The shipped billing changes increase its control today; automated model selection remains a promise.

Cloudflare merges Workers AI and AI Gateway behind one control plane — One API and prepaid balance now cover hosted and third-party models; model-first failover and prompt-based routing remain in testing.

Cloudflare unified Workers AI and AI Gateway on August 7th, giving developers a common interface, billing balance and set of traffic controls for models hosted by Cloudflare or outside providers. The Cloudflare Developers account (@CloudflareDev) announced the change alongside a technical post from Cloudflare's Michelle Chen and principal product manager Ming Lu.

The release pulls together two products that Cloudflare built for different parts of the inference stack. Workers AI runs models on Cloudflare-managed GPUs. AI Gateway sits in front of model providers and handles logging, caching, rate limits, retries, security controls and cost tracking. Developers can now reach both through the env.AI.run() binding or shared /ai/ REST endpoints using Cloudflare authentication.

For Matthew Prince (@eastdakota), Cloudflare's co-founder and CEO, the product move follows the infrastructure playbook that shaped Cloudflare. Prince co-created Project Honey Pot before founding Cloudflare in 2009 with Michelle Zatlyn and Lee Holloway. Cloudflare later exposed its internal serverless architecture as Workers, turning infrastructure developed for its own network into a product for outside developers.

One API, one wallet

The most concrete addition is billing. Developers can now use prepaid AI Gateway credits for Workers AI inference as well as supported third-party services, including OpenAI, Anthropic and Google AI Studio. Requests can fall back to Cloudflare-managed provider credentials, removing the need to keep a separate API key and account balance for each provider.

That convenience carries a charge. Cloudflare applies a 5% fee when customers purchase unified billing credits. Provider inference prices are passed through without an additional token markup, according to Cloudflare's documentation. A customer buying $100 of credits is charged $105.

Cloudflare is using rate limits to push developers toward the shared wallet. Three Workers AI frontier models - Kimi K2.6, Kimi K2.7 Code and GLM-5.2 - receive a limit of 50 requests per minute per account and model when paid through AI Gateway credits, up from 20 under standard Workers AI billing. The higher limit applies to those three models rather than the entire Workers AI catalog.

The unified path also makes AI Gateway's observability available to Workers AI calls. A developer can specify default as the gateway ID, and Cloudflare will create the gateway on the first authenticated request. The resulting dashboard tracks latency, errors, token use and cost.

Cloudflare stores full prompts and responses in gateway logs by default. Developers handling sensitive inputs can disable payload storage while retaining metadata such as model, provider, token count, status, cost and duration.

Routing is the larger bet

Cloudflare's next step is model-first routing. Instead of selecting a specific hosting provider, a developer would request a model and let AI Gateway choose where to run it. Cloudflare used Kimi K2.7 Code as its example: a request could run on Workers AI, Moonshot AI's own service or another vetted host offering the same weights. If one provider runs out of capacity or fails, Cloudflare plans to move the request without requiring fallback code in the application.

Cloudflare said it hopes to pilot model-first routing in the coming months. The feature is not part of the August 7th release.

Smart routing remains further behind. Cloudflare is testing a classifier that would inspect a prompt, identify the task and its complexity, then choose a model from a curated pool. Cloudflare said internal testing is underway and described release work over the next few weeks, without giving a launch date.

The distinction matters because unified model gateways are already a contested infrastructure layer. Vercel AI Gateway offers one API, prepaid credits, observability and provider fallbacks, while its default routing can select providers using recent uptime and latency. Amazon Bedrock offers intelligent prompt routing between supported models in the same family.

Cloudflare's advantage rests on owning both sides of the request: the gateway that controls traffic and the GPU network that can serve some of it. Unified billing gives Cloudflare a commercial relationship with developers even when inference runs elsewhere. Model-first routing could deepen that position by letting Cloudflare decide which provider receives each request. The billing layer is available now; the routing system that would make the control plane strategically harder to replace is still being built.

Reader comments

Conversation for this story loads after sign-in.