Skip to content

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.

File InputReasoningTool UseVision (Image)Implicit Caching
index.ts
import { streamText } from 'ai'
const result = streamText({
model: 'openai/gpt-5-codex',
prompt: 'Why is the sky blue?'
})

Frequently Asked Questions

  • How does GPT-5-Codex differ from codex-mini?

    GPT-5-Codex brings GPT-5-class reasoning to coding tasks, making it better at complex refactors, architectural decisions, and multi-file changes. Codex-mini is optimized for speed and cost on simpler tasks.

  • Can GPT-5-Codex execute and test its own code?

    Yes. It operates in sandboxed environments where it can run code, execute test suites, and iterate on solutions before returning verified results.

  • What context window does GPT-5-Codex support?

    400K tokens, enabling it to read large portions of a codebase in a single pass for comprehensive understanding.

  • How does AI Gateway handle authentication for GPT-5-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.

  • Is GPT-5-Codex suitable for production CI pipelines?

    Yes, though its higher cost means it's best reserved for complex tasks. Use codex-mini for routine per-PR checks and GPT-5-Codex for deeper architectural reviews.

  • What are typical latency characteristics?

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