GPT-5.1

GPT-5.1-Codex

by OpenAI · Retired; API access shut down on July 23, 2026

GPT-5.1-Codex was OpenAI’s GPT-5.1 model specialized for agentic software engineering in Codex and Responses API environments. It supported text and image input, text output, tool calling, streaming, structured outputs, a 400,000-token context window, and up to 128,000 output tokens. It was deprecated on April 22, 2026, and API access ended on July 23, 2026.

Text Reasoning Coding
GPT-5.1-Codex was OpenAI’s GPT-5.1 variant for software-engineering agents rather than general-purpose chat. It was designed to write and modify code, debug failures, review repositories, run iterative workflows through tools, and handle longer autonomous coding tasks. Although its large context window and agentic features made it technically significant, GPT-5.1-Codex is now retired and should not be selected for new deployments.
Outputs

What GPT-5.1-Codex can produce

Text
Inputs

What it can understand

Text Images Multimodal input
Capabilities

Supported features

Tool use Streaming Structured output Prompt caching Batch API
Model profile

Performance characteristics

9/10 Reasoning
9/10 Coding
8/10 Speed
7/10 Cost efficiency
Specifications

Technical details

Model family GPT-5.1
Model type Coding
Context window 400K tokens
Maximum output 128K tokens
Knowledge cutoff September 30, 2024
Release date November 13, 2025
Status Retired; API access shut down on July 23, 2026
Deprecation date April 22, 2026
Shutdown date July 23, 2026
Knowledge cutoff notes

The official model documentation listed September 30, 2024 as the model's knowledge cutoff. Web search or external tools, where separately configured, would not change the underlying cutoff.

Model notes

GPT-5.1-Codex was optimized for agentic coding in Codex or similar environments and was available through the Responses API. It accepted text and image input and returned text. OpenAI documented reasoning-token support, function calling, streaming, structured outputs, cached-input pricing, and Batch API availability. Fine-tuning was not supported. The model was deprecated on April 22, 2026, and API access ended on July 23, 2026. OpenAI listed GPT-5.6 Sol as the recommended replacement.

Cost

Model pricing

Input $1.25 per 1M input tokens; $0.125 per 1M cached input tokens
Output $10.00 per 1M output tokens
Model guide

GPT-5.1-Codex: OpenAI’s Retired Model for Agentic Coding

GPT-5.1-Codex was OpenAI’s coding-specialized GPT-5.1 model for long-running, agentic software-engineering tasks. It supported text and image input, text output, tool calling, streaming, structured outputs, a 400,000-token context window, and up to 128,000 output tokens. The model was deprecated on April 22, 2026, and API access ended on July 23, 2026.

What GPT-5.1-Codex was

GPT-5.1-Codex was a coding-specialized model from OpenAI’s GPT-5.1 family. OpenAI positioned it for Codex and compatible agentic environments, where a model can inspect project files, call development tools, propose or apply changes, and iterate after seeing test results or other feedback.

That focus distinguishes it from a general conversational model. GPT-5.1-Codex was intended for practical software engineering across repositories, including feature implementation, debugging, code review, testing, migration work, and large refactors. Its purpose was not simply to suggest an isolated code snippet, but to help an engineering agent work through a task over multiple steps.

There is an important availability qualification: OpenAI deprecated gpt-5.1-codex on April 22, 2026, and API access ended on July 23, 2026. It is therefore a historical model rather than an available choice for a new production integration.

Where it fit in OpenAI’s lineup

GPT-5.1-Codex belonged to the GPT-5.1 family but was specialized for coding-agent workflows. It was available through the Responses API and was also associated with Codex-style environments. The model’s role was narrower than a general-purpose model: its design prioritized repository-level software work, tool use, and sustained task execution.

OpenAI listed GPT-5.6 Sol as the recommended replacement after GPT-5.1-Codex was retired. The supplied documentation does not provide a full feature-by-feature comparison between the two models, so GPT-5.6 Sol should be understood here as OpenAI’s stated successor recommendation, not as evidence that every capability or price was identical.

Core capabilities and technical limits

The verified context window was 400,000 tokens, while the maximum output was 128,000 tokens. A context window is the amount of conversation, instructions, source material, and tool-related information the model can consider in one request. This capacity was particularly relevant to large repositories, multi-file changes, long debugging sessions, and tasks requiring substantial project context.

  • Context window: 400,000 tokens
  • Maximum output: 128,000 tokens
  • Model family: GPT-5.1
  • Primary specialization: Agentic software engineering
  • Reasoning: Reasoning-token support was documented
  • Fine-tuning: Not supported
  • Knowledge cutoff: September 30, 2024

The large limits did not guarantee that every task would be completed autonomously or correctly. An agent still needed suitable repository instructions, access to relevant tools, reliable tests, and appropriate safeguards before changes could be accepted. The model snapshot was also updated while it was available, meaning behavior could vary unless a supported snapshot identifier was used.

Inputs, outputs, and tool use

GPT-5.1-Codex accepted text and image input and returned text output. Image input could provide useful context for interface work, screenshots of visual bugs, diagrams, or design references. It did not natively produce images, audio, video, music, or other non-text media.

The model supported function and tool calling. In practical terms, a compatible application could expose operations such as reading files, searching a codebase, running tests, inspecting build output, or applying changes. The model could then decide when to request those operations as part of a larger workflow. Tool calling did not mean that the model independently had unrestricted access to a computer; the surrounding Codex or API application still determined which tools existed and what permissions they had.

