GPT-5.1-Codex-Mini is a smaller and faster version of GPT-5.1-Codex
Modalities
Input Price
$0.25per 1M
Output Price
$2per 1M
Context
400K
Weekly Tokens
3.86B
Released
Nov 13, 2025
Create an API key from your OpenRouter dashboard and set it as an environment variable:
Use openai/gpt-5.1-codex-mini with the OpenRouter API:
OpenRouter provides an OpenAI-compatible completion API to 400+ models & providers that you can call directly, or using the OpenAI SDK. Additionally, some third-party SDKs are available.
In the examples below, the OpenRouter-specific headers are optional. Setting them allows your app to appear on the OpenRouter leaderboards.
For information about using third-party SDKs and frameworks with OpenRouter, please see our frameworks documentation.
Add "stream": true to your request body to receive responses as server-sent events:
https://openrouter.ai/api/v1/chat/completionsBearer $OPENROUTER_API_KEYapplication/jsonoptional — your site URL, for rankingsoptional — your site name, for rankingsopenai/gpt-5.1-codex-mini| Name | Type | Default | Description |
|---|---|---|---|
reasoning | map | — | Controls reasoning behavior for models that support thinking tokens, including whether reasoning is enabled, the reasoning effort, maximum reasoning tokens, and whether reasoning is excluded from the response. |
include_reasoning | boolean | — | Deprecated alias for reasoning.exclude. |
structured_outputs | boolean | — | If the model can return structured outputs using response_format json_schema. |
response_format | map | — | Forces the model to produce specific output format. |
seed | integer | — | If specified, the inferencing will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. |
max_tokens | integer | — | This sets the upper limit for the number of tokens the model can generate in response. |
tools | array | — | Tool calling parameter, following OpenAI's tool calling request shape. |
tool_choice | string or object | — | Controls which (if any) tool is called by the model. |