GPT-5.1 Codex Max

Models

Model details

Model
gpt-5.1-codex-max
Provider
openai
API
openai-responses
Base URL
https://api.openai.com/v1
Input
text, image
Reasoning
Yes
Context window
400,000
Max tokens
128,000
Show configuration
{
  "providers": {
    "openai": {
      "apiKey": "YOUR_API_KEY",
      "models": [
        {
          "id": "gpt-5.1-codex-max",
          "name": "GPT-5.1 Codex Max",
          "reasoning": true,
          "input": [
            "text",
            "image"
          ],
          "thinkingLevelMap": {
            "off": null
          },
          "contextWindow": 400000,
          "maxTokens": 128000,
          "cost": {
            "input": 1.25,
            "output": 10,
            "cacheRead": 0.125,
            "cacheWrite": 0
          }
        }
      ],
      "api": "openai-responses",
      "baseUrl": "https://api.openai.com/v1"
    }
  }
}

Pricing

USD per million tokens. A tier is selected from the total input tokens in each request and applies to that entire request.

Pricing rates for GPT-5.1 Codex Max
Request inputInputOutputCache readCache write
All requests$1.25$10$0.125$0

Session cost calculator

Estimate the requests made during an agent session. A user turn can make several model calls while using tools, so costs are calculated per model request.

Session shape
Rounded median shapes from recent Pi agent sessions.
Warm-request cache reuse
Effective token reuse combines partial hits and occasional complete misses.
Estimated session$0.00
Uncached input
Cache reads
Uncached prefixes
Cache writes
Output
Without caching

The first request starts cold unless marked otherwise. Output is billed separately from context growth because reasoning tokens are not always retained. This remains a directional estimate: providers differ in eligibility, rounding, and retention.

Compatibility flags

Effective values after applying Pi's API defaults and model overrides.

Effective compatibility flags for GPT-5.1 Codex Max
FeatureValue
supportsDeveloperRoleYes
sendSessionIdHeaderYes
supportsLongCacheRetentionYes