Cloudflare Launches Auto Router: It Picks the Model So Employees Don't Have To, Saving Up to 30%

Cloudflare has launched Auto Router, part of AI Gateway, in public beta. Set the model to cloudflare/auto, and the gateway routes each request to a model that is sufficient for the task. Users don't have to choose anything, and the company spends less on tokens. On an internal benchmark of 97 tasks, the router scored an 86.6% success rate at a cost of $2.10. Claude Opus 5.5 scored 96.6% for $5.91, and GPT-6 Sol scored 84.2% for $2.64. Within OpenCode, Cloudflare measured savings of up to 30% compared with running only on flagship models. • The classifier runs on Workers AI and scores 14 task categories • The router accounts for switching costs and cache costs • The service is free during the beta

AI-processed from Cloudflare AI Blog; edited by Hamidun News
Cloudflare Launches Auto Router: It Picks the Model So Employees Don't Have To, Saving Up to 30%
Source: Cloudflare AI Blog. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceCloudflare AI Blog ↗
Editor-in-Chief
Key metric #1The classifier runs on Workers AI and scores 14 task categories
Key metric #2The router accounts for switching costs and cache costs
Key metric #3The service is free during the beta

Cloudflare has launched Auto Router, an AI Gateway feature that picks a model for each request on its own, in public beta. In a client or agent, you only need to specify cloudflare/auto. The gateway then decides whether a task needs a flagship model or a cheaper one will do. Running through its internal agentic tool OpenCode, the company saved up to 30% compared with using only flagship models. On its own benchmark of office tasks, the router cost $2.10 vs. $5.91 for Claude Opus 5.5, but it also lost to Opus on the share of successful completions.

The gateway picks the model for the employee

The old approach to controlling AI spend relied on budgets, limits, and tying costs to specific people. Cloudflare describes the typical path for companies like this. First, everyone gets API keys freely and tries every new tool. Then a few main solutions remain for coding, non-technical tasks, and running agents. But in OpenCode, Claude Code, and Codex, the user still picks the model, and often picks one that is more powerful than necessary. You don't need Opus to summarize an email or a chat thread. Blocking it for the whole team isn't desirable from a security standpoint either.

AI Gateway already sees every request from users, agents, and tools, so it can make this decision centrally. The company gets the savings without changing employees' habits.

A two-stage design: a classifier and a scoring matrix

First, the gateway builds a pool of eligible models. It drops those that don't support the request format or execution mode, and it takes into account keys, billing settings, access policies, and spending limits. Models and providers that are down are temporarily excluded and return once they recover.

Next comes a multi-head classifier on Workers AI, deployed on GPUs across Cloudflare's edge network. It looks at a condensed slice of the conversation, giving priority to the most recent turns, and produces two sets of signals. The first is probabilities across 14 task categories: coding, planning, research, data analysis, and others. The second is scores from 1 to 5 on four axes: complexity, ambiguity, cost of error, and dependence on prior context.

These signals go into a separate scoring matrix, where they are combined with model benchmarks. The weights are calibrated on a set of examples for which a preferred model was determined in advance. The final score is computed with the formula utility = expected quality − adaptive cost penalty. On simple requests, price weighs more and a smaller model wins. As complexity grows, the penalty shrinks and stronger models win. The router outputs a ranked list, and the gateway tries the first model and moves to the next if the provider fails.

The upside of this design is transparency: you can see the predicted category and complexity of a task and understand why a particular model was chosen. A new model can be added without retraining; it is enough to enter weights from its benchmarks into the matrix.

Cache as a hidden cost

In long agentic sessions, such as debugging, costs are driven not by the price list but by cache reads, which get more expensive as the session grows. Switching models resets the cache, and the new model has to write the entire context from scratch. So within a single turn (the cycle of processing one user input), the router almost always stays on the current model. Between turns, it applies a switching penalty that grows with the number of tokens in the context. A model with a warm cache is scored at the read rate, while the other candidates are scored at the full context-rewrite price.

There is a second hidden cost: most models don't read each other's reasoning tokens. After a switch, the new model may redo work that has already been done, but at output-token rates. In the future, Cloudflare wants the router to prefer models from the same family when switching.

What the internal benchmark showed

The test simulates a workspace with email, a calendar, Slack, files, travel, and finances. Each task requires either a verifiable answer or an action. There are 97 tasks in total, with three runs per model, or 291 attempts. The 95% confidence intervals were computed by bootstrapping with 10,000 resamples.

• cloudflare/auto: 252 of 291 successful, 86.6% (+6.2/−6.9 pp), total cost $2.10, $0.0084 per success • Anthropic Claude Opus 5.5: 281 of 291, 96.6% (+2.7/−3.8 pp), $5.91, $0.0210 per success • OpenAI GPT-6 Sol: 245 of 291, 84.2% (+6.5/−6.9 pp), $2.64, $0.0108 per success

Cloudflare calls the result comparable to the best everyday models: the router costs 80% of Sol and 35% of Opus. But the numbers need a careful read. Against Sol, auto is comparable in quality and cheaper. It trails Opus by roughly 10 pp, and the intervals do not overlap, so the 2.5x savings per success come at the price of lower quality. For summarization and routine requests, that is a reasonable trade; for critical tasks, it is not. The company also notes that a model that is cheap on the price list can burn disproportionately more tokens, so the router minimizes the predicted cost of the entire trajectory, not the price per million tokens.

How to get started and what's next

You can start right now: Auto Router is free in the beta, and you only need to specify cloudflare/auto in your agent or client settings. It makes sense to route non-technical scenarios and routine coding through it first, and to keep high-stakes tasks on a flagship model. That will require your own benchmark on real data, like Cloudflare's.

The roadmap includes: expanding the model pool, factoring in zero data retention requirements when filtering, taking provider capacity into account, choosing the reasoning level for each request, adding full support for the Responses API and WebSockets, and testing structured decision-making models as the primary classifier. Later, cloudflare/auto-best will arrive. It will use the same pool and classifier but pick the model with the highest expected quality, without regard to price.

Story

Key Questions Answered

What are the key details on The gateway picks the model for the employee?

The old approach to controlling AI spend relied on budgets, limits, and tying costs to specific people. Cloudflare describes the typical path for companies like this. First, everyone gets API keys freely and tries every new tool. Then a few main solutions remain for coding, non-technical tasks, and running agents. But in OpenCode, Claude Code, and Codex, the user still picks the model, and often picks one that is more powerful than necessary. You don't need Opus to summarize an email or a chat thread. Blocking it for the whole team isn't desirable from a security standpoint

What are the key details on A two-stage design: a classifier and a scoring matrix?

First, the gateway builds a pool of eligible models. It drops those that don't support the request format or execution mode, and it takes into account keys, billing settings, access policies, and spending limits. Models and providers that are down are temporarily excluded and return once they recover. Next comes a multi-head classifier on Workers AI, deployed on GPUs across Cloudflare's edge network. It looks at a condensed slice of the conversation, giving priority to the most recent turns, and produces two sets of signals. The first is probabilities across 14 task categor

What are the key details on Cache as a hidden cost?

In long agentic sessions, such as debugging, costs are driven not by the price list but by cache reads, which get more expensive as the session grows. Switching models resets the cache, and the new model has to write the entire context from scratch. So within a single turn (the cycle of processing one user input), the router almost always stays on the current model. Between turns, it applies a switching penalty that grows with the number of tokens in the context. A model with a warm cache is scored at the read rate, while the other candidates are scored at the full context-

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Hands-On AI Engineering · Hamidun Academy

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.

Start 72h Free Trial →Vibe-Coding Intensive
What do you think?
Loading comments…