Bonus: Top up now and we'll double your first deposit — get x2 credits instantly.

GPT-5.1 Codex Mini API: Endpoint & Pricing

Deprecated 23 Jul 2026

GPT-5.1-Codex-Mini is an OpenAI code-focused model variant optimized for lightweight, fast software development assistance.

What is GPT-5.1-Codex-Mini?

GPT-5.1-Codex-Mini is a compact OpenAI model specialized for programming and code-centric tasks. It is mainly used for generating and refactoring code, writing small utilities or scripts, and assisting with algorithmic implementations across common programming languages. It is also suited for inline code assistance in IDEs or lightweight developer tools where latency and efficiency matter. It belongs to the Codex-style family of OpenAI models derived from general-purpose GPT systems and adapted for software development workloads.


Can you self-host GPT-5.1-Codex-Mini?

No. We found no public weights for GPT-5.1-Codex-Mini on Hugging Face, so there is nothing to download, quantize or serve on your own GPUs: no VRAM budget, no vLLM or GGUF build to plan for. The only way to run it is over an API.

Skip the deploy — use LLM.API as your endpoint

No GPUs, no quantization trade-offs. Same model, OpenAI-compatible, up to 30% below list price.

Providers

Different companies host the same model. OpenRouter routes your request to one of them based on the routing mode you pick — Balanced (price + speed), Nitro (fastest), or Exacto (highest tool-calling accuracy).

List price by provider

InputOutput
azure$0.25 in
$2 out

Provider list prices; the LLM.API discount applies on top.

Provider Input Output Cache read /M Latency Throughput Uptime
azurein $0.25; out $2 per 1M tokens400K tokensvision, tools, streaming, reasoning, web search, JSON, structured

Prices and availability from the LLMAPI catalogue, updated nightly. Last updated 11 Oct 2026.

Try this model

Test GPT-5.1-Codex-Mini right here — free to start.

GPT-5.1-Codex-Mini
Hi! Want to test the model?

Suggestions for your first prompt

Code snippet

Call the model through the OpenAI-compatible API.

Switching from OpenAI? Change 2 lines.

- base_url="https://api.openai.com/v1"
- api_key="YOUR_OPENAI_KEY"
+ base_url="https://api.llmapi.ai/v1"
+ api_key="YOUR_LLMAPI_KEY"

Everything else stays the same — SDK, message format, tools, streaming. Set model to gpt-5.1-codex-mini and the call runs unchanged.

bash
curl https://api.llmapi.ai/v1/chat/completions \
  -H "Authorization: Bearer $LLMAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.1-codex-mini",
    "messages": [
      {"role": "user", "content": "Give me three crisp launch checklist items."}
    ],
  "reasoning_effort": "none"
  }'
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_LLMAPI_KEY",
    base_url="https://api.llmapi.ai/v1",
)

resp = client.chat.completions.create(
    model="gpt-5.1-codex-mini",
    messages=[
        {"role": "system", "content": "You are a precise product assistant."},
        {"role": "user", "content": "Give me three crisp launch checklist items."},
    ],
    reasoning_effort="none",
)
print(resp.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.LLMAPI_KEY,
  baseURL: "https://api.llmapi.ai/v1",
});

const resp = await client.chat.completions.create({
  model: "gpt-5.1-codex-mini",
  messages: [
    { role: "user", content: "Give me three crisp launch checklist items." },
  ],
});

console.log(resp.choices[0].message.content);
stream = client.chat.completions.create(
    model="gpt-5.1-codex-mini",
    messages=[{"role": "user", "content": "Write a haiku about latency."}],
    stream=True,
)

for chunk in stream:
    delta = chunk.choices[0].delta.content
    if delta:
        print(delta, end="", flush=True)
{
  "model": "gpt-5.1-codex-mini",
  "messages": [
    {"role": "system", "content": "You are a precise product assistant."},
    {"role": "user", "content": "Give me three crisp launch checklist items."}
  ],
  "reasoning_effort": "none"
}

Supported endpoints & features

Base URL https://api.llmapi.ai/v1 · model ID gpt-5.1-codex-mini · OpenAI-compatible.

  • POST /v1/chat/completionsChat Completions — supported
