---
title: "Cut your AI spend with AI Gateway's Auto Router"
description: "Cloudflare released Auto Router in public beta through AI Gateway. Set the model to “cloudflare/auto” and the gateway automatically routes each request to a model capable enough for the task, filtering by credentials, access controls, and provider health. A multi-head classifier on Workers AI assigns probabilities across 14 task categories and rates complexity, ambiguity, stakes, and context dependence on a 1-5 scale. A separate scoring matrix combines those signals with model benchmark results and token prices, applying an adaptive cost penalty and switching costs for cached contexts in long sessions. On an internal general knowledge-work benchmark of 97 tasks with three samples each, Auto Router achieved 86.6% success at $0.0084 per success, costing 35% of Claude Opus 5.5 and 80% of GPT-6 Sol while remaining free during beta."
---

# Cut your AI spend with AI Gateway's Auto Router

[Cloudflare](https://yomu.fyi/company/cloudflare) · Harrison Harnisch · Sep 30, 2026

**Type:** Announcement

## Summary

Cloudflare released Auto Router in public beta through AI Gateway. Set the model to “cloudflare/auto” and the gateway automatically routes each request to a model capable enough for the task, filtering by credentials, access controls, and provider health. A multi-head classifier on Workers AI assigns probabilities across 14 task categories and rates complexity, ambiguity, stakes, and context dependence on a 1-5 scale. A separate scoring matrix combines those signals with model benchmark results and token prices, applying an adaptive cost penalty and switching costs for cached contexts in long sessions. On an internal general knowledge-work benchmark of 97 tasks with three samples each, Auto Router achieved 86.6% success at $0.0084 per success, costing 35% of Claude Opus 5.5 and 80% of GPT-6 Sol while remaining free during beta.

## Context

Tracking AI spend revealed that users often select models that are overkill for their tasks, leading to unnecessary costs. AI Gateway already observes and enforces budgets, but individuals still choose models manually. Auto Router extends the gateway to automatically select a capable model for each request, balancing quality and price without requiring user awareness.

## Approach / What changed

Cloudflare AI Gateway’s Auto Router uses a multi-head classifier deployed on Workers AI at the edge to analyze each request across 14 task categories and four dimensions (complexity, ambiguity, stakes, context dependence) on a 1-5 scale. A scoring matrix combines these signals with model benchmark results and token prices, applying an adaptive cost penalty that gives more weight to price on straightforward tasks and less on difficult ones. The router also filters unhealthy providers, accounts for credentials and access controls, and includes switching penalties for cached contexts in long sessions to minimize disruption.

## Takeaways

- Auto Router uses a multi-head classifier that assigns probabilities across 14 task categories and rates requests on complexity, ambiguity, stakes, and context dependence on a 1-5 scale.
- The scoring matrix combines classification signals with benchmark results and token prices, applying an adaptive cost penalty that favors cheaper models for simple tasks and frontier models for harder ones.
- For long agentic sessions, Auto Router accounts for cache read/write costs and applies a switching penalty based on context length, avoiding wasteful model switches within a turn but allowing them across turns when beneficial.

## FAQ

### How does Auto Router decide which model to use?

It first filters the model pool by request format, credentials, access controls, and provider health. Then a classifier assigns task category probabilities and rates complexity, ambiguity, stakes, and context dependence. A scoring matrix combines those with benchmark results and token prices, selecting the model with the highest utility (expected quality minus adaptive cost penalty).

### What cost savings have been observed with Auto Router?

In internal testing on general knowledge-work tasks, Auto Router achieved 86.6% success at $0.0084 per success, costing 35% of Claude Opus 5.5 and 80% of GPT-6 Sol. Overall cost savings can reach up to 30% compared to using only frontier models.

### Does Auto Router consider cache costs for long sessions?

Yes, for long agentic sessions. It accounts for cache read and write costs and applies a switching penalty that grows with context length. Within a turn, switching rarely pays off; across turns, a model switch must earn back through higher quality or cheaper cache reads.

**Tags:** [AI](https://yomu.fyi/topic/ai), [AI Gateway](https://yomu.fyi/topic/ai-gateway), [Model Routing](https://yomu.fyi/topic/model-routing), [Workers](https://yomu.fyi/topic/workers)

- Source: [Cloudflare](https://blog.cloudflare.com/auto-router)
- Source URL: https://blog.cloudflare.com/auto-router
- Ingested by Yomu: 2026-09-30T15:00:15.014Z

[Read original post](https://blog.cloudflare.com/auto-router)
