Use GPT-5.5 in Codex: Upgrade to the Latest Version to Enable It
Posted April 24, 2026 by XAI Tech TeamΒ βΒ 4Β min read

GPT-5.5 is now available in Codex. Upgrade the Codex CLI to the latest version, then choose gpt-5.5 when starting a session.
GPT-5.5 is a new frontier model for complex production workflows. It is well suited for complex coding tasks, tool-heavy agents, long-context retrieval, turning product requirements into execution plans, and workflows that need stronger output quality and consistency.
Quick Start
If you installed the Codex CLI with npm, upgrade it to the latest version:
npm i -g @openai/codex@latestAfter upgrading, start Codex with GPT-5.5:
codex --model gpt-5.5Inside an existing Codex session, you can also switch models with /model.
To verify it quickly in non-interactive mode:
codex exec --model gpt-5.5 "Describe the current model in one sentence"If you want to use GPT-5.5 as your long-term default, set it in ~/.codex/config.toml:
model = "gpt-5.5"
model_reasoning_effort = "medium"medium is the recommended starting point for GPT-5.5 because it balances quality, reliability, latency, and cost. Move to high or xhigh only when your evaluations show a clear benefit.
XAI Router Quick Config
If you want Codex to use GPT-5.5 through XAI Router by default, write this configuration to ~/.codex/config.toml:
model_provider = "xai"
model = "gpt-5.5"
model_reasoning_effort = "xhigh"
plan_mode_reasoning_effort = "xhigh"
model_reasoning_summary = "none"
model_context_window = 1050000
model_auto_compact_token_limit = 945000
approval_policy = "never"
sandbox_mode = "danger-full-access"
suppress_unstable_features_warning = true
cache_ttl = "30m"
[model_providers.xai]
name = "OpenAI"
base_url = "https://api.xairouter.com"
wire_api = "responses"
requires_openai_auth = false
env_key = "XAI_API_KEY"
supports_websockets = true
[features]
responses_websockets_v2 = true
multi_agent = true
remote_connections = trueIf you still need Codex credits, sign up at m.xairouter.com and choose the matching Codex package on the recharge page.
Then set your XAI Router API key in your shell:
export XAI_API_KEY="your XAI API Key"To make it persistent, add the line to ~/.bashrc, ~/.zshrc, or your system environment variable manager. Then reopen Codex:
codexThis configuration tells Codex to use the xai provider and send requests to XAI Router through the Responses protocol. For daily use, start with medium reasoning effort; for complex code changes, long-running agent tasks, or deep debugging, adjust upward based on actual results.
What GPT-5.5 Is Good For
GPT-5.5 is better suited for outcome-oriented tasks that need steady follow-through.
It is especially useful for:
- Complex codebase changes: understand the project structure, make changes in steps, run tests, and handle failures.
- Tool-heavy agent tasks: choose among tools, pass arguments, read results, and continue the workflow.
- Long-running engineering tasks: start from requirements, bug reports, or design specs, then turn them into implementation.
- Long-context retrieval and synthesis: keep large amounts of context available and use it consistently in later steps.
- High-quality user-facing output: produce clearer, more direct, and more stable responses.
The official GPT-5.5 guidance highlights three major improvements: more efficient reasoning, stronger outcome-first task execution, and more precise tool use. In Codex, these improvements matter directly: the model can understand goals, preserve constraints, and carry multi-step tasks toward verifiable results.
Usage Tips
When writing instructions for GPT-5.5, start with a shorter and clearer prompt. Keep only the constraints that are part of the product contract. For example:
Goal: Fix the issue where users are occasionally redirected back to the login page after signing in.
Success criteria: The root cause is clear, the change scope is minimal, and related tests pass.
Constraints: Do not refactor the authentication module. Do not change unrelated styles.
Output: Explain the root cause, changed files, verification commands, and results.If your task depends on tool use, search, code changes, or multi-turn context, prefer the capabilities provided by the Responses API. In Codex, the CLI usually handles that layer for you. What you need to specify clearly is the goal, acceptance criteria, allowed side effects, output format, and whether tests should be run.
For shorter answers, lower verbosity. For complex engineering tasks, keep medium reasoning effort as the starting point, then adjust based on actual results.
Pricing Reference
OpenAI's official pricing page lists prices per 1M tokens. For standard gpt-5.5 usage, short-context pricing is:
| Type | Price |
|---|---|
| Input | $5.00 / 1M tokens |
| Cached input | $0.50 / 1M tokens |
| Output | $30.00 / 1M tokens |
Long-context standard pricing is:
| Type | Price |
|---|---|
| Input | $10.00 / 1M tokens |
| Cached input | $1.00 / 1M tokens |
| Output | $45.00 / 1M tokens |
Batch and Flex pricing for gpt-5.5 is lower than standard pricing. Priority pricing is higher and is meant for workloads that need explicit response priority. Always use the official OpenAI pricing page as the source of truth.
Summary
Using GPT-5.5 in Codex is now straightforward:
- Upgrade the Codex CLI to the latest version.
- Configure the XAI Router provider and
model = "gpt-5.5"in~/.codex/config.toml. - Set
XAI_API_KEY, then runcodex.
GPT-5.5 is a strong default for complex Codex workflows. It is especially useful when a task needs planning, tool use, code changes, test verification, and long-running follow-through. For very short, cost-sensitive, or latency-sensitive requests, smaller models may still be a better fit.
References: