Skip to content

GPT 5.2 Codex

GPT 5.2 Codex is the GPT-5.2 generation coding agent model from OpenAI, combining GPT-5.2 advances in reasoning with purpose-built autonomous software engineering capabilities.

ReasoningTool UseImplicit CachingVision (Image)File Input
index.ts
import { streamText } from 'ai'
const result = streamText({
model: 'openai/gpt-5.2-codex',
prompt: 'Why is the sky blue?'
})

Playground

Try out GPT 5.2 Codex by OpenAI. Usage is billed to your team at API rates. Free users (those who haven't made a payment) get $5 of credits every 30 days.

Providers

Route requests across multiple providers. Copy a provider slug to set your preference. Visit the docs for more info. Using a provider means you agree to their terms, listed under Legal.

Provider
Context
Latency
Throughput
Input
Output
Cache
Web Search
Per Query
Capabilities
ZDR
No Training
Release Date
Azure
Legal:Terms
Privacy
400K
1.5s
82tps
$1.75/M$14.00/M
Read:$0.17/M
Write:
$14/K
+ input costs
12/18/2025
OpenAI
Legal:Terms
Privacy
400K
0.6s
6tps
$1.75/M$14.00/M
Read:$0.17/M
Write:
$10/K
+ input costs
12/18/2025
Throughput

P50 throughput on live AI Gateway traffic, in tokens per second (TPS). Visit the docs for more info.

Latency

P50 time to first token (TTFT) on live AI Gateway traffic, in milliseconds. View the docs for more info.

Uptime

Direct request success rate on AI Gateway and per-provider. Visit the docs for more info.

More models by OpenAI

Model
Context
Latency
Throughput
Input
Output
Cache
Web Search
Per Query
Capabilities
Providers
ZDR
No Training
Release Date
1M
3.5s
67tps
$5.00/M
$30.00/M
Read:
$0.5/M
Write:
$10.00/K
+ input costs
azure logo
openai logo
04/24/2026
400K
1.6s
264tps
$0.75/M$4.50/M
Read:$0.07/M
Write:
$10.00/K
+ input costs
azure logo
openai logo
03/17/2026
400K
0.5s
126tps
$0.20/M$1.25/M
Read:$0.02/M
Write:
$10.00/K
+ input costs
azure logo
openai logo
03/17/2026
1.1M
1.1s
68tps
$2.50/M
$15.00/M
Read:
$0.25/M
Write:
$10.00/K
+ input costs
azure logo
openai logo
03/05/2026
128K
0.6s
108tps
$1.25/M$10.00/M
Read:$0.13/M
Write:
$10.00/K
+ input costs
azure logo
openai logo
11/12/2025
131K
0.1s
1104tps
$0.35/M$0.75/M
Read:$0.25/M
Write:
baseten logo
bedrock logo
cerebras logo
+5
08/05/2025

About GPT 5.2 Codex

GPT 5.2 Codex became available on December 18, 2025 on AI Gateway as the GPT-5.2 generation coding agent. It combines GPT-5.2's advances in reasoning depth and instruction following with the specialized coding agent architecture that reads repositories, plans changes, writes code, executes tests, and iterates.

The model handles complex multi-file changes, architectural decisions, and codebase-wide refactoring with GPT-5.2 generation quality. The context window of 400K tokens enables comprehensive repository understanding.

For teams building AI-powered development tools, GPT 5.2 Codex provides GPT-5.2 generation capability in the codex agent architecture.

What To Consider When Choosing a Provider

  • Configuration: GPT 5.2 Codex incorporates GPT-5.2 generation improvements for better code comprehension and more reliable autonomous task completion over GPT-5.1 codex.
  • Configuration: Like other codex models, it operates in the read-plan-write-execute-verify loop rather than one-shot code generation.
  • Zero Data Retention: AI Gateway supports Zero Data Retention for this model via direct gateway requests (BYOK is not included). To configure this, check the documentation.
  • Authentication: AI Gateway authenticates requests using an API key or OIDC token. You do not need to manage provider credentials directly.

When to Use GPT 5.2 Codex

Best For

  • Complex autonomous coding: Software engineering tasks that benefit from GPT-5.2 generation reasoning
  • Enterprise codebase management: Large-scale refactoring, migration, and modernization projects
  • Advanced code review: Deep architectural analysis with GPT-5.2 generation reasoning
  • Complex feature development: Multi-component features that span services and modules
  • Code quality enforcement: Comprehensive analysis and improvement of existing codebases

Consider Alternatives When

  • Routine coding: Codex mini variants for everyday bug fixes and feature scaffolding
  • Maximum compute: GPT-5.1 codex max for tasks that benefit from extended reasoning time
  • Non-coding tasks: Base GPT-5.2 handles general-purpose reasoning and generation outside the read-plan-write-execute-verify codex loop
  • Budget constraints: Earlier codex generations at lower price points

Conclusion

GPT 5.2 Codex combines GPT-5.2 generation improvements with purpose-built autonomous coding capabilities. For software engineering workflows on AI Gateway, it is the codex option within the GPT-5.2 family.

Frequently Asked Questions

  • How does GPT 5.2 Codex improve over GPT-5.1 codex?

    It incorporates the GPT-5.2 generation's advances in reasoning and instruction following, translating to better code quality and more reliable autonomous task completion.

  • What context window does GPT 5.2 Codex support?

    400K tokens, enabling comprehensive codebase analysis.

  • Can GPT 5.2 Codex run tests and verify its own code?

    Yes. It operates in sandboxed environments where it can execute code, run tests, and iterate on solutions.

  • How does AI Gateway handle authentication for GPT 5.2 Codex?

    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.

  • When should I use an earlier codex model instead?

    When cost is a primary concern and the task doesn't require GPT-5.2 generation improvements. Codex mini variants handle routine tasks at a fraction of the cost.

  • What are typical latency characteristics?

    This page shows live throughput and time-to-first-token metrics measured across real AI Gateway traffic.