FeatureStatusHow to set it
Function calling (tools)Supportedtools, tool_choice
Parallel tool callsNot supportedparallel_tool_calls
JSON modeSupportedresponse_format: {"type": "json_object"}
Structured outputsSupportedresponse_format: {"type": "json_schema", …}
StreamingSupportedstream: true
Vision (image input)Supportedimage_url content parts
Web searchSupportedweb_search
Reasoning effortnone · low · medium · highreasoning_effort: "none"

Errors & fallback routing

CodeWhat it meansWhat to do
401Missing or invalid API key.Send Authorization: Bearer YOUR_LLMAPI_KEY and check the key is active.
429Rate limited, or the upstream provider is throttling the request.Back off and retry with jitter; the gateway also retries the request on another provider where one is available.
5xxUpstream provider error or timeout.Retry; fallback routing sends the retry to the next healthy provider for this model.

When a provider fails or throttles, the request is routed to the next provider serving this model — the ones listed in the providers table above.

Uptime

30-Day Uptime
96.70%
Past Incidents (30d)
3
Error rate (24h)
9.27%

Last 30 days

26/30 days operational | 96.70% uptime

30 days ago Today
Operational Degraded Outage Maintenance
See All Incidents

GPT-5.1 Codex Mini in production

What the model is good at.

  • Conversational Chat

    Engages in multi-turn English conversations, following instructions, asking clarifying questions, and maintaining context over extended dialogues.

  • Code Generation

    Writes and completes code snippets or small programs in popular languages based on natural language specifications and examples.

  • Text Translation

    Translates between major natural languages, preserving meaning and tone while following instructions to always answer in English.

  • Image Understanding

    Interprets images by identifying objects, text, and relationships, and answers questions about visual content described in prompts.

  • Visual OCR

    Extracts readable text content from images of documents, signs, or screens, enabling downstream search, editing, or analysis.

What you get when you call GPT-5.1 Codex Mini through LLM.API.

  • Unified AI Routing

    Define intent once and let LLM.API automatically route to the best model across providers based on latency, cost, and performance—no client changes required.

    One endpoint, any model
  • Smart Cost Controls

    Mix premium and budget models behind one API, enforce spend guardrails, and dynamically down-tier requests so you never blow your inference budget again.

    Optimize every token
  • Automatic Fallback Logic

    Survive provider outages and rate limits with built-in retries and cross-vendor failover, keeping your AI workflows up without brittle custom logic.

    Resilient by default
  • Deep Observability

    Trace every request across providers with logs, metrics, and structured events so you can debug failures, tune prompts, and prove reliability to stakeholders.

    See every token
  • Task-Level Orchestration

    Model your AI work as tasks—classification, extraction, generation—and let LLM.API pick the right tools, prompts, and models for each step automatically.

    Tasks, not raw calls
  • High-Throughput Batch

    Ship millions of inferences via a single batch job with parallel execution, retry semantics, and cost-efficient pricing tuned for large-scale workloads.

    Scale without throttling

When to Use — When NOT to Use

Use it if...

  • You need a lightweight model to write, refactor, or document small code snippets.
  • You need inexpensive code completion for editors, CLIs, or quick prototyping tools.
  • Your use case involves generating simple utility scripts or glue code between APIs.
  • Your use case involves adding inline comments or docstrings to existing codebases.
  • You need fast iterations on small coding tasks where perfect reasoning is unnecessary.
  • Your use case involves teaching basic programming concepts with short, focused examples.

Avoid if...

  • You need state-of-the-art performance on complex multi-file software design and architecture decisions.
  • Your workload requires deep algorithmic reasoning, proofs, or highly optimized low-level systems code.
  • You need reliable handling of very long context windows containing large codebases or logs.
  • Your workload requires advanced non-coding capabilities like image understanding or multimodal reasoning.
  • You need the strongest available security, privacy, and compliance guarantees for sensitive code.
  • Your workload requires precise natural-language reasoning beyond simple explanations or code-related Q&A.

LLM API rating for GPT-5.1 Codex Mini

★ 2.7/ 5.0LLM API rating
50% production adoption · 30% category benchmark · 20% tooling & value
✓ Verified benchmark · Artificial Analysis
2.5Production adoptionNot yet tracked — no public usage data for this release
2.2Benchmark qualityArtificial Analysis Intelligence Index 20.4
4.1Developer ecosystemContext window, tool and JSON support, price against the category median
Reasoning & chat 2.7Coding 2.7Vision & multimodal 3.1Tool & function calling 4.5Long context 4.2
How is this rating calculated?

