Auto Code is OpenRouter’s router built specifically for coding agents and harnesses. It uses the same routing engine as the Auto RouterOpens in new tab, with every request treated as part of an agent session and model choices guided by coding-task pass rate, completion time, and cost per solved task.
It follows edits, test results, and recurring errors across turns, keeping the model while work is going well and trying more reasoning effort before switching when trouble persists. Its default coding tier starts from stronger models and weighs failed code changes more heavily. Your model and provider restrictions still apply.
Explore actual agent usage and how the router chooses models for new work.
API
Drop-in code to call this model. OpenRouter's API is OpenAI-compatible — most SDKs work by just swapping the base URL. The only thing that changes between models is the model slug below.
Auto Code is OpenRouter’s router built specifically for coding agents and harnesses. It uses the same routing engine as the Auto Router, with every request treated as part of an agent session and model choices guided by coding-task pass rate, completion time, and cost per solved task.
Where is the Auto Code documentation?
The Auto Code documentation on OpenRouter includes the Auto Router guide. The quickstart covers API keys and your first request, and the API reference lists every parameter.
How much does Auto Code cost?
Auto Code has no fixed price of its own. Each request is billed at the price of the model that serves it, so your cost depends on which model the request is routed to.
What is the context length of Auto Code?
Auto Code can route to models with context windows of up to 2,000,000 tokens. The context length available to a request is that of the model that serves it.
What inputs and outputs does Auto Code support?
Auto Code accepts text, images, audio, files such as PDFs, and video as input and returns text and images.