openrouter/auto-code) is a router specialized for coding agents and harnesses. It runs on the same routing engine as the Auto Router, with a policy tuned for coding work:
- It starts in a higher cost tier that includes stronger coding models.
- It weighs speed more heavily.
- It penalizes failures more harshly, so it course corrects faster when tests fail or the same error comes back.
How it works
- Narrow the model pool. Guardrails, zero data retention, model capabilities, provider restrictions, BYOK keys, and your allowed and excluded model lists decide which models are considered.
- Rate the request. A fast decision model rates the turn, for example what kind of coding task it is, whether the task just changed, how hard it is, and whether a bigger model or more thinking would help.
- Pick a model and effort. The routing policy weighs measured pass rate, speed, and cost per solved task across models and reasoning efforts, plus live prices and cache status.
- Route to a provider. The request goes through the same provider routing a direct request to that model would.
- Carry signals to the next turn. Auto Code favors a change in reasoning effort over a model switch, so it keeps your prompt cache, and switches when failure signals show the model is the problem.
Usage
Setmodel to openrouter/auto-code wherever your harness takes a model string:
session_id (or the x-session-id header) so the router treats every turn of an agent session as one conversation. See Auto Router session stickiness.
Restrict the models
Auto Code applies theallowed_models and excluded_models lists from the auto-router plugin as hard restrictions, the same lists the Auto Router uses. Lists you save on your workspace’s Routing page apply too.
404 and names the fields to change.
Change the cost tier
Auto Code has three cost tiers, all built on its coding policy. OpenRouter tunes the low and high tiers against benchmark data:low: an Auto Code tuned to spend less per task.medium: the default Auto Code policy, which also applies when neither the request nor your workspace sets a tier.high: an Auto Code tuned for reliability over cost.
cost_tier on the auto-router plugin entry, or save it on your workspace’s Routing page so harnesses that can’t send plugin settings pick it up too. A cost_tier on a jev-router entry takes precedence. xhigh and max route as high. A cost tier never swaps Auto Code for the Auto Router’s general policy, and a tier that isn’t available yet runs on the default Auto Code policy.
cost_tier field of the jev-router stage in router metadata: auto-code-low, auto-code, or auto-code-high. Changing tiers starts a new routing session, so the next turn can pick a different model.
Inspect routing decisions
SendX-OpenRouter-Metadata: enabled to get router metadata. The jev-router stage in openrouter_metadata.pipeline lists resolved_models, the routed candidates with their reasoning effort and estimated cost, and the reason for the pick. See Jev Router: Seeing what the router did for every field.
Pricing
You pay the standard price of whichever model serves each request. Auto Code doesn’t add a fee.Related
- Model Routing overview: compare the routers on OpenRouter
- Auto Router: the general purpose router on the same engine
- Model Routing Benchmarks: score and cost per task for each router