GPT-5.1-Codex-Mini: The Cheap Tier of OpenAI's Coding Line
Codex-Mini cost a fifth of Codex-Max with the same 400K window. Which coding jobs a small model handles, when to escalate, and what replaced it after retirement.
The expensive mistake in coding agents is rarely picking a weak model. It is sending every request, including the trivial ones, to the strongest model you have. GPT-5.1-Codex-Mini existed to fix that: a smaller, cheaper member of OpenAI's Codex family for the large share of coding work that does not need a frontier model.
It has since been retired from OpenAI's API, but the decision it represented is permanent. Every model line now has a cheap tier, and knowing what that tier can and cannot do is most of the skill in keeping a coding bill under control.
One fifth of the price, on paper
OpenAI released gpt-5.1-codex-mini to the Responses API on 13 November 2025, alongside GPT-5.1 and GPT-5.1-Codex. Its model page described it as a smaller, lower-cost, less capable sibling of GPT-5.1-Codex, which is unusually candid wording for a vendor.
The price on that page was $0.25 per million input tokens, $0.025 for cached input and $2.00 per million output. GPT-5.1-Codex and GPT-5.1-Codex-Max were both listed at $1.25 input and $10 output. That is exactly one fifth on every line. The catalogue we sync from OpenRouter showed the same input and output rates at the time of writing.
The real saving is usually smaller than five times. A weaker model takes more turns on anything non-trivial, and every extra turn re-sends the context. The ratio only holds on tasks the small model finishes in the same number of steps.
Same window, smaller model
The spec sheet did not shrink with the price. Codex-Mini had the same 400,000-token context window and 128,000-token output limit as the larger models, text and image input, and the same 30 September 2024 knowledge cutoff. Like the rest of the Codex line it was served through the Responses API only, with function calling and web search as its supported tools. Chat Completions and Batch were not supported.
A large window on a small model is useful but easy to misread. It means the model can accept a big prompt; it says nothing about how well a smaller model reasons over everything in it. For repository-wide questions, the window is rarely the binding constraint. Comprehension is.
Jobs a small coding model does well
The work that suits a model like this is high-volume and well specified, with a quick way to check the result:
- Mechanical edits — renames, signature changes, adding a parameter through a call chain.
- Boilerplate — DTOs, test scaffolds, serialisers, config files from a clear template.
- Explaining code — what a function does, where a value comes from, summarising a diff.
- First-pass triage — classifying a failing test or an error log before a bigger model looks at it.
- Autocomplete-style generation inside an editor, where latency matters more than depth.
What these share is that a wrong answer is cheap to detect: the compiler, the tests or a glance at the diff catches it. When a cheap model is enough goes further into why verifiability, not difficulty, is the better test.
When to pick Codex-Max instead
Escalate to the larger model when the task is ambiguous, spans several files with dependencies between them, or runs long enough that the agent must keep a plan together. Codex-Max was trained to compact its own history across context windows; Codex-Mini was positioned as the low-cost option, not the long-run specialist.
A useful rule: if you would not hand the task to a junior engineer without a written spec, do not hand it to the small model either. If a mistake would only show up in production rather than in CI, pay for the larger model.
A routing pattern that uses both
The cleanest way to use a mini tier is not to choose it by hand but to route to it by default and escalate on evidence:
- Send every task to the small model first, with a tight output format.
- Run the cheapest available check: type-check, lint, the relevant tests.
- On failure, retry once on the small model with the error attached.
- On a second failure, hand the task and the failed attempts to the larger model.
Track how often step four fires. If more than a third of tasks escalate, the small model is costing you money in wasted turns and the default should change. Model routing and fallbacks covers the mechanics, and escalation rate as a cost metric covers why that one number decides your default.
Status in October 2026
OpenAI announced the deprecation of gpt-5.1-codex-mini on 22 April 2026, with a shutdown date of 23 July 2026, and named gpt-5.6-terra as the replacement. The larger Codex models from the same generation were pointed at gpt-5.6-sol instead, which keeps the small-tier and large-tier split intact in the newer line.
If you still route to Codex-Mini through a third-party listing, confirm it actually answers before relying on it; catalogues can outlive the upstream endpoint. Then rerun your escalation-rate measurement against the replacement. A new cheap tier may clear more of your tasks on the first pass, which changes where your routing threshold should sit.
Common questions
How much cheaper was GPT-5.1-Codex-Mini than Codex-Max?
OpenAI listed it at $0.25 input and $2.00 output per million tokens, against $1.25 and $10 for GPT-5.1-Codex-Max: one fifth on every line. The effective saving is smaller on hard tasks, because a weaker model needs more turns.
Did GPT-5.1-Codex-Mini have a smaller context window?
No. OpenAI listed the same 400,000-token context window and 128,000-token output limit as the larger Codex models. The difference was in capability, not in how much text the model could accept.
What replaced GPT-5.1-Codex-Mini?
OpenAI's deprecations page lists gpt-5.6-terra as the replacement, with the model removed from the API on 23 July 2026. The larger Codex models of the same generation were pointed at gpt-5.6-sol.