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.
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 |
|---|
P50 throughput on live AI Gateway traffic, in tokens per second (TPS). Visit the docs for more info.
P50 time to first token (TTFT) on live AI Gateway traffic, in milliseconds. View the docs for more info.
Direct request success rate on AI Gateway and per-provider. Visit the docs for more info.
More models by OpenAI
| Model |
|---|
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.