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 ignores theauto-router plugin’s cost_tier and runs on its own coding tier. To route a request on a general tier instead, set cost_tier on a jev-router plugin entry to low, medium, or high:
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