Back to Models

GPT-5.1-Codex-Mini is the smaller, faster, and more cost-effective member of OpenAI's GPT-5.1 Codex family β€” built specifically for quick code edits, interactive coding sessions, and cost-sensitive agentic workflows. Released on November 13, 2025 alongside GPT-5.1 and GPT-5.1-Codex, it shares the same 400K context window and 128K max output as its siblings but at roughly one-fifth the price: $0.25/M input tokens and $2/M output tokens.

Like all Codex-family models, GPT-5.1-Codex-Mini is accessed through Codex surfaces (CLI, IDE extension, cloud sandbox, code review) or via the OpenAI API. It supports the same parameter set as GPT-5.1-Codex β€” temperature, max_tokens, tools, tool_choice, response_format, reasoning, stop β€” including adaptive reasoning effort with 'none' through 'high' levels. From a TheRouter operator's perspective, the model is listed as active and reachable through the standard /v1/chat/completions endpoint at the attractive $0.25/$2 price point.

Use GPT-5.1-Codex-Mini when you need fast, cost-effective coding assistance for interactive editing, quick PR reviews, or lightweight agentic tasks that don't require the frontier reasoning of GPT-5.1-Codex or GPT-5.1-Codex-Max. For long-running autonomous coding sessions (24+ hours), front-end GPT-5.1-Codex-Max is the better choice; for general reasoning and chat, route to openai/gpt-5.1.

Best for
  • β€’ Interactive and latency-sensitive coding β€” sub-second responses at $0.25/M in, $2/M out; ideal for quick edits, code completions, and inline chat in the IDE
  • β€’ Cost-sensitive agentic coding β€” achieve real savings on bulk PR reviews, multi-file edits, and automated codefixes where Codex-Max would be overkill
  • β€’ Codex-compatible toolchain automation β€” works in the same Codex CLI, IDE extension, and cloud sandbox as the larger Codex models, with full tool/function calling support
  • β€’ GitHub Copilot integration β€” available in Copilot Pro/Pro+/Business/Enterprise as a selectable model for chat, ask, edit, and agent modes
Reach for something else if
  • β€’ Long-running autonomous coding sessions (24+ hours) β€” GPT-5.1-Codex-Max at $1.25/M in / $10/M out has native compaction for multi-window context; Codex-Mini cannot sustain sessions of that length
  • β€’ Frontier SWE-bench workloads β€” Codex-Mini has not published official SWE-bench scores; route to Codex-Max or GPT-5.2-Codex for benchmark-chasing tasks
  • β€’ General reasoning and non-coding chat β€” GPT-5.1 (openai/gpt-5.1) is better suited at the same mini price point; Codex models are optimized for coding workflows
  • β€’ Heavy tool-calling with complex structured outputs β€” GPT-5.1-Codex or GPT-5.1-Codex-Max handle more complex multi-tool orchestration; Codex-Mini is best for simpler agentic patterns
Context Length
400K
Max Output
128K
Input Priceper 1M tokens
$0.270/ 1M tokens
Output Priceper 1M tokens
$2.16/ 1M tokens

Modalities

textimage→text

Capabilities

Vision

Pricing Breakdown

TypeRate
Input$0.270 / 1M tokens
Output$2.16 / 1M tokens

Supported Parameters

temperaturemax_tokenstop_ptoolstool_choiceresponse_formatreasoningstop

Specifications

Release date2025-11-13openai.com β†—verified
OpenAI API model idgpt-5.1-codex-miniopenai.com β†—verified
Model typeCost-effective agentic coding model β€” smaller, faster variant of GPT-5.1-Codex optimized for interactive editing and lightweight coding automationopenai.com β†—verified
Reasoning effort levelsSupports 'none', 'low', 'medium', 'high' reasoning effort via reasoning_effort parameter; defaults to 'none' for lowest latencyopenai.com β†—verified
Input modalitiesText, Image (vision)openai.com β†—verified
LicenseProprietary (OpenAI API terms of service / ChatGPT subscription)verified

Benchmarks

BenchmarkDistributionScoreSource
SWE-bench Verified
OpenAI has not published SWE-bench scores for GPT-5.1-Codex-Mini. The model is positioned as a cost-effective coding companion, not a benchmark-chasing frontier model. For SWE-bench performance, use GPT-5.1-Codex-Max (77.9%) or GPT-5.2-Codex.
β€”Not publicly disclosedβ€”

API Usage Examples

Use the global api.therouter.ai endpoint shown below for new integrations; the legacy China accelerated endpoint is retired.

cURL
curl https://api.therouter.ai/v1/chat/completions   -H "Content-Type: application/json"   -H "Authorization: Bearer $THE_ROUTER_API_KEY"   -d '{
    "model": "openai/gpt-5.1-codex-mini",
    "messages": [
      {"role": "user", "content": "Summarize the key points from this input."}
    ]
  }'

Chat completion

GPT-5.1-Codex-Mini uses the standard chat completions endpoint. For best latency in interactive coding tasks, set reasoning_effort to 'none' (default) or 'low'. For more complex coding tasks, 'medium' provides a good balance of accuracy and speed.

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-5.1-codex-mini","messages":[{"role":"user","content":"Write a function to merge two sorted arrays in TypeScript"}],"reasoning_effort":"low"}'

More from openai

Similar models

Cross-provider sibling models

News & changes

2025-11-13

OpenAI releases GPT-5.1, GPT-5.1-Codex, and GPT-5.1-Codex-Mini for developers

OpenAI announced GPT-5.1 in the API platform, alongside the Codex-family models gpt-5.1-codex and gpt-5.1-codex-mini. GPT-5.1 introduces adaptive reasoning (including 'none' mode), extended prompt caching for 24 hours, and new apply_patch and shell tools for coding. GPT-5.1-Codex-Mini is positioned as the cost-effective coding companion at $0.25/M in tokens.

re-authored by TheRouteropenai.com β†—
2025-11-13

GPT-5.1-Codex-Mini available in GitHub Copilot public preview

GitHub rolled out GPT-5.1, GPT-5.1-Codex, and GPT-5.1-Codex-Mini in Copilot public preview for Pro, Pro+, Business, and Enterprise users. Codex-Mini was made available in VS Code, JetBrains, Xcode, Eclipse, and Copilot CLI across all modes (chat, ask, edit, agent).

re-authored by TheRoutergithub.blog β†—
2026-03-11

GPT-5.1 models retired from ChatGPT (API unaffected)

OpenAI retired GPT-5.1 Instant, GPT-5.1 Thinking, and GPT-5.1 Pro from ChatGPT on March 11, 2026. The gpt-5.1-codex-mini API model id was not affected β€” the model remains accessible via the OpenAI API and through TheRouter at api.therouter.ai.

re-authored by TheRouterhelp.openai.com β†—

Frequently asked

How is GPT-5.1-Codex-Mini different from GPT-5.1-Codex?

GPT-5.1-Codex-Mini is a smaller, faster, and significantly more cost-effective version of GPT-5.1-Codex. It is priced at $0.25/M input and $2/M output tokens β€” roughly one-fifth the cost of GPT-5.1-Codex ($1.25/$10). It shares the same 400K context window, 128K max output, and full parameter set (tools, reasoning_effort, JSON mode). The trade-off is reduced benchmark performance: Mini is designed for quick, interactive coding tasks rather than frontier-level autonomous agentic coding. For 24+ hour coding sessions and compaction, use GPT-5.1-Codex-Max.

Does GPT-5.1-Codex-Mini support compaction or multi-window context?

No. Compaction (native multi-window context management) is a feature exclusive to GPT-5.1-Codex-Max. Codex-Mini operates within a single 400K context window. For long-running autonomous sessions that require compaction, route to openai/gpt-5.1-codex-max via TheRouter.

Can I use GPT-5.1-Codex-Mini for non-coding tasks?

Technically yes, but OpenAI recommends using Codex-family models exclusively for coding and agentic development workflows. For general reasoning, chat, or non-coding tasks, route to openai/gpt-5.1 (general-purpose GPT-5.1) or openai/gpt-5-mini (budget option) via TheRouter for better results.

What reasoning effort should I use for GPT-5.1-Codex-Mini?

For fastest interactive coding in the IDE, use reasoning_effort='none' (default). For simple code generation, fix, or review tasks, use 'low'. For debugging, code review, or multi-step refactoring, use 'medium'. The model does not support 'xhigh' β€” that is exclusive to GPT-5.1-Codex-Max.

Fact ledger β€” every claim on this page traces here
sourceURLretrieved
Release dateopenai.com β†—2026-05-28verified
OpenAI API model idopenai.com β†—2026-05-28verified
Model typeopenai.com β†—2026-05-28verified
Reasoning effort levelsopenai.com β†—2026-05-28verified
Input modalitiesopenai.com β†—2026-05-28verified
Licenseβ€”β€”verified
SWE-bench Verifiedopenai.com β†—2026-05-28unknown
OpenAI releases GPT-5.1, GPT-5.1-Codex, and GPT-5.1-Codex-Mini for developersopenai.com β†—2026-05-28verified
GPT-5.1-Codex-Mini available in GitHub Copilot public previewgithub.blog β†—2026-05-28verified
GPT-5.1 models retired from ChatGPT (API unaffected)help.openai.com β†—2026-05-28verified
How is GPT-5.1-Codex-Mini different from GPT-5.1-Codex?openai.com β†—2026-05-28to verify
Does GPT-5.1-Codex-Mini support compaction or multi-window context?openai.com β†—2026-05-28to verify
Can I use GPT-5.1-Codex-Mini for non-coding tasks?openai.com β†—2026-05-28to verify
What reasoning effort should I use for GPT-5.1-Codex-Mini?openai.com β†—2026-05-28to verify
Help & contact