[OpenAI](/ai-gateway/models/labs/openai)

# GPT-5-Codex

GPT-5-Codex is a GPT-5 family model specialized for autonomous software engineering, designed to operate as a coding agent that reads repositories, writes code, executes tests, and iterates on solutions in sandboxed environments. Your use is subject to OpenAI's [Terms](https://openai.com/policies/terms-of-use) & [Privacy](https://openai.com/policies/privacy-policy) Policies.

File InputImplicit CachingReasoningTool UseVision (Image)Web Search

[Use with AI Gateway](https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%3Futm_source%3Dgateway-model-page%26utm_campaign%3Dai-gateway-models&title=Get+Started+with+Vercel+AI+Gateway) [View docs](https://vercel.com/docs/ai-gateway)

AI SDKChat CompletionsMessagesResponses

```
1import { streamText } from 'ai'
2

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

[Read docs](https://vercel.com/docs/ai-gateway/sdks-and-apis/ai-sdk)

[Overview](/ai-gateway/models/gpt-5-codex) [API](/ai-gateway/models/gpt-5-codex/api) [About](/ai-gateway/models/gpt-5-codex/about) [Providers](/ai-gateway/models/gpt-5-codex/providers) [Uptime](/ai-gateway/models/gpt-5-codex/uptime) [Status](/ai-gateway/models/gpt-5-codex/status) [Similar](/ai-gateway/models/gpt-5-codex/similar) [FAQ](/ai-gateway/models/gpt-5-codex/faq)

## [Copy link to heading](#playground)Playground

Try out GPT-5-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.

![openai logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fopenai.png&w=48&q=75)GPT-5-Codex

![openai logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fopenai.png&w=96&q=75)

GPT-5-Codex

## [Copy link to heading](#providers)Providers

Route requests across multiple providers. Copy a provider slug to set your preference. Visit the [docs](/docs/ai-gateway/provider-options) for more info. Using a provider means you agree to their terms, listed under Legal.

| Provider |
| --- |

| Context | Max Output | Latency | Throughput | Input | Output | Cache | Web Search | Capabilities | ZDR | No Training | Release Date |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |

| ![azure logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fazure.png&w=48&q=75) [Azure](/ai-gateway/models/providers/azure) Legal:[Terms](https://learn.microsoft.com/en-us/legal/cognitive-services/openai/code-of-conduct)•[Privacy](https://privacy.microsoft.com/en-us/privacystatement) | 400K | 128K |  |  | $1.25/M | $10/M | Read:$0.13/M Write:— | $14/K \+ input costs | +3 |  |  | 09/15/2025 |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |

## [Copy link to heading](#throughput)Throughput24 hours

1W

1D

P50 throughput on live AI Gateway traffic, in tokens per second (TPS). Visit the [docs](https://vercel.com/docs/ai-gateway/models-and-providers/metrics) for more info.

## [Copy link to heading](#latency)Latency24 hours

1W

1D

P50 time to first token (TTFT) on live AI Gateway traffic, in milliseconds. View the [docs](https://vercel.com/docs/ai-gateway/models-and-providers/metrics) for more info.

## [Copy link to heading](#uptime)Uptime24 hours

1W

1D

1H

Direct request success rate on AI Gateway and per-provider. Visit the [docs](https://vercel.com/docs/ai-gateway/models-and-providers/uptime) for more info.

1W

1D

1H

## [Copy link to heading](#more-models-by-openai)More models by OpenAI

All

Text

Code

| Model |
| --- |

| Context | Latency | Throughput | Input | Output | Cache | Web Search | Capabilities | Providers | ZDR | No Training | Release Date |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |

| ![openai logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fopenai.png&w=48&q=75) [openai/gpt-5.6-luna](/ai-gateway/models/gpt-5.6-luna) | 1.1M | 1.9s | 162tps | $1/M$0.20/M Fast $0.40/M+1 more | $6/M$1.20/M Fast $2.40/M+1 more | Read: $0.1/M$0.02/M+1 more Write: $1.25/M$0.25/M+1 more | $10/K \+ input costs | +4 | ![azure logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fazure.png&w=48&q=75) ![bedrock logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Famazon%2520bedrock.png&w=48&q=75) ![openai logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fopenai.png&w=48&q=75) |  |  | 07/09/2026 |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| ![openai logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fopenai.png&w=48&q=75) [openai/gpt\-5.6-sol](/ai-gateway/models/gpt-5.6-sol) | 1.1M | 2.8s | 148tps | $4/M$2/M Fast $4/M+1 more | $20/M$10/M Fast $20/M+1 more | Read: $0.4/M$0.2/M+1 more Write: $5/M$2.5/M+1 more | $10/K \+ input costs | +4 | ![azure logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fazure.png&w=48&q=75) ![bedrock logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Famazon%2520bedrock.png&w=48&q=75) ![openai logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fopenai.png&w=48&q=75) |  |  | 07/09/2026 |  |
| ![openai logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fopenai.png&w=48&q=75) [openai/gpt-5.6-terra](/ai-gateway/models/gpt-5.6-terra) | 1.1M | 2.0s | 220tps | $2.50/M$2/M Fast $4/M+1 more | $15/M$12/M Fast $24/M+1 more | Read: $0.25/M$0.2/M+1 more Write: $3.13/M$2.5/M+1 more | $10/K \+ input costs | +4 | ![azure logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fazure.png&w=48&q=75) ![bedrock logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Famazon%2520bedrock.png&w=48&q=75) ![openai logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fopenai.png&w=48&q=75) |  |  | 07/09/2026 |  |
| ![openai logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fopenai.png&w=48&q=75) [openai/gpt-5.4](/ai-gateway/models/gpt-5.4) | 1.1M | 0.6s | 90tps | $2.50/MFast $5/M+1 more | $15/MFast $30/M+1 more | Read: $0.25/M+1 more Write: — | $10/K \+ input costs | +4 | ![azure logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fazure.png&w=48&q=75) ![openai logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fopenai.png&w=48&q=75) |  |  | 03/05/2026 |  |
| ![openai logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fopenai.png&w=48&q=75) [openai/gpt-5-nano](/ai-gateway/models/gpt-5-nano) | 400K | 3.9s | 251tps | $0.05/M | $0.40/M | Read:$0.01/M Write:— | $14/K \+ input costs | +3 | ![azure logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fazure.png&w=48&q=75) ![openai logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fopenai.png&w=48&q=75) |  |  | 08/07/2025 |  |
| ![openai logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fopenai.png&w=48&q=75) [openai/gpt-5-mini](/ai-gateway/models/gpt-5-mini) | 400K | 3.9s | 97tps | $0.25/MFast $0.45/M | $2/MFast $3.60/M | Read:$0.03/M Write:— | $14/K \+ input costs | +3 | ![azure logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fazure.png&w=48&q=75) ![openai logo](/vc-ap-vercel-marketing/_next/image?url=https%3A%2F%2F7nyt0uhk7sse4zvn.public.blob.vercel-storage.com%2Fdocs-assets%2Fstatic%2Fdocs%2Fai-gateway%2Flogos%2Fopenai.png&w=48&q=75) |  |  | 08/07/2025 |  |

## [Copy link to heading](#about-gpt-5-codex)About GPT-5-Codex

GPT-5-Codex launched on September 15, 2025 as the GPT-5-class entry in OpenAI's Codex product line, designed specifically for autonomous software engineering. The model combines GPT-5's advanced reasoning capabilities with specialized training for the coding agent workflow: reading repository context, planning changes, writing code, executing tests in sandboxed environments, and iterating until tasks are verified complete.

Unlike general-purpose models that also happen to be good at code, GPT-5-Codex is architecturally optimized for the agentic coding loop. It understands repository structures, respects existing coding conventions, and produces changes that integrate cleanly with the surrounding codebase. The sandboxed execution environment means it can validate its own work by running tests before returning results.

The model supports a context window of 400K tokens, enabling it to read substantial portions of a codebase in a single pass. This broad context awareness is critical for refactoring tasks and architectural changes that span multiple files and modules.

## [Copy link to heading](#what-to-consider-when-choosing-a-provider)What To Consider When Choosing a Provider

- Configuration: GPT-5-Codex is built for the full coding agent loop rather than one-shot code generation. It reads repository context, plans changes, writes code, runs tests, and iterates until the task is complete.
- Configuration: It brings GPT-5-level reasoning to coding tasks, making it capable of handling complex refactors, architectural decisions, and multi-file changes that require understanding the broader codebase.
- Zero Data Retention: Zero Data Retention is available for this model. It is offered on a per-provider and model basis. See the [documentation](https://vercel.com/docs/ai-gateway/security-and-compliance/zdr) for details.
- Authentication: AI Gateway authenticates requests using an [API key](https://vercel.com/docs/ai-gateway/authentication-and-byok#api-key-authentication) or [OIDC token](https://vercel.com/docs/ai-gateway/authentication-and-byok#oidc-token-authentication). You do not need to manage provider credentials directly.

## [Copy link to heading](#when-to-use-gpt-5-codex)When to Use GPT-5-Codex

### Best for

- Autonomous code generation: Writing features from specifications with test verification
- Complex refactoring: Multi-file changes that require understanding architectural patterns
- Bug diagnosis and repair: Tracing issues through codebases and producing verified fixes
- Code review automation: Deep analysis of pull requests with actionable suggestions
- Test generation: Creating comprehensive test suites that cover edge cases

### Consider alternatives when

- Simpler coding tasks: Codex mini handles routine bug fixes and feature scaffolding at lower cost
- General-purpose work: Base GPT-5 is better when coding is only part of a broader workflow
- Non-coding reasoning: The o-series reasoning models for pure mathematical or scientific reasoning
- Chat-based code help: GPT-5 chat for conversational coding assistance rather than autonomous execution

## [Copy link to heading](#conclusion)Conclusion

GPT-5-Codex combines GPT-5-level reasoning with purpose-built autonomous coding capabilities. For teams building AI-powered development tools on AI Gateway within the GPT-5 generation, it is the coding-specialized option.