Skip to content

Model detail

GPT-5.1-Codex

Provided by OpenAI
Pay-as-you-go

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. The model supports building projects from scratch, feature development, debugging, large-scale refactoring, and code review. Compared to GPT-5.1, Codex is more steerable, adheres closely to developer instructions, and produces cleaner, higher-quality code outputs. Reasoning effort can be adjusted with the `reasoning.effort` parameter. Read the [docs here](https://openrouter.ai/docs/use-cases/reasoning-tokens#reasoning-effort-level) Codex integrates into developer environments including the CLI, IDE extensions, GitHub, and cloud tasks. It adapts reasoning effort dynamically—providing fast responses for small tasks while sustaining extended multi-hour runs for large projects. The model is trained to perform structured code reviews, catching critical flaws by reasoning over dependencies and validating behavior against tests. It also supports multimodal inputs such as images or screenshots for UI development and integrates tool use for search, dependency installation, and environment setup. Codex is intended specifically for agentic coding applications.

Model specs

Model ID
gpt-5.1-codex
Context length
400K
Max output
128K
I/O modalities
Released
2025-11

02

API endpoints

One MixRoute gateway, OpenAI-compatible

  • OpenAI-compatible /v1/chat/completions POST

03

Pricing

Flat rate, unit: /1M Tokens

Input

$1.2500 /1M Tokens

Completion

$10.0000 /1M Tokens

05

Selection summary

Quickly judge whether it fits your workload

What is this model good for?

Codex model for coding and agentic tasks

GPT-5.1-Codex: GPT-5.1-Codex is a version of GPT-5 optimized for agentic coding tasks in Codex or similar environments. It's available in the Responses API only and the underlying model snapshot . 400,000-token context.

What should you check before using it?

400,000 context, 128,000 output

OpenAI model. Supports tool calling, structured outputs, function calling. Knowledge cutoff: 2024-09-30.

Why use it through MixRoute?

Drop-in via OpenAI-compatible endpoint on MixRoute

Set the model parameter to "gpt-5.1-codex" and use your MixRoute API key.

07

Capabilities & compatibility

Unconfirmed capabilities stay "Unknown," no guesses

Available:

Tool calling

GPT-5.1-Codex supports function and tool calls.

EX Send a tools definition; the response returns tool_calls to execute and feed results back.
Available:

Structured output

GPT-5.1-Codex can produce JSON-formatted output on demand.

EX response_format: { type: "json_schema" } forces valid JSON output.
Available:

Streaming

GPT-5.1-Codex supports streamed responses.

EX stream: true streams tokens incrementally, so chat UIs render as they arrive.
Available:

Prompt caching

GPT-5.1-Codex supports prompt caching under supported routing conditions.

EX Keep the system prompt and tool definitions at the start of the request; repeated prefixes are automatically billed at the cache-read rate.
Available:

Vision input

GPT-5.1-Codex can process image inputs alongside text.

EX Pass a base64-encoded image in a image_url content part alongside text messages.
Available:

OpenAI SDK

Call GPT-5.1-Codex through MixRoute's OpenAI-compatible endpoint.

EX Change base_url to https://api.mixroute.ai/v1; everything else follows the OpenAI style.

08

Token cost estimator

Live estimate from this page's pricing, not an actual bill

This model has no cache-read price; caching is not counted

09

FAQ

gpt-5.1-codex is intended for steerable coding, refactoring, code review, and interactive or independent software engineering tasks.

One endpoint, a testable decision

Test this model and alternate routes with the same request format

Start from a real workload, then let quality, total cost, and failure conditions decide whether to send production traffic.