GPT-5.1 Codex

OpenAIMCP Tool CallReasoning
openai/gpt-5.1-codexClosed API

Codex GPT for repository edits, code review, and practical software agents

Benchmark Pricing$1.25 / 1M in$10.00 / 1M out$0.13 cache read
Context: 400,000 tokens•Max Output: 128,000 tokens•Knowledge: 2024-09-30•Released: 2025-11-13

TECHNICAL SPECIFICATIONS

Context Window400,000400K tokens
Max Output128,000128K tokens
LicenseProprietaryCloud API only
Input Modalities
TextVision
Function / Tool CallingSupported (MCP Ready)
Structured OutputsGuaranteed Schema

MODEL CONTEXT PROTOCOL (MCP) READINESS

✓ GPT-5.1 Codex natively supports OpenAI / Anthropic format tool calling and is fully compatible with MCP servers and agent loops.

MCP Context Window Recommendations

With a context capacity of 400,000 tokens, this model can handle moderately large MCP tool definitions and multi-turn conversation logs comfortably.

API CALL INVOCATION EXAMPLE

// Example: Calling GPT-5.1 Codex via OpenAI SDK
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.OPENAI_API_KEY,
});

const response = await client.chat.completions.create({
  model: "openai/gpt-5.1-codex",
  messages: [{ role: "user", content: "Hello! Can you inspect MCP tools?" }],
});

console.log(response.choices[0].message.content);

PRICING BY PROVIDER

15 providers
NanoGPTopenai/gpt-5.1-codex
$1.25 / $10.00$0.13 cache
Vivgridgpt-5.1-codex
$1.25 / $10.00$0.13 cache
LLM Gatewayazure/gpt-5.1-codex
$1.25 / $10.00
Poeopenai/gpt-5.1-codex
$1.10 / $9.00$0.11 cache
AI/ML APIopenai/gpt-5.1-codex-max
$3.44 / $27.51$0.34 cache
AIHubMixgpt-5.1-codex
$1.25 / $10.00$0.13 cache
Abacusgpt-5.1-codex
$1.25 / $10.00$0.13 cache
Vercel AI Gatewayopenai/gpt-5.1-codex
$1.25 / $10.00$0.13 cache
OpenCodegpt-5.1-codex
$1.07 / $8.50$0.11 cache
Eden AIazure/gpt-5.1-codex
$1.25 / $10.00$0.13 cache
Ofoxopenai/gpt-5.1-codex-max
$1.25 / $10.00$0.13 cache
Azure Cognitive Servicesgpt-5.1-codex
$1.25 / $10.00$0.13 cache
Kilo Gatewayopenai/gpt-5.1-codex
$1.25 / $10.00$0.13 cache
ZenMuxopenai/gpt-5.1-codex
$1.25 / $10.00$0.13 cache
DevPass (LLM Gateway)gpt-5.1-codex
$1.25 / $10.00$0.13 cache

Rates in USD per 1M tokens. Rates synchronized from models.dev public catalog.

Prompt Caching Active

This model supports prompt caching at $0.13 / 1M tokens, saving up to 90% on repetitive MCP tool definitions and system instructions.

MODEL RESOURCES