Skip to content

GPT-5.1-Codex

GPT-5.1-Codex is a GPT-5.1 generation coding agent model designed for autonomous software engineering, combining improved reasoning over the GPT-5 codex generation with the ability to read, write, execute, and verify code in sandboxed environments.

File InputTool UseReasoningVision (Image)Web SearchImplicit Caching
index.ts
import { streamText } from 'ai'
const result = streamText({
model: 'openai/gpt-5.1-codex',
prompt: 'Why is the sky blue?'
})

About GPT-5.1-Codex

GPT-5.1-Codex was released on November 12, 2025 as the standard tier in OpenAI's GPT-5.1 codex family on AI Gateway. It sits between the more affordable codex mini and the maximum-compute codex max, giving teams a middle-ground option that balances capability with cost.

The GPT-5.1 generation brought deeper reasoning and more reliable instruction following to the codex architecture. For GPT-5.1-Codex, that translates to better understanding of complex codebases, stronger adherence to existing coding conventions, and more accurate multi-step problem solving. The model operates in the agentic coding loop: reading repository context, planning changes, writing code, executing tests in sandboxed environments, and iterating.

With a context window of 400K tokens, GPT-5.1-Codex can process substantial repository contexts in a single pass, enabling it to understand broader architectural implications rather than operating on isolated files.