Frontier · OpenAI

GPT-5 Codex

OpenAI’s coding-agent specialist: point it at a repo, describe the change, and let it grind through the work end to end.

Illustration of a coding model working through a problem on a chalkboard
ParamsContextLicenseReleasedPrice/1M in–outModality
Undisclosed256KProprietary, commercial APISep 2025$1.25 / $10.00Text, vision, code

What it is and who makes it

GPT-5 Codex is OpenAI’s coding-specialist model, shipped in September 2025 — the engine behind the Codex cloud agent and the Codex CLI experience. It’s a sibling of GPT-5, not a fork of it, tuned specifically for long, autonomous software-engineering runs: read a repo, plan, edit multiple files, run tests, iterate. It’s proprietary, API-accessible, and priced like the flagship at $1.25/$10.00 per million tokens.

The mental model that helps: GPT-5 answers questions about code; GPT-5 Codex changes code. You hand it a workspace and a ticket, and its job is to leave that workspace better — tests passing, diff reviewable, commit message written. That’s a fundamentally different contract than chat, and it changes how you evaluate the output: you judge it by merged PRs per week, not by how clever the explanations sound.

Architecture and what’s under the hood

Deep details are undisclosed. What’s publicly understood: it shares GPT-5’s backbone class, but the post-training is heavily code-forward — reinforcement learning on real pull-request workflows, test-driven iteration and long-horizon tool use. The distinguishing trait isn’t raw parameter count, it’s behavior: it’s been taught to persist. It plans, edits, runs the test suite, reads the failures, and retries, rather than emitting one confident block and stopping. Context is the same 256K window as the rest of the family.

Strengths

  • Autonomous runs. Given a well-scoped task, it can carry a PR-sized change from description to green tests without hand-holding — the closest mainstream thing to a junior engineer you can fire at a ticket.
  • SWE-bench Verified ~78 (approx.) — at the very top of the public coding leaderboards as of Nov 2026, and Aider Polyglot ~80+ (approx.).
  • Multi-file reasoning. It keeps a coherent mental model across a large diff — renames, call-site updates and test fixes in one pass.
  • Tool fluency. Shell commands, test runners, linters, package managers — it drives the actual dev loop, not just the editor.
  • Same price as GPT-5. You’re not paying a coding tax; the specialization is free at this price point.

Weaknesses and failure modes

  • Narrow by design. Weaker at general writing, analysis and open-ended conversation than GPT-5 — don’t use it as your default chat model.
  • Scope hunger. Vague tickets make it improvise an architecture. It works best with tight, checkable acceptance criteria.
  • Long-run risk. Autonomy cuts both ways — an agent that keeps going can keep going wrong. Branch protection and review gates are mandatory, not optional.
  • Compute cost per task. A real agentic run can consume tens of thousands of tokens; the $1.25 input price is friendlier than it sounds because agent loops burn output.
  • Test dependency. Autonomy is only as safe as your test suite — in a repo with thin coverage, the agent can “fix” things by relaxing assertions. Watch for changed expectations, not just green runs.
  • Environment friction. Repos with weird toolchains (native builds, pinned system libs, private registries) derail it fast; the sandbox is not your laptop.

Best for / not great for

Best for: autonomous bug fixes with a repro, test-backfill on legacy code, framework migrations, dependency upgrades, PR-level refactors, and any task where “run the tests and fix until green” is the definition of done.

Not great for: greenfield product thinking, tricky algorithmic research, prose-heavy work, or tiny edits where autocomplete already suffices. Also skip it if your team can’t review AI-written diffs properly.

Variants and family members

There’s no smaller Codex sibling — the family around it is gpt-5 (general frontier), gpt-5-mini (cheap generalist) and gpt-5-nano (routing tier). For interactive, editor-side assistance, plain GPT-5 is usually the better feel; Codex shines when it owns the whole loop in the cloud. Both sit above the older gpt-4-era coding experience.

Pricing, access and how to run it

$1.25 per million input tokens and $10.00 per million output tokens (as of Nov 2026). Access comes via the OpenAI API, the Codex cloud agent in ChatGPT, the Codex CLI, Azure OpenAI and OpenRouter (openai/gpt-5-codex). Minimal Python call:

from openai import OpenAI

client = OpenAI()

response = client.chat.completions.create(
    model="gpt-5-codex",
    messages=[
        {"role": "system", "content": "You are a coding agent. Plan, edit, run tests, iterate until green."},
        {"role": "user", "content": "Fix the failing tests in tests/test_parser.py. Show the diff when done."},
    ],
    reasoning_effort="high",
)
print(response.choices[0].message.content)

The intended interface, though, is agentic: the Codex CLI (codex in your terminal) or the cloud agent wired to a GitHub repo, where it opens a PR rather than chatting at you. That’s where it earns its keep.

Practitioner aside. The failure mode nobody warns you about is review fatigue, not bugs. GPT-5 Codex hands you a 400-line diff that looks right; skimming it is how “it passed CI” becomes an incident. Budget real review time, or don’t bother running it.

Benchmarks snapshot

Approximate as of Nov 2026; from public reporting and launch materials:

  • SWE-bench Verified ~78 · Aider Polyglot ~80+ (per PeaBox atlas data)
  • OpenAI launch materials put SWE-bench Verified in the mid-to-high 70s (approx.)
  • LiveCodeBench ~80 (approx., commonly reported)

How it stacks up

vs Claude Sonnet 4.5. Sonnet 4.5 is the serious-work default of 2026 and a ferocious coder in interactive settings — better “feel” in the editor, near-Opus quality at $3/$15. Codex is stronger when you want full autonomy over a long run — fire-and-review rather than pair-program. Interactive session? Sonnet. Batch of well-scoped tickets? Codex.

vs Devstral 2. Devstral 2 (123B) is the open-weights agentic answer — ~72 SWE-bench, Apache-adjacent MNPL license, self-hostable for near-zero marginal cost at scale. Codex costs more per task but ships with OpenAI-grade tooling, SLAs and zero infra. “Run it on a rented GPU” vs “just works” — pick your poison.

PeaBox fit

GPT-5 Codex pairs naturally with CodeProof-AI: let Codex write the diff, then let CodeProof scan it for plausible-looking disasters before merge — different tools, same blind spot removed. The PeaBox AI Workbench is where you compare Codex output against gpt-5 and Sonnet on your own repo tasks. Keep your review checklists in Prompt Library so every Codex handoff includes the same definition of done.

Figures approximate as of Nov 2026. Pricing and benchmark scores drift monthly; check the provider’s pricing page before you budget.