How Routor Works
Every request you send withmodel: "auto" is handled automatically. Routor picks the right model, routes the request, and falls back silently if anything goes wrong. The whole process adds a few milliseconds before the model even sees your prompt.
The Four Steps
Step 1 - Classify
Routor reads your prompt and makes two independent decisions:- Task category - what kind of work this is. Routor detects 17 categories: coding, debugging, math, planning, research, science, reasoning, writing, vision, multilingual, tool use, instruction following, and more. The category determines which model pool to draw from.
- Difficulty tier - how hard the task is, scored across 15 weighted dimensions (code presence, reasoning markers, technical terms, agentic tasks, constraints, etc.). The score maps to one of 5 tiers. See The 5 Tiers.
Step 2 - Filter by Capability
If your request includes images, files, audio, video, or tool calls, Routor narrows the model pool to only models that can handle it.- Image attached? Only vision-capable models
- File attached? Only file-capable models
- Tools defined? Only tool-calling models, ranked by function-calling accuracy (BFCL scores)
- Cost cap or quality floor set? Models that don’t meet it are filtered out
Step 3 - Rank by Value
From the filtered pool, Routor ranks models by value - a weighted blend of quality (the model’s benchmark score on this category) and saving (how much cheaper it is than the tier’s reference model). The default balance is 50/50. The tier’s premium reference model is kept last as a safety net. So the chain runs from best-value first to premium last: A LIGHT tier request might produce a chain like:Step 4 - Route and Return
The request goes to the selected provider. The response comes back in the same OpenAI-compatible format, plus aroutor object in the response body with routing metadata (model, tier, profile, confidence, savings). X-Request-Id is always sent as a header; the full set of X-Routor-* headers is included when your deployment has DEBUG_ROUTING=1 set. See Response Headers.
What “auto” Means
When you setmodel: "auto", Routor owns the model decision completely.
You can constrain it if needed:
"routor_profile": "direct" with a model ID. See Chat Completions for the full parameter list.
Confidence Score
Every routing decision includes a confidence score between 0 and 1. It reflects how far the prompt’s score sat from the nearest tier boundary - a clear, decisive prompt scores high; a borderline one scores closer to 0.5. Confidence is informational. The tier is always assigned from the score’s position relative to the configured boundaries, so even ambiguous prompts get the tier their score maps to (which, for neutral prompts, is typically LIGHT). You can see this in the response header, if your deployment hasDEBUG_ROUTING=1 set: