Skip to content

AI Compass / News

Cloudflare AI Gateway: Auto Router picks the AI model for each request

Automation Costs

A router in AI Gateway, in beta since 30 September, assesses each request and picks a suitable model; routing is free during the beta.

Source: Cut your AI spend with AI Gateway's Auto Router (Cloudflare Blog),

Note: My domain and this website run on Cloudflare, and I use Claude and Claude Code for my own work. Neither Cloudflare nor Anthropic pays me, and the links are not affiliate links.

Technical drawing: a request runs into a router marked beta, which forwards it to one of three models, S, M and L. The path to M is highlighted.

What happened: On 30 September 2026, Cloudflare introduced an Auto Router for its AI Gateway. AI Gateway is an intermediate layer through which you send requests to different AI providers. A classification model, meaning a model that only assesses and does not answer itself, uses the most recent messages of the conversation to estimate how likely the request is to belong to each of 14 task categories and rates, on a scale of 1 to 5, its complexity, ambiguity, stakes and dependence on earlier context. The router then picks the model with the best balance of expected quality and cost. Routing is free during the beta; you still pay for the model calls. Cloudflare does not say what it will cost afterwards.

What this means: If you send every request to an expensive frontier model, you often pay for tasks a smaller model could handle. According to early internal results from Cloudflare (OpenCode harness), the router saves up to 30% compared with frontier models alone. In an internal benchmark with 291 runs per model (97 knowledge-work tasks such as email and calendars, three runs each), cloudflare/auto cost 80% of GPT-6 Sol and 35% of Claude Opus 5.5. It succeeded in 86.6% of runs, Opus in 96.6% and Sol in 84.2%; the gap to Sol lies within the margin of error. These are vendor figures and have not been independently verified, and I have not tried the router myself yet.

What you can do:

  1. Measure first: For a sample of real requests, record what they cost today and how good the answers are.
  2. Compare: Send the same requests with the model name cloudflare/auto. According to the documentation, the response header cf-aig-routed-model shows which model answered. For conversations with several rounds, send cf-aig-session-id so the router does not switch models per request.
  3. Narrow the choice: In the cf-aig-allowed-models header, allow only models you have checked for contract terms and data protection.

Context: Cloudflare manages the model pool, and according to the documentation it may change over time. Where a mistake is costly, a fixed model choice remains easier to control.

Bringing AI into your own team? That’s what my workshops are for. See the workshops