GPT-5.2-Codex

openai/gpt-5.2-codex
VisionToolsJSONReasoning
by OpenAI · 2026-01-14

GPT-5.2-Codex is an upgraded version of GPT-5.1-Codex 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 TTFT625 ms
INPUT$1.75/ 1M tokens
OUTPUT$14.00/ 1M tokens
p50 TTFT625 ms7d
p95 TTFT2.00 s7d
TRAFFIC655.9Ktokens / 7d

OpenAI GPT-5.2-Codex is a variant of the GPT-5.2 model that has been fine-tuned for code-centric tasks. It supports text and image inputs, processes up to 400,000 tokens of context, and can generate…

What is OpenAI GPT-5.2-Codex?

Who is this model designed for?

How does GPT-5.2-Codex fit into OpenAI's lineup?

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.2-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.75
Output / 1M tokens$14.00
Cache read / 1M$0.175
CurrencyUSD

Cost calculator

Tokens / month10MM
Input share70%%
Estimated / month $54.25 · With prompt caching $48.74

Estimate based on list price

Token & cost estimator

Input tokens: 20Cost per request: $0.007035

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

Performance

p50 TTFT
625 ms
Output speed
74.9 tok/s
p95 TTFT
2.00 s
Error rate
0%

Public benchmarks

43.0
AA Coding
Better than 55% of models compared
#48 of 106
49.0
AA Intelligence
Better than 65% of models compared
#39 of 110
GPQA Diamond
89.9
Humanity's Last Exam
33.5
IFBench
77.6
Long-Context Recall
75.7
SciCode
54.6
TerminalBench Hard
37.1
τ²-Bench
92.1
Source: artificialanalysis.ai

How it compares

GPT-5.2-CodexGPT-5.2 ProGPT-5.4 ProGPT-5.5
Input $/M$1.75$21.00$60.00$5.00
Output $/M$14.00$168.00$270.00$30.00
Context400K400K1.1M
Quality8/1010/1010/1010/10
Compare side-by-sideCompare side-by-sideCompare side-by-sideCompare side-by-side

FAQ

What is the cost of using GPT-5.2-Codex via OrcaRouter?
Input tokens cost $1.75 per 1 million tokens, and output tokens cost $14.00 per 1 million tokens. These are provider rates with zero markup from OrcaRouter. No additional fees apply.
What context window does GPT-5.2-Codex support?
It supports a context window of 400,000 tokens, with a maximum output of 128,000 tokens. This allows processing of very long codebases or documents in a single request.
What are the main strengths of GPT-5.2-Codex?
The model achieves a score of 92.1 on τ²-Bench, indicating strong code generation and debugging abilities. Its large context and image input support are key strengths for software engineering tasks.
How does GPT-5.2-Codex compare to other code models?
Compared to GPT-4o-Code and Claude Codex, GPT-5.2-Codex offers a larger context window (400K) and higher output limit (128K). Benchmark comparisons are limited, but the τ²-Bench score of 92.1 suggests strong performance.
How does OrcaRouter handle data when using this model?
OrcaRouter acts as a proxy and does not modify or store your data beyond what is necessary for API operations. Data is passed through to OpenAI's servers for inference. Refer to OrcaRouter's privacy policy for details.
How do I call GPT-5.2-Codex via OrcaRouter's API?
Use the base URL https://api.orcarouter.ai/v1 and set the model parameter to "openai/gpt-5.2-codex" in your chat completions request. The API is fully compatible with OpenAI's client libraries.
Can I use GPT-5.2-Codex for non-code tasks?
Yes, but the model is fine-tuned for code and may not be as effective for general tasks. For non-code use, consider a cheaper general-purpose model available on OrcaRouter.
Is GPT-5.2-Codex suitable for real-time applications?
Due to its size and large context, it may have higher latency than smaller models. For real-time use, consider using streaming or limiting context length to reduce response time.
What are the limitations of GPT-5.2-Codex?
Like all LLMs, it can generate incorrect or insecure code and may hallucinate functions. It is also more expensive per output token than smaller models, and its large context requires careful prompt design.
Does GPT-5.2-Codex support image inputs?
Yes, it accepts both text and image inputs. Images are processed as tokens and count against the context window. Use the standard OpenAI vision format to include images in your requests.

Embed this badge

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

Model card as data

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