# GPT-5-Codex

> OpenAI's first Codex-branded GPT-5 model, tuned for long-horizon agentic software engineering.

- Maker: OpenAI
- Line: Codex
- Canonical page: https://ai-tldr.dev/models/gpt-5-codex/
- Updated: 2026-06-18

## In short

GPT-5-Codex is the first Codex-branded model in OpenAI's GPT-5 generation, announced in September 2025. It has a 400K-token context window and costs $1.25 per million input tokens and $10.00 per million output tokens. You can use it through OpenAI API and OpenRouter.

## Facts

| Fact | Value | Source |
| --- | --- | --- |
| Context window | 400K (max output 128K) | [1] |
| Input price | $1.25 / 1M tokens (cached $0.125) | [2] |
| Output price | $10.00 / 1M tokens | [2] |
| Licence | Proprietary · API only | [1] |
| Released | September 2025 | [3] |
| Parameters | Undisclosed | [1] |
| Knowledge cutoff | Sep 2024 | [1] |

## Sources

1. [Addendum to GPT-5 System Card: GPT-5-Codex](https://cdn.openai.com/pdf/97cc5669-7a25-4e63-b15f-5fd5bdc4d149/gpt-5-codex-system-card.pdf)
2. [GPT-5-Codex — OpenAI API model page](https://developers.openai.com/api/docs/models/gpt-5-codex)
3. [Introducing upgrades to Codex (GPT-5-Codex announcement)](https://openai.com/index/introducing-upgrades-to-codex/)

## Overview

GPT-5-Codex is the first Codex-branded model in OpenAI's GPT-5 generation, announced in September 2025. It is a version of GPT-5 further optimized for agentic coding inside Codex, trained on complex, real-world software engineering work rather than general chat: building full projects from scratch, adding features and tests, debugging, performing large-scale refactors, and conducting code reviews. OpenAI recommends GPT-5-Codex specifically for agentic coding tasks in Codex or Codex-like environments, while keeping GPT-5 as the general-purpose model.

GPT-5-Codex carries a 400K-token context window and can generate up to 128K output tokens, and it accepts both text and image input so it can read screenshots, diagrams, and UI surfaces shared during a coding session. A defining trait is its ability to dynamically scale how long it thinks: it answers quickly on small, interactive requests but can keep working independently for long stretches on large tasks. During OpenAI's testing, GPT-5-Codex worked on its own for more than seven hours at a time on large, complex tasks, iterating on its implementation, fixing test failures, and ultimately delivering a working result.

The model became available to developers on September 23, 2025, through the OpenAI Responses API (model ID gpt-5-codex), in addition to ChatGPT subscriptions. It runs everywhere Codex does — the Codex CLI, IDE extensions, the web, GitHub code review, and the ChatGPT iOS app — and is the default for cloud tasks and code review. On SWE-bench Verified it scores 74.5%, and on OpenAI's internal code-refactoring benchmark it reaches 51.3%, a large jump over the base GPT-5 model's 33.9%.

## Benchmarks

- SWE-bench Verified: 74.5% ([source](https://openai.com/index/introducing-upgrades-to-codex/))
- Code refactoring (OpenAI internal benchmark): 51.3% ([source](https://openai.com/index/introducing-upgrades-to-codex/))

## Pricing

- Input: $1.25 / 1M tokens
- Cached input: $0.125 / 1M tokens
- Output: $10.00 / 1M tokens

Source: https://developers.openai.com/api/docs/models/gpt-5-codex

## Strengths

- Long-horizon agentic coding — worked independently for 7+ hours on large tasks in OpenAI's testing
- Dynamically scales reasoning time: fast on interactive requests, persistent on complex ones
- Strong on large-scale code changes such as refactors, validating with dependency analysis and tests
- Image input — reads screenshots, diagrams, and UI surfaces during a coding session
- 400K-token context window for reasoning over large codebases
- Runs everywhere Codex does: CLI, IDE extension, web, GitHub code review, and the ChatGPT iOS app

## Best for

- Reach for it for long, independent execution of complex engineering tasks inside Codex (CLI, IDE, or cloud).
- Reach for it for large-scale refactors and migrations that need planning, dependency analysis, and test runs.
- Reach for it for automated code review on GitHub pull requests.
- Reach for it when a coding agent needs to interpret a UI screenshot or diagram as part of the loop.

## How to access

- [OpenAI API](https://developers.openai.com/api/docs/models/gpt-5-codex) — model id `gpt-5-codex`
- [OpenRouter](https://openrouter.ai/openai/gpt-5-codex) — model id `openai/gpt-5-codex`

## Codex versions

- [GPT-5.3-Codex](https://ai-tldr.dev/models/gpt-5-3-codex/) (5 February 2026)
- [GPT-5.3-Codex-Spark](https://ai-tldr.dev/models/gpt-5-3-codex-spark/) (12 February 2026)
- [GPT-5.2-Codex](https://ai-tldr.dev/models/gpt-5-2-codex/) (11 December 2025)
- [GPT-5.1-Codex](https://ai-tldr.dev/models/gpt-5-1-codex/) (19 November 2025)
- GPT-5-Codex (September 2025) — this page

## FAQ

### What is GPT-5-Codex?

GPT-5-Codex is OpenAI's first Codex-branded GPT-5 model, announced in September 2025. It is a version of GPT-5 optimized for agentic coding inside Codex — building projects from scratch, adding features and tests, debugging, large-scale refactors, and code review. OpenAI recommends it specifically for agentic coding in Codex or Codex-like environments.

### How much does GPT-5-Codex cost?

On the OpenAI API, GPT-5-Codex is priced at $1.25 per million input tokens and $10.00 per million output tokens, with cached input at $0.125 per million tokens — the same pricing as GPT-5. It is also included with ChatGPT Plus, Pro, Business, Edu, and Enterprise plans inside Codex.

### What is the context window of GPT-5-Codex?

GPT-5-Codex has a 400K-token context window and can generate up to 128K output tokens. It accepts both text and image input, and its knowledge cutoff is September 30, 2024.

### How does GPT-5-Codex perform on benchmarks?

GPT-5-Codex scores 74.5% on SWE-bench Verified and 51.3% on OpenAI's internal code-refactoring benchmark — a large jump from the base GPT-5 model's 33.9%. In OpenAI's testing it also worked independently for more than seven hours at a time on large, complex tasks.

## Links

- [Introducing upgrades to Codex (GPT-5-Codex announcement)](https://openai.com/index/introducing-upgrades-to-codex/)
- [Addendum to GPT-5 System Card: GPT-5-Codex](https://cdn.openai.com/pdf/97cc5669-7a25-4e63-b15f-5fd5bdc4d149/gpt-5-codex-system-card.pdf)
- [GPT-5-Codex — OpenAI API model page](https://developers.openai.com/api/docs/models/gpt-5-codex)
- [GPT-5-Codex on OpenRouter](https://openrouter.ai/openai/gpt-5-codex)
- [OpenAI's GPT-5-Codex can run independently for 7 hours (VentureBeat)](https://venturebeat.com/ai/openai-unveils-new-model-gpt-5-codex-optimized-for-agentic-coding)

Source: AI/TLDR LLM registry, https://ai-tldr.dev/models/gpt-5-codex/
