GPT-5.1-Codex

openai/gpt-5.1-codex
VisionToolsJSONReasoning
by OpenAI · 2025-11-13

GPT-5.1-Codex is a specialized version of GPT-5.1 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 TTFT361 ms
INPUT$1.25/ 1M tokens
OUTPUT$10.00/ 1M tokens
p50 TTFT361 ms7d
p95 TTFT361 ms7d
TRAFFIC11.8Ktokens / 7d

OpenAI GPT-5.1-Codex is a large language model offered by OpenAI, optimized for code generation, mathematical reasoning, and text-based problem solving. It accepts both text and image inputs,…

What is OpenAI GPT-5.1-Codex?

Who is this model designed for?

What input modalities does GPT-5.1-Codex support?

How does the model’s context window compare?

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.1-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
361 ms
Output speed
107 tok/s
p95 TTFT
361 ms
Error rate
0%

Public benchmarks

36.6
AA Coding
Better than 37% of models compared
#78 of 123
34.7
AA Intelligence
Better than 46% of models compared
#63 of 125
95.7
AA Math
Better than 93% of models compared
#5 of 81
AIME 2025
95.7
GPQA Diamond
86.0
Humanity's Last Exam
23.4
IFBench
70.0
LiveCodeBench
84.9
Long-Context Recall
67.3
MMLU-Pro
86.0
SciCode
40.2
TerminalBench Hard
34.8
τ²-Bench
83.0
Source: artificialanalysis.ai

How it compares

GPT-5.1-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 to use GPT-5.1-Codex on OrcaRouter?
Pricing is $1.25 per 1 million input tokens and $10 per 1 million output tokens, billed at the provider rate with zero markup. There are no additional platform fees.
What is the context window size?
The context window is 400,000 tokens total (input + output). The maximum output per response is 128,000 tokens.
What are the main strengths of GPT-5.1-Codex?
It excels at code generation, debugging, and mathematical reasoning (evidenced by a 95.7 AA Math benchmark score). It also supports text and image inputs and a very large context window.
How does GPT-5.1-Codex compare to GPT-4o?
GPT-5.1-Codex has a larger context window (400K vs ~128K), higher output limit (128K vs ~4K), and is specialized for code and math. GPT-4o is a general-purpose model and typically lower cost.
What data handling policies apply?
OrcaRouter acts as a proxy and does not modify data handling. Data is processed by OpenAI according to their policies. No additional data retention or training on your inputs is performed by OrcaRouter.
How do I call GPT-5.1-Codex via an OpenAI-compatible API?
Set the base URL to https://api.orcarouter.ai/v1, use model ID "openai/gpt-5.1-codex", and include your API key. Standard chat completions parameters are supported.
Can it process images?
Yes, it supports image inputs (PNG, JPEG, etc.) as part of the user message. Images are tokenized and count toward the input token limit.
Is there any discount for high volume?
The provided pricing information does not mention any volume discounts or caching programs. Contact OrcaRouter directly for enterprise options.
What are its limitations?
It may not perform as well on creative writing, general chat, or non-code tasks. It has a knowledge cutoff (exact date not provided) and can hallucinate. The output cost is eight times higher than input cost.
Is it better than open-source code models?
It offers a very large context window and high output limit, which open-source models often lack. However, open-source models may be free or cheaper, and trade-offs in quality depend on the specific task.

Embed this badge

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

Model card as data

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