OpenAI Codex is a coding agent available through the CLI, IDE extension, app, and cloud workflows. The current official recommendation is GPT-5.5 for demanding Codex tasks and GPT-5.4 mini for faster, lower-cost work.

GPT-5.2 and GPT-5.3-Codex are deprecated for ChatGPT-authenticated Codex sessions. GPT-5.6 Sol, Terra, and Luna are newer, but they are available only to selected approved API organizations and Codex workspaces during the preview.

Install

1
2
3
npm install -g @openai/codex
codex --version
codex

Codex can authenticate with ChatGPT or an API key:

  • ChatGPT authentication includes Codex according to the user’s Free, Go, Plus, Pro, Business, Edu, or Enterprise plan.
  • API-key authentication uses models available to that API key and API token billing.
  • API-key authentication does not provide Codex cloud features such as hosted code review or Slack integration.

Do not hard-code an expected CLI version in an evergreen setup guide. Verify the installed version and current release notes.

Current Model Selection

NeedModelStatus
Complex coding, computer use, knowledge work, and researchgpt-5.5Recommended Codex default
Faster, lower-cost routine tasks or subagentsgpt-5.4-miniActive
Near-instant coding iterationgpt-5.3-codex-sparkPro research preview
Frontier GPT-5.6 evaluationgpt-5.6-sol, gpt-5.6-terra, gpt-5.6-lunaSeparate selected-organization preview
Old ChatGPT-authenticated configurationgpt-5.2, gpt-5.3-codexDeprecated; migrate

Set the local default in ~/.codex/config.toml:

1
model = "gpt-5.5"

Choose temporarily:

1
codex -m gpt-5.5

Or use /model in the CLI and the model selector in the IDE extension. Codex cloud tasks currently do not expose a user-selectable default model.

Use the GPT-5.6 guide for Sol/Terra/Luna pricing and the Sol investigation for agent-risk controls.

AGENTS.md

AGENTS.md is Markdown guidance, not an invented YAML agent registry. Put repository conventions, commands, boundaries, and verification requirements in the repository root:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Repository guidance

## Commands
- Install: `bun install`
- Test: `bun test`
- Build: `bun run build`

## Change rules
- Keep patches scoped to the requested feature.
- Do not add dependencies without approval.
- Never commit secrets or generated credentials.

## Verification
- Run the focused test first.
- Run the build before handoff.
- Report any skipped checks and why.

Closer nested AGENTS.md files can provide subtree-specific instructions. Model, provider, approval, and sandbox defaults belong in Codex configuration, while task-specific constraints belong in the prompt.

Approvals and Sandbox

Start with the narrowest permissions that allow the task:

  • keep production credentials out of the agent environment;
  • require approval for network access, destructive commands, or writes outside the workspace;
  • use clean worktrees for isolated feature work;
  • review the diff and tests instead of trusting the final summary;
  • record any escalated command and its purpose.

These controls are especially important for long-running agents. OpenAI’s GPT-5.6 preview system card documents simulated cases of destructive scope expansion, credential movement, and unverified completion claims.

Local and Cloud Work

Local Codex surfaces work with the checked-out repository and the configured sandbox. Cloud tasks use a configured cloud environment and hosted execution. Check environment setup, secrets, internet access, and repository state separately for each surface.

Do not promise fixed concurrency, microVM startup time, message counts, or credit consumption unless the current official plan or account UI documents it. Limits vary by plan, task size, model, and rollout.

Plan Overview

The official June 28 pricing page lists:

PlanPublic starting priceCodex context
Free$0/monthQuick coding tasks
Go$8/monthLightweight coding tasks
Plus$20/monthFocused sessions; GPT-5.5/GPT-5.4 family access
ProFrom $100/month5x or 20x Plus limits and Codex Spark research preview
Business$20/user/month annuallyDedicated workspace and administrative controls
Enterprise/EduContact salesAdvanced governance and monitoring
API keyUsage basedLocal CLI/SDK/IDE; no cloud integrations

Plans, regional pricing, credits, and limits can change. Use the official pricing page and signed-in account as final authority.

Current Model Evidence

benchmark artifact

Codex Model Context and Alternatives

ModelProviderStatusContextInput priceOutput priceCoding signalTool-use signalBenchmark evidenceSpeedVerdictSourcesChecked
GPT-5.5OpenAIactive
Generally available OpenAI baseline while GPT-5.6 remains in limited preview.
1.05M API; 400K Codex$5.00 / 1M$30.00 / 1Mnot verifiednot verifiednot verifiednot verifiedPrimary coding seat while ChatGPT/Codex limits fit the workload.OpenAI GPT-5.5 API model page, OpenAI GPT-5.5 ChatGPT limits, Artificial Analysis: GPT-5.5, LMArena leaderboard dataset2026-06-28
GPT-5.6 SolOpenAIpreview
Selected API organizations and Codex workspaces only; no public enrollment and no ChatGPT access during preview.
not published$5.00 / 1M$30.00 / 1MOpenAI reports a new state of the art on Terminal-Bench 2.1; expanded and independent results are pending.API and Codex preview; max reasoning and ultra multi-agent modes are vendor-documented.
  • Terminal-Bench 2.1: vendor reports new state of the art (vendor)
  • AIHackers repo eval: not verified (site-owned)