Streaming responses were supported, allowing an application to display generated output incrementally instead of waiting for the entire response. Structured outputs were also documented, which could help applications request results in a defined schema when text alone was too ambiguous. The supplied research does not verify a separate JSON-mode capability, so structured outputs and JSON mode should not be treated as interchangeable features.

What it was good at

GPT-5.1-Codex was designed for tasks where code generation was only one part of the job. Suitable workflows included:

  • Implementing a feature across several files
  • Tracing and fixing bugs
  • Writing or expanding automated tests
  • Reviewing code and identifying likely problems
  • Refactoring a large or unfamiliar repository
  • Migrating code between APIs or architectural patterns
  • Investigating failed builds, tests, or other development errors
  • Working through longer-running Codex tasks with repeated tool calls

Its practical value came from combining coding ability with repository context and iteration. For example, an agent could inspect an existing implementation, make a proposed change, run tests through an available tool, examine the failure, and revise the change. That workflow is more demanding than producing a standalone function because the model must preserve task context and respond to evidence from the development environment.

Pricing and API availability

When it was available through the API, GPT-5.1-Codex was priced at $1.25 per million input tokens and $10 per million output tokens. Cached input tokens were priced at $0.125 per million tokens. These are token-based API prices rather than a subscription fee for an end-user coding application.

OpenAI documented the model as available on paid API tiers, with no free-tier support. Batch API support was listed, as were streaming, function calling, and structured outputs. Fine-tuning was not supported.

The output-token price was substantially higher than the input-token price. Applications could therefore reduce spending by avoiding unnecessary repeated output, limiting overly verbose responses, and taking advantage of cached input where the same context was reused. However, cost optimization should not be confused with current availability: API access ended on July 23, 2026.

Strengths and trade-offs

GPT-5.1-Codex’s main technical strengths were its coding specialization, large context window, high output ceiling, reasoning support, and compatibility with tool-driven workflows. Those characteristics made it better suited to repository-scale work than a lightweight model intended mainly for short answers or quick completions.

The trade-off was that agentic coding tasks can consume substantial context and output, especially when the system repeatedly reads files, runs tools, and revises its plan. Its documented input and output prices were reasonable only in relation to the complexity of the work being performed; a fast, small coding request could be more efficiently handled by a lower-cost or lower-latency option.

The available research includes editorial scores for reasoning, coding, speed, and cost, but those ratings are evaluations rather than OpenAI-published benchmark results. They should not be presented as official performance guarantees. The provider-documented facts are the model’s supported features, limits, prices, and retirement dates.

When to choose GPT-5.1-Codex

For a historical evaluation, GPT-5.1-Codex was the appropriate type of model when the task involved substantial software-engineering context rather than a single short code answer. Its intended users included teams building coding agents, developers handling multi-file changes, and applications that needed a model to combine reasoning with controlled tool calls.

It was less appropriate for image generation, audio or video processing, native multimedia output, or general-purpose media creation. It was also a poor choice for a new deployment after its retirement. Developers starting now should follow OpenAI’s stated recommendation to evaluate GPT-5.6 Sol, while independently checking that model’s current pricing, limits, tool support, and coding behavior.

For small, latency-sensitive coding tasks, a faster or less expensive current coding model may be more suitable than a large agentic model. Conversely, for repository-wide work, the relevant comparison should include context capacity, tool integration, reliability over multiple steps, and the cost of repeated outputs—not just the quality of a single code snippet.

Limitations and retirement status

GPT-5.1-Codex produced text only. Image input expanded the information it could analyze, but it did not turn the model into an image, audio, or video generator. It also depended on the surrounding application for tool access, permissions, file operations, and test execution.

Its knowledge cutoff was September 30, 2024, according to the official model documentation. External search or tools, where separately configured, would not change the underlying cutoff of the model itself. Finally, because API access has ended, any documentation or code referring to GPT-5.1-Codex should be treated as archival. The model’s specifications remain useful for understanding its design, but they do not indicate that it can still be provisioned for new API traffic.


Answers to Frequently Asked Questions

How much did GPT-5.1-Codex cost when it was available?
GPT-5.1-Codex cost $1.25 per million input tokens, $10 per million output tokens, and $0.125 per million cached input tokens. It was available on paid API tiers, supported Batch API usage, and did not offer free-tier access.
What was the recommended replacement for GPT-5.1-Codex?
OpenAI listed GPT-5.6 Sol as the recommended replacement after GPT-5.1-Codex was retired. Developers should independently verify GPT-5.6 Sol’s current pricing, limits, tool support, and coding performance before migrating.
What were GPT-5.1-Codex’s context window and output limits?
GPT-5.1-Codex had a 400,000-token context window and a maximum output of 128,000 tokens. These limits supported large repositories, multi-file changes, long debugging sessions, and extended tool-driven coding workflows.
Is GPT-5.1-Codex still available through the API?
No. OpenAI deprecated gpt-5.1-codex on April 22, 2026, and API access ended on July 23, 2026. It is now a historical model and cannot be selected for a new production integration.
What was GPT-5.1-Codex designed for?
GPT-5.1-Codex was a coding-specialized model for agentic software engineering. It was designed to work across repositories by inspecting files, calling development tools, implementing features, debugging, writing tests, reviewing code, and iterating based on test or build results.


Sources 5
Provider

About OpenAI