# OpenRouter Auto Router and Auto Code: when to let a router choose

URL: https://infro.io/blog/openrouter-auto-router-and-auto-code-when-to-let-a-router-choose
Author: INFRO Editorial (https://infro.io/blog/editorial)
Publisher: INFRO
Published: 2026-11-08
Last modified: 2026-11-08
Last reviewed: 2026-11-08 (next review due 2026-12-08)
Topic: Routing and reliability
Format: Comparison

> Let a vendor-run router choose when traffic is varied, no single model is clearly right, and you can bound the pool and log the answering model on every call. Keep explicit routing rules where you must name the model in an audit, forecast a unit cost, or reproduce an answer path. [^or-auto-launch]

Key takeaways:
- Auto Router and Auto Code choose both the model and the reasoning effort per request, so the model that answered is data you must record, not a setting you control.
- Bound the pool with allowed and excluded model lists and a cost tier, and treat a release that shifts default cost behavior as a change to re-forecast.
- Log the response's model field on every call and turn on router metadata where you need the reason; cached replays carry no metadata.
- Keep explicit routes for workloads that need a named model in an audit, a stable unit cost or a reproducible failover path, and let a router handle the varied, low-stakes remainder.

## What changed on November 6

On November 6, 2026 OpenRouter relaunched Auto Router (`openrouter/auto`) and added Auto Code (`openrouter/auto-code`), a router tuned for coding harnesses. Both weigh eleven factors about each request against live pricing, provider health, benchmarks and cache state, then pick a model and a reasoning effort from the pool your governance policies allow.[1] The slug is unchanged, and the `cost_tier`, `allowed_models` and `excluded_models` settings still work.[1]

This post is about the decision that follows for a platform team: do you send a workload to a router that chooses the model, or write the choice down yourself as routing rules over connections you hold? It is a different question from the one in [OpenRouter's speed-and-reliability default](https://infro.io/blog/openrouter-now-routes-by-speed-and-reliability-what-to-re-check), which covers provider selection. Here the thing being chosen is the model.

Two layers matter, and OpenRouter separates them. Model routing picks which model handles the request. Provider routing then picks who serves that model, using your provider preferences, uptime, latency, price and prompt cache state.[1] Everything below concerns the first layer.

## How the router decides, and what you can bound

The documented flow has five steps. The pool is narrowed first: guardrails, zero data retention, model capabilities, provider restrictions, BYOK keys and your allowed and excluded lists decide which models are candidates. A fast decision model then rates the request in one call. The routing policy weighs that rating against live prices, cache status and benchmarks, within your cost tier. The request goes through ordinary provider routing. Signals from each turn feed the next.[2]

That gives you three levers, all coarse:

- **Pool.** `allowed_models` and `excluded_models` decide who may be picked. The docs have a pattern syntax section; read it before relying on wildcards.[2]
- **Cost tier.** `cost_tier` shifts where in the price range the router aims. OpenRouter says it moved Auto's default pricing closer to where it was a few months earlier to bring in more model variety, and that `cost_tier: low` restores similar cost behavior to the previous release.[1]
- **Slug.** Auto Router favors a cost-efficient tier; Auto Code starts in a higher tier and weighs measured pass rate, speed and cost per solved task.[1]

One trap: `openrouter/auto-beta` is the release channel where changes land before they graduate to `openrouter/auto`, and it reads settings only under the plugin id `auto-beta-router`. Settings sent under the other slug's plugin id are accepted but silently ignored.[2] A copied config that names the wrong id gives you an unbounded pool and no error.

You do not get a lever for "always this model for this customer." That is what rules are for.

## Control: a pool you bound versus a route you write

With a router, you describe constraints and the vendor's policy picks within them. With explicit rules, you describe the outcome. INFRO's routes are the second shape: a route is a stable name your application sends as `model`, resolving to an ordered or weighted list of your own provider connections and the model each should serve. A route can carry up to 20 if-rules, checked in order, the first match deciding.[3] Conditions read request metadata, feature, end user, key, project, streaming, images, tools, prompt size, and time of day.[3]

```json
{
  "name": "Long prompts from gold tier",
  "match": "all",
  "conditions": [
    { "field": "metadata", "key": "tier", "op": "in", "value": ["gold", "platinum"] },
    { "field": "input_tokens", "op": "gt", "value": 50000 }
  ],
  "targets": [{ "connection_id": "conn_…", "model": "openai/gpt-6-sol" }],
  "fallthrough": true
}
```

That rule is the shape from INFRO's docs; the tier values are illustrative.[3] Every request that matches goes to the named model, and a reviewer can read the file.

There is a middle path. INFRO's prompt classifier lets a decision model pick a class per prompt, and route rules send each class to its own targets, with a fallback class when the classifier is unsure or unreachable. The model still has to be named by you per class, so the judgment is automated but the destination is not.

OpenRouter also offers an explicit layer: presets store model selection, provider preferences, parameters and prompts under a name such as `@preset/code-reviewer`, which you can change without a deploy.[4] Pinning is therefore available on the same platform; the router is opt-in per slug.

## Auditability: recording which model answered

A router makes the answering model a runtime output. For audit, three records matter: the model that served, the reason, and the attempts.

The response's `model` field names the model that was selected.[2] For the reason, send `X-OpenRouter-Metadata: enabled`. The response then carries `openrouter_metadata` with the requested slug, the strategy (`auto`, `direct`, `fallback` and others), the attempt number that succeeded, whether the request used a BYOK key, the candidates considered, and per-attempt status. The Auto Router docs say the `jev-router` stage in the pipeline lists the routed candidates with reasoning effort, estimated cost and the reason for the pick.[5][2] For streaming, the metadata arrives on the final chunk before `data: [DONE]`.[5]

```python
import json, logging, requests

log = logging.getLogger("llm.audit")

def ask(prompt: str, route_slug: str = "openrouter/auto") -> str:
    r = requests.post(
        "https://openrouter.ai/api/v1/chat/completions",
        headers={
            "Authorization": "Bearer <OPENROUTER_API_KEY>",
            "X-OpenRouter-Metadata": "enabled",
        },
        json={"model": route_slug,
              "messages": [{"role": "user", "content": prompt}]},
        timeout=60,
    )
    r.raise_for_status()
    body = r.json()
    meta = body.get("openrouter_metadata") or {}
    log.info(json.dumps({
        "requested": route_slug,
        "served_model": body.get("model"),
        "strategy": meta.get("strategy"),
        "attempt": meta.get("attempt"),
        "is_byok": meta.get("is_byok"),
        "summary": meta.get("summary"),
    }))
    return body["choices"][0]["message"]["content"]
```

Write `served_model` into the same record you use for cost, because the price follows it. On your side of an explicit route the equivalent is already a record: INFRO's request log stores the model, the selected provider connection, the outcome, timings, usage and estimated provider cost, and the trace names the route and the connection that served it.[6][3] The model is known before the call, so the log confirms rather than discovers.

## Cost predictability: a price that moves with the policy

The router adds no fee: you pay the standard price of whichever model serves, and the response says which one.[1] The predictability problem is elsewhere. The policy weighs live prices, so the same prompt can land on different models on different days, and OpenRouter has already changed Auto's default cost posture once to widen variety.[1] Fallbacks behave the same way: a request is priced at the model ultimately used, which a free model falling back to a paid one makes plain.[7]

Restraint helps in one case. OpenRouter says the router tries to protect caching by changing reasoning effort before switching models, and that in its beta it stayed on one model for nearly nine of every ten agent turns.[1] That is a vendor measurement on its own traffic; check the switch rate on yours.

> **Example: Illustrative forecast**
> Suppose a support workload averages 2,000 input and 400 output tokens per request. With a pinned model the unit cost is one multiplication. With a router, it is a mix: for instance 70% of requests on a mid-tier model and 30% on a larger one, with the mix drifting as prices and policy change. These numbers are made up to show the shape; the point is that the forecast needs a distribution of served models, taken from your own log, not a single rate.

Practical controls: bound the pool so the most expensive model you cannot afford is excluded, set the tier, put a hard cap on the key or project, and re-forecast when the vendor announces a router release. On INFRO, budgets set a hard cap per organization, project, member and key with alerts at your thresholds, and the same limits apply whichever model answers.

## Failure behavior: who retries, and on what

Router and fallback behavior differ in kind. A router can change model because a session is going badly: OpenRouter says repeated errors or failing tests after an edit raise the odds of a switch.[1] A fallback list changes model on error: the `models` array tries the next model if the first returns an error, including context-length validation errors, moderation flags, rate limits and downtime, and the Messages-style `fallbacks` list accepts at most three entries.[7] When the router metadata is on, `attempt` greater than 1 tells you earlier attempts failed.[5]

Narrowing the pool can also remove every candidate. The metadata docs list a "No Providers Available (404)" and a "Guardrail Blocked (403)" error case, so a tight exclusion list plus a guardrail can turn into a hard failure rather than a downgrade.[5] Test it before production.

INFRO's rule is stricter and narrower. A route retries the same target 0 to 3 times, then moves on when a provider 4xx, 429, 5xx or timeout happens before the response starts; failure rules can set retry, move on or stop per failure kind. Once a stream has started it is not restarted on another target, and INFRO's own refusals (authentication, budget, allowlist) never fail over.[8] Every fallback is a model you listed. What the docs I read do not state is how the Auto Router behaves if its own rating call is slow or fails; ask OpenRouter or test it with fault injection.

## Side by side

| Question | Vendor-run auto router | Explicit rules on your own connections |
| --- | --- | --- |
| Who names the model | The router, within your pool | You, per route and rule |
| Audit evidence | `model` field, plus opt-in metadata for reason and attempts | Model fixed in config; request log confirms it |
| Cost forecast | A distribution of served models | A rate per target |
| Policy changes | Vendor ships new generations; one already moved default cost posture | Change when you change the route |
| Failure path | Provider routing, fallback lists, session signals | Your ordered targets and failure rules |
| Best fit | Mixed traffic, agents, teams without time to track releases | Regulated, billed-per-customer, or reproducibility-critical paths |

Table: What each approach leaves to you.

## When to let the router choose

OpenRouter's own framing is candid: no router beats the single best frontier model at every point on the cost and quality curve, routers earn their place when work is varied, and if you know the model that works best for your work, keep using it.[1] That is a useful test.

Let a router choose when:

- the traffic is a mix of task types and difficulty, and no single model is right for most of it;
- the output is reviewed by a person or checked by tests, so a wrong pick is caught;
- you can bound the pool and cap spend, and your finance process accepts a mix rather than a rate;
- the team lacks the time to re-evaluate each release, which is the situation Auto Code is aimed at for coding agents.

Keep explicit rules when:

- a contract, regulator or customer requires naming the model that processed the data;
- you bill end customers per request and need a stable unit cost;
- you rely on fallback equivalence you have tested, as in [testing fallback models](https://infro.io/blog/is-your-fallback-model-good-enough-test-fallback-equivalence);
- you need to replay a request and expect the same path.

Most teams end up with both: explicit routes for the revenue and compliance paths, a router for internal tools and coding agents. Pin by sending a named model or preset instead of the router slug, log `served_model` from day one, and compare a week of router traffic with your pinned baseline before widening it.

## Questions

### Does a cached replay tell me which model answered?

Not through router metadata. OpenRouter documents that cache hits never include openrouter_metadata, so that field is absent on replays and you should not build audit logic that assumes it is always present. [5]

### Is the response's model field enough for an audit trail?

It records which model served the request, which is the minimum an audit needs. It does not record why the router chose it, the candidates it weighed or earlier failed attempts; those come from the opt-in metadata. [2]

## Sources

1. Introducing the New Auto and Auto Code Routers — OpenRouter. https://openrouter.ai/blog/announcements/auto-and-auto-code-routers/ (accessed 2026-11-08)
2. Auto Router - openrouter/auto — OpenRouter. https://openrouter.ai/docs/guides/routing/routers/auto-router (accessed 2026-11-08)
3. Routes — INFRO. https://infro.io/docs/routes (accessed 2026-11-08)
4. Presets — OpenRouter. https://openrouter.ai/docs/guides/features/presets (accessed 2026-11-08)
5. Router Metadata — OpenRouter. https://openrouter.ai/docs/guides/routing/routers/router-metadata (accessed 2026-11-08)
6. Request traces — INFRO. https://infro.io/docs/observability/traces (accessed 2026-11-08)
7. Model Fallbacks — OpenRouter. https://openrouter.ai/docs/guides/routing/model-fallbacks (accessed 2026-11-08)
8. Smart routing — INFRO. https://infro.io/docs/features/routing (accessed 2026-11-08)
