GPT-5 Codex

openai/gpt-5-codex
VisionToolsJSONReasoning
by OpenAI · 2025-09-23

GPT-5-Codex is a specialized version of GPT-5 optimized for software engineering and coding workflows. It is designed for both interactive development sessions and long, independent execution of complex engineering tasks....

ctx400K tokens
Max output128K
Inputtext + image
Outputtext
p50 TTFT4.14 s
INPUT$1.25/ 1M tokens
OUTPUT$10.00/ 1M tokens
p50 TTFT4.14 s7d
p95 TTFT4.14 s7d
TRAFFIC32.4Ktokens / 7d

OpenAI GPT-5 Codex is a large language model from OpenAI that specializes in code generation and mathematical reasoning. It is an evolution of the Codex family, designed to handle complex programming…

What is OpenAI GPT-5 Codex?

Who should use GPT-5 Codex?

What makes GPT-5 Codex different from earlier Codex models?

How does the 400K token context window benefit users?

Code samples

Call from any SDK

OpenAI-compatible — keep the SDK you already use

  • OpenAI SDKhttps://api.orcarouter.ai/v1
from openai import OpenAI

client = OpenAI(
    base_url="https://api.orcarouter.ai/v1",
    api_key="$ORCAROUTER_API_KEY",
)

response = client.chat.completions.create(
    model="openai/gpt-5-codex",
    messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)

Supported parameters

  • include_reasoning
  • max_completion_tokens
  • max_tokens
  • reasoning
  • response_format
  • seed
  • stream
  • structured_outputs
  • tool_choice
  • tools

Pricing

Input / 1M tokens$1.25
Output / 1M tokens$10.00
Cache read / 1M$0.125
CurrencyUSD

Cost calculator

Tokens / month10MM
Input share70%%
Estimated / month $38.75 · With prompt caching $34.81

Estimate based on list price

Token & cost estimator

Input tokens: 20Cost per request: $0.005025

Estimate only — actual token counts depend on the provider's tokenizer.

Performance

p50 TTFT
4.14 s
Output speed
162 tok/s
p95 TTFT
4.14 s
Error rate
0%

Public benchmarks

38.9
AA Coding
Better than 42% of models compared
#71 of 123
36.1
AA Intelligence
Better than 53% of models compared
#59 of 125
98.7
AA Math
Better than 95% of models compared
#4 of 81
AIME 2025
98.7
GPQA Diamond
83.7
Humanity's Last Exam
25.6
IFBench
74.1
LiveCodeBench
84.0
Long-Context Recall
69.0
MMLU-Pro
86.5
SciCode
40.9
TerminalBench Hard
37.9
τ²-Bench
86.8
Source: artificialanalysis.ai

How it compares

GPT-5 CodexGPT-5.2 ProGPT-5.4 ProGPT-5.5
Input $/M$1.25$21.00$60.00$5.00
Output $/M$10.00$168.00$270.00$30.00
Context400K400K1.1M
Quality7/1010/1010/1010/10
Compare side-by-sideCompare side-by-sideCompare side-by-sideCompare side-by-side

FAQ

What is the cost per token for GPT-5 Codex?
Input tokens are $1.25 per 1M tokens; output tokens are $10.00 per 1M tokens. Billed at provider rate with zero markup through OrcaRouter.
What is the context window size?
The context window is 400,000 tokens, which includes both input and generated output.
What are the key strengths of GPT-5 Codex?
Large 400K context, 128K output limit, multimodal (text and image), and a 98.7 score on the AA Math benchmark.
How does GPT-5 Codex compare to GPT-4?
It has a larger context window (400K vs. 128K), higher output limit (128K vs. up to 16K), supports image input, and scores higher on AA Math. It is also more expensive.
Can I use images as input?
Yes, input modalities include text and image. Images are tokenized and count toward the input token limit.
How do I call GPT-5 Codex through OrcaRouter?
Use the OpenAI-compatible API at https://api.orcarouter.ai/v1 with model ID "openai/gpt-5-codex". Authenticate with your OrcaRouter API key.
Does OrcaRouter add any markup to the price?
No, OrcaRouter bills at the provider rate with zero markup. You pay exactly $1.25/input and $10/output per 1M tokens.
What is the maximum output length?
The maximum output is 128,000 tokens per completion.
Is my data handled securely?
Data handling follows OpenAI’s policy as the provider. OrcaRouter routes requests to the provider. Review OrcaRouter's privacy policy for details.
What is the AA Math benchmark?
AA Math is an advanced algebra benchmark. GPT-5 Codex achieved a score of 98.7, indicating near-perfect performance on that set of problems.

Embed this badge

OpenAI: GPT-5 Codex$1.25/M in4139ms p50via OrcaRouter
HTML <a href="https://www.orcarouter.ai/models/openai/gpt-5-codex" target="_blank"> <img src="https://www.orcarouter.ai/embed/openai/gpt-5-codex.svg" alt="OpenAI: GPT-5 Codex on OrcaRouter" /> </a>
Markdown [![OpenAI: GPT-5 Codex](https://www.orcarouter.ai/embed/openai/gpt-5-codex.svg)](https://www.orcarouter.ai/models/openai/gpt-5-codex)

Model card as data

GET /api/public/models/openai/gpt-5-codexOpen
Machine-readable:/llms.txt/llms-full.txt