OpenAI announced a selected-customer Cerebras preview for July; production latency is not verified.Restricted-preview evaluation only; keep GPT-5.5 as the active OpenAI baseline.OpenAI GPT-5.6 launch [archive], OpenAI GPT-5.6 preview access [archive], OpenAI GPT-5.6 Preview system card [archive]2026-06-28
GPT-5.6 TerraOpenAIpreview
Same selected-organization API/Codex preview gate as Sol; not in ChatGPT.
not published$2.50 / 1M$15.00 / 1MOpenAI positions Terra as competitive with GPT-5.5; no independent normalized result is verified.API and Codex preview only.
  • Capability comparison: competitive with GPT-5.5 (vendor)
  • AIHackers repo eval: not verified (site-owned)
not verifiedRestricted-preview balanced lane; listed pricing does not make it a generally usable value route.OpenAI GPT-5.6 launch [archive], OpenAI GPT-5.6 preview access [archive], OpenAI GPT-5.6 Preview system card [archive]2026-06-28
GPT-5.6 LunaOpenAIpreview
Same selected-organization API/Codex preview gate as Sol; not in ChatGPT.
not published$1.00 / 1M$6.00 / 1MOpenAI positions Luna as the fastest and lowest-cost GPT-5.6 tier; independent coding quality is not verified.API and Codex preview only.
  • Speed position: fastest GPT-5.6 tier (vendor)
  • AIHackers repo eval: not verified (site-owned)
Vendor-positioned as fastest; measured production latency is not verified.Restricted-preview low-cost tier; do not present it as a public budget default.OpenAI GPT-5.6 launch [archive], OpenAI GPT-5.6 preview access [archive], OpenAI GPT-5.6 Preview system card [archive]2026-06-28
Claude Opus 4.8Anthropicactive
Current generally available Opus-tier premium baseline.
1M$5.00 / 1M$25.00 / 1MPractical premium Claude baseline; AIHackers recommends task-level comparison rather than blanket default routing.Claude API and Claude-native workflow baseline; third-party routing must follow Anthropic terms.
  • Artificial Analysis Intelligence Index v4.1: 56 (independent)
  • Artificial Analysis output speed: 57.3 tokens/s (independent)
Artificial Analysis measured 57.3 output tokens/s; provider and workload latency vary.Premium review, architecture, hard-debugging, and final-arbitration lane.Claude models overview [archive], Claude API pricing [archive], Artificial Analysis: Claude Opus 4.8 [archive], Artificial Analysis Intelligence Index v4.1, LMArena leaderboard dataset, Berkeley Function Calling Leaderboard2026-07-18
GLM-5.2Z.AIactive
Current Z.AI flagship coding model and supported-tool value lane.
1M$1.40 / 1M$4.40 / 1MZ.AI reports 62.1 on SWE-Bench Pro and 81.0 on Terminal-Bench 2.1.Supported-tool coding lane; BFCL score not imported.
  • Artificial Analysis Intelligence Index v4.1: 51 (independent)
  • SWE-Bench Pro: 62.1 (vendor)
  • Terminal-Bench 2.1: 81.0 (vendor)
Artificial Analysis flags higher output-token use; measure total cost per successful task.July value pick to test for supported coding-tool workflows; keep Opus/GPT for final arbitration until local evals pass.Z.AI GLM-5.2 overview [archive], Z.AI pricing [archive], Artificial Analysis: GLM-5.2 article [archive], Artificial Analysis Intelligence Index v4.1, SWE-bench, Berkeley Function Calling Leaderboard2026-06-28
Kimi K2.7 CodeMoonshot AIactive
Cheaper routine Kimi coding API lane; HighSpeed is the same model at higher token prices.
256K$0.95 / 1M$4.00 / 1MKimi K2.7 Code remains the lower-cost 256K coding lane after K3; independent normalized benchmarks are not imported.OpenAI-compatible API; thinking mode required in the documented K2.7 Code quickstart.
  • Program-Bench improvement vs K2.6: +10.4% (vendor)
  • MCP Mark Verified improvement vs K2.6: +11.4% (vendor)
  • SWE Marathon improvement vs K2.6: +76.2% (vendor)
  • Reasoning-token use vs K2.6: 30% lower (vendor)
  • AIHackers repo eval: not verified (site-owned)
HighSpeed model ID exists at a higher token price; latency not independently measured here.Cheaper routine Kimi coding API lane when Kimi routing fits and 256K context is enough.Kimi K2.7 Code quickstart [archive], Kimi K2.7 Code pricing [archive], Kimi Code K2.7 release notes [archive], SWE-bench, Berkeley Function Calling Leaderboard2026-06-28

GPT-5.5 is the documented Codex default. GPT-5.6 rows are restricted preview evidence and should not be read as normal Codex availability.

Benchmarks do not evaluate the entire Codex product. Measure accepted patches, tests, retries, wall-clock time, and review effort in the actual sandbox and repository.

Migration From Old Configurations

Search configuration and scripts for deprecated models:

1
rg 'gpt-5\.2|gpt-5\.3-codex' ~/.codex . --glob '*.toml' --glob '*.json' --glob '*.md'

For ChatGPT-authenticated Codex, replace active defaults with gpt-5.5. Leave historical articles, fixed eval baselines, and API-specific integrations unchanged unless their runtime model is also being migrated.

Sources


Last verified: June 28, 2026 against the current official Codex manual. Plans, models, defaults, preview access, limits, and surface behavior can change independently.