Codex Mini
Codex Mini is OpenAI's lightweight coding agent model optimized for fast, asynchronous software engineering tasks like writing features, fixing bugs, and running tests in sandboxed cloud environments.
import { streamText } from 'ai'
const result = streamText({ model: 'openai/codex-mini', prompt: 'Why is the sky blue?'})Frequently Asked Questions
What types of coding tasks is Codex Mini best at?
It excels at well-scoped tasks: bug fixes with clear reproduction steps, feature implementations with defined requirements, test generation, and answering questions about codebases. It operates autonomously in a sandboxed environment.
How does Codex Mini differ from GPT-4.1 for coding?
Codex Mini is purpose-built for the agentic coding loop of read-write-execute-verify. GPT-4.1 is a general-purpose model with strong coding benchmarks but without the specialized agent execution architecture.
Can Codex Mini run tests and verify its own output?
Yes. It operates in sandboxed cloud environments where it can execute code, run test suites, and iterate on its solutions before returning results.
What is the context window for Codex Mini?
Codex Mini supports a context window of 200K tokens, sufficient for reading substantial portions of a codebase in a single pass.
How does AI Gateway handle authentication for Codex Mini?
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 Codex Mini suitable for production CI pipelines?
Yes. Its low cost and fast response times make it practical to run on every pull request or commit for automated code suggestions and review.
What are typical latency characteristics?
This page shows live throughput and time-to-first-token metrics measured across real AI Gateway traffic.