Every model gets a separate 1.0–5.0 score for each category it can be used in, so a model can rate high for coding and lower for vision. The score combines three parts:

  1. Production adoption — 50%. How widely the model is actually used in production: provider traffic, LiteLLM and gateway usage, open-weight downloads and its LMArena rank. Proven, widely used models score highest.
  2. Category benchmark — 30%. The public benchmark that matters for that category — the Artificial Analysis Intelligence Index and LMArena Elo for reasoning, LMArena coding Elo for coding, image and document support plus vision Elo for vision, tool and JSON support for function calling, measured speed for voice.
  3. Tooling & value — 20%. Context window, support for tools, structured outputs and streaming, and price compared with the category median.

Scores of 4.0 and above are shown in green, 3.0–3.9 in yellow, below 3.0 in red. When a model has no public data for a part, it gets a neutral value instead of an invented number.

A “Verified benchmark” mark (✓) means an independent lab — LMArena or Artificial Analysis — has actually tested that model, and the source figure is shown. Models without that mark are labelled “Estimated from published specs”: the score comes from the published context window, tool and schema support, price and adoption only, because no independent lab has tested them yet.

One exception: a brand-new top-tier model that scores very high on the independent benchmarks but has no usage history yet is rated on the benchmark (60%) and tooling & value (40%) alone, so a missing adoption figure can't hold it back. All inputs come from public sources and are refreshed weekly.

Adoption and benchmark inputs come from public sources — LMArena, Artificial Analysis Intelligence Index and published model specs. Updated weekly.

What developers say about GPT-5.1-Codex-Mini

LMArena—Speed—Sources: LMArena, Artificial Analysis

Summarised from public developer discussions and write-ups. Opinions are the sources’, not LLM.API’s.

  • Developers on GitHub indicate that GPT-5.1-Codex-Mini is optimized for codex environments, being faster and more cost-effective than flagship versions but providing lower overall capability for complex reasoning.
  • Developers in technical discussions report that the model is well-suited for high-volume tasks like automated code review and routine programming where budget efficiency is prioritized over frontier performance.
  • Developers on GitHub have noted that while the model is excellent for tool-calling, it may lack the 'agentic' autonomy of larger models, sometimes stopping to ask for user direction.

Frequently Asked Questions

  • What is GPT-5.1-Codex-Mini?

    GPT-5.1-Codex-Mini is a lightweight OpenAI code-focused language model optimized for fast, low-cost software development and automation workloads.

  • What is GPT-5.1-Codex-Mini best suited for?

    It excels at code generation, refactoring, debugging, writing tests, and explaining source code across popular programming languages and frameworks.

  • What is the context window of GPT-5.1-Codex-Mini?

    GPT-5.1-Codex-Mini supports a 32K token context window, allowing it to handle large files or multi-file code snippets in a single request.

  • How fast is GPT-5.1-Codex-Mini in terms of latency?

    As a mini variant, it is tuned for low latency responses, making it suitable for interactive coding tools and real-time developer assistants.

  • What modalities does GPT-5.1-Codex-Mini support?

    GPT-5.1-Codex-Mini supports text-only inputs and outputs, focusing specifically on natural language and source code rather than images or audio.

  • How is GPT-5.1-Codex-Mini priced on LLM.API?

    LLM.API exposes GPT-5.1-Codex-Mini with per-token pricing; check your LLM.API dashboard or pricing docs for current input and output rates.

  • How do I call GPT-5.1-Codex-Mini through LLM.API?

    Use the LLM.API completion or chat endpoint, specifying the provider as OpenAI and the model identifier GPT-5.1-Codex-Mini in your request payload.

  • How does GPT-5.1-Codex-Mini compare to larger GPT-5.1 models?

    Compared to larger GPT-5.1 variants, Codex-Mini trades some reasoning depth for significantly lower cost and faster responses on typical coding tasks.

  • Does GPT-5.1-Codex-Mini have any notable limitations?

    It can hallucinate APIs, produce insecure patterns, or misunderstand incomplete specs, so you must review, test, and secure all generated code.

  • Can GPT-5.1-Codex-Mini handle long multi-step coding instructions?

    It handles moderately long, structured instructions well, but extremely complex multi-step projects may require chunking tasks across several calls.

Get one key to every model

Swap your API key. Keep your code.