# GPT 5.1 Codex Max

The maximum-compute variant of the GPT-5.1 codex family, built for the hardest software engineering problems where thoroughness and reasoning depth outweigh speed and cost considerations.

- **Model ID:** `openai/gpt-5.1-codex-max`
- **Type:** chat
- **Providers:** azure
- **Context window:** 400,000
- **Maximum output tokens:** 128,000
- **Pricing:** $1.25/1M input tokens, $10/1M output tokens
- **Canonical page:** https://vercel.com/ai-gateway/models/gpt-5.1-codex-max

## Supported parameters

Detailed capability metadata has not been reported for this model.

## Example

```ts
import { streamText } from 'ai'

const result = streamText({
  model: 'openai/gpt-5.1-codex-max',
  prompt: 'Why is the sky blue?'
})
```

## About

GPT 5.1 Codex Max became available on November 19, 2025 on AI Gateway as the premium tier of the GPT-5.1 codex family. It applies the maximum available compute to each request, enabling deeper reasoning and more thorough code analysis than the standard GPT-5.1 codex tier.

The additional compute translates to meaningful quality improvements on the hardest coding tasks: complex architectural decisions, cross-cutting refactors, subtle bug diagnosis, and security analysis where thoroughness is critical. On simpler tasks, the difference from standard codex may be minimal, making selective deployment the most practical pattern.

The model supports the full context window of 400K tokens and operates in the same sandboxed agentic coding environment as other codex variants, reading repositories, writing code, executing tests, and iterating. The difference is in how deeply it reasons about each step.

## What to consider

GPT 5.1 Codex Max is designed for tasks where standard codex models fall short. It applies additional computation to produce more thorough analysis and higher-quality code on genuinely difficult problems.

Most teams use codex max for their hardest tasks (security audits, architectural redesigns, complex migrations) while routing routine work to standard codex or codex mini.

## When to use

### Best For

- **Critical security audits:** Thorough analysis of codebases for vulnerabilities with maximum reasoning depth
- **Large-scale architectural redesigns:** Changes that require understanding and restructuring entire systems
- **Complex migration projects:** Converting between frameworks or architectures with many interdependencies
- **Hard debugging:** Tracing subtle, cross-cutting bugs that require extensive codebase analysis
- **Quality-critical code review:** Final review of changes where missed issues have high consequences

### Consider Alternatives When

- **Standard coding tasks:** GPT-5.1 codex handles most tasks well at lower cost
- **Simple bug fixes:** Codex mini is faster and more affordable for routine fixes
- **Non-coding analysis:** GPT-5.1 thinking for general reasoning tasks
- **Speed-sensitive workflows:** Any smaller codex variant when response time matters more than depth

## Best for

- **Critical security audits:** Thorough analysis of codebases for vulnerabilities with maximum reasoning depth
- **Large-scale architectural redesigns:** Changes that require understanding and restructuring entire systems
- **Complex migration projects:** Converting between frameworks or architectures with many interdependencies
- **Hard debugging:** Tracing subtle, cross-cutting bugs that require extensive codebase analysis
- **Quality-critical code review:** Final review of changes where missed issues have high consequences

## Consider alternatives

- **Standard coding tasks:** GPT-5.1 codex handles most tasks well at lower cost
- **Simple bug fixes:** Codex mini is faster and more affordable for routine fixes
- **Non-coding analysis:** GPT-5.1 thinking for general reasoning tasks
- **Speed-sensitive workflows:** Any smaller codex variant when response time matters more than depth

## Frequently asked questions

### How does GPT 5.1 Codex Max differ from standard GPT-5.1 codex?

It applies more compute per request, enabling deeper reasoning and more thorough analysis. The improvement is most significant on hard problems; simple tasks may not benefit noticeably.

### When is the additional cost of codex max justified?

For security audits, large architectural changes, complex migrations, and any task where the consequences of missed issues are high. For routine coding, standard codex is more cost-effective.

### What context window does GPT 5.1 Codex Max support?

400K tokens, matching the GPT-5.1 codex family.

### How does AI Gateway handle authentication for GPT 5.1 Codex Max?

AI Gateway accepts a single API key or OIDC token for all requests. You don't embed OpenAI credentials in your application; AI Gateway routes and authenticates on your behalf.

### Can GPT 5.1 Codex Max verify its own code?

Yes. Like other codex variants, it operates in sandboxed environments where it runs tests and validates output before returning results.

### What are typical latency characteristics?

This page shows live throughput and time-to-first-token metrics measured across real AI Gateway traffic. Codex max may take longer due to additional compute applied per request.

## Links

- [Model page](https://vercel.com/ai-gateway/models/gpt-5.1-codex-max)
- [AI Gateway documentation](https://vercel.com/docs/ai-gateway)
- [Provider model documentation](https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service)
- [Provider pricing](https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service)
