GPT-5.1-Codex: What It Was and Why Listings Still Show It
GPT-5.1-Codex was OpenAI's agentic coding model for the Responses API until its July 2026 retirement. What it did, what it cost, and how to move an agent off it.
GPT-5.1-Codex still appears in model catalogues, with a price and a context window, as if nothing had happened. On OpenAI's own API it has been gone since 23 July 2026. If you are looking at a listing and wondering whether to build on it, the short answer is no; the longer answer is worth knowing, because the reasons it was built the way it was still apply to its successors.
This guide covers what the model was for, the constraints that came with it, and how to evaluate a replacement for an agent that was tuned around it.
Where it sat in the Codex line
OpenAI's API changelog traces the lineage clearly. gpt-5-codex launched on 23 September 2025 as a special-purpose model built for the Codex CLI. On 13 November 2025, alongside the general GPT-5.1 release, OpenAI added gpt-5.1-codex and gpt-5.1-codex-mini to the Responses API. gpt-5.1-codex-max followed on 4 December 2025.
OpenAI's model page describes GPT-5.1-Codex as a version of GPT-5 optimised for agentic coding in Codex or similar environments. The emphasis is on the environment: it was tuned to work inside a harness that reads files, runs commands and applies patches, rather than to answer coding questions in a chat window.
Its siblings split the job by budget and duration. GPT-5.1-Codex-Mini was the cheaper option for lighter work, and GPT-5.1-Codex-Max was built for much longer unattended runs. The plain Codex model sat between them as the general-purpose default.
The spec sheet
OpenAI listed the model with:
- Context: 400,000 tokens, with up to 128,000 output tokens.
- Modalities: text and image input, text output.
- Knowledge cutoff: 30 September 2024.
- Price: $1.25 per million input tokens, $0.125 for cached input, and $10 per million output tokens.
- Features: streaming, function calling, structured outputs, web search and prompt caching, with reasoning tokens.
OpenRouter's catalogue shows the same input and output prices at the time of writing and lists reasoning effort control among its capabilities. As a reasoning model, its reasoning tokens bill as output, so the $10 output rate is the one that dominates on an agent task.
Responses API only
The constraint that caught most teams was the endpoint. OpenAI served GPT-5.1-Codex through v1/responses only. Chat Completions, the Batch API and the Assistants API were all unsupported.
That matters for anyone using a tool that speaks the older Chat Completions protocol, which still covers a large share of editor plugins and agent frameworks. Pointing such a tool at the model directly would fail. Aggregators bridged the gap by translating requests, which works but adds a layer where tool-call formatting or streaming events can differ from the native API. What OpenAI-compatible actually means covers where that kind of translation tends to break.
The model page also said the underlying snapshot would be regularly updated. There was no frozen, dated version to pin, so behaviour could shift without a model ID change. For an agent with a carefully tuned system prompt, that is a reason to keep a regression suite running even when nothing in your code has changed.
Retired in July 2026
On 22 April 2026, OpenAI announced a batch of legacy snapshot shutdowns for 23 July 2026. The list included gpt-5-codex, gpt-5.1-codex, gpt-5.1-codex-max and gpt-5.2-codex, all with gpt-5.6-sol as the named replacement, and gpt-5.1-codex-mini, pointed at gpt-5.6-terra. The model no longer appears on OpenAI's pricing page.
Third-party catalogues do not always remove a model the moment the upstream provider does. A listing is a record of what a router knows about, not proof that a request will succeed. Before relying on any model that has a published shutdown date behind it, send a real request and check the response, and assume that whatever serves it may stop without notice.
Moving an agent off it
Swapping the model string is the easy part. What changes is everything the agent learned to rely on:
- Replay real tasks. Take ten to twenty completed tasks from your history, reset each repository to its starting commit, and run them through the candidate with the same harness. How to benchmark LLMs on your own work covers the setup.
- Measure turns and tokens, not just pass rate. A replacement that solves the same tasks in more turns costs more and takes longer, even at a similar list price.
- Re-tune reasoning effort. Effort settings do not transfer one-to-one between generations. Start at the default and move up only where you measure a difference.
- Check tool-call formatting. If your harness parses patches or shell commands strictly, run its validators against the new model's output before letting it touch a real branch.
If you are choosing among current options rather than just following OpenAI's suggestion, agentic coding models compared covers how the field differs on long tool-using sessions.
Common questions
Is GPT-5.1-Codex still available?
Not from OpenAI. Its deprecations page lists a shutdown date of 23 July 2026, with gpt-5.6-sol as the replacement. Some third-party catalogues may still list it, so test a request before depending on one.
Could GPT-5.1-Codex be used with Chat Completions?
No. OpenAI served it through the Responses API only, so Chat Completions, Batch and Assistants requests were unsupported. Aggregators that offered it on a Chat Completions interface were translating requests.
What was the context window of GPT-5.1-Codex?
OpenAI listed 400,000 tokens of context with up to 128,000 output tokens, text and image input, and a knowledge cutoff of 30 September 2024.