GPT-5.6 in Codex: Choosing Sol, Terra, or Luna

Posted July 10, 2026 by XAI Tech Team ‐ 7Β min read

Using GPT-5.6 Sol, Terra, and Luna in Codex through XAI Router

GPT-5.6 is a family rather than a single model. It includes gpt-5.6-sol, gpt-5.6-terra, and gpt-5.6-luna, covering different quality, latency, and cost targets.

OpenAI positions Sol as the flagship capability model, Terra as the intelligence-and-cost balance, and Luna as the efficient option for high-volume, cost-sensitive workloads. The official gpt-5.6 alias routes to Sol. With XAI Router, using the complete model ID makes routing, pricing, and usage more explicit.


Choosing among the three models

ModelOfficial positioningBetter suited to these Codex tasks
gpt-5.6-solGPT-5.6 flagship for complex professional workLarge codebase migrations, architecture, deep debugging, security review, and quality-first long-running agents
gpt-5.6-terraBalances intelligence and cost; roughly the previous mini tierEveryday development, code review, test coverage, tool use, multi-agent work, and most sustained coding tasks
gpt-5.6-lunaCost-sensitive, high-volume model; roughly the previous nano tierSmall changes, bulk first-pass review, classification and extraction, high-concurrency automation, and latency- or budget-sensitive tasks

If you do not have workload-specific evaluations yet, start with Terra. Move to Sol when reliability matters more, or to Luna when throughput and cost matter more. Evaluate with real tasks and compare success rate, total tokens, latency, and cost instead of choosing only by model name.

XAI Router model pages:


What GPT-5.6 adds

OpenAI describes GPT-5.6 as a new quality and efficiency baseline for complex production workflows. The most relevant changes for Codex users include:

  1. Greater token efficiency: frontier performance with fewer output tokens.
  2. Stronger intent understanding: the model is better at inferring the intended result without every step being specified. Important constraints, authority boundaries, and success criteria should still be explicit.
  3. Better frontend design judgment: stronger layout, visual hierarchy, usability, and overall aesthetics.
  4. Richer tool workflows: all three models support tools such as function calling, Web Search, File Search, Hosted Shell, Apply Patch, Skills, MCP, Tool Search, and Computer Use.
  5. Longer agent workflows: the large context window, persisted reasoning, and caching are useful for sustained engineering work.
  6. A higher reasoning ceiling: the official Responses API supports reasoning effort from none through max, plus Pro mode for quality-first tasks.

Programmatic Tool Calling, Responses API Multi-agent beta, explicit prompt caching, persisted reasoning, and Pro mode are OpenAI API-layer capabilities. Their direct availability in a particular Codex/XAI Router release depends on the client and upstream route. A normal Codex configuration does not need to include those API request fields manually.


Shared specifications

SpecificationGPT-5.6 Sol / Terra / Luna
Context window1,050,000 tokens
Maximum input922,000 tokens
Maximum output128,000 tokens
Knowledge cutoff2026-02-16
Input modalitiesText and image
Output modalitiesText
APIsResponses, Chat Completions, Batch
Core featuresStreaming, Structured Outputs, Function Calling, File Search, Image Input, Web Search, Prompt Caching

All three models share the same interface and context specifications. Their main differences are capability, speed, and price, so the same Codex provider configuration can switch among them by changing only the model ID.


Quick start

If you installed Codex CLI with npm, upgrade it first:

npm i -g @openai/codex@latest

Then select a model when starting Codex:

# Flagship capability
codex --model gpt-5.6-sol

# Intelligence and cost balance
codex --model gpt-5.6-terra

# High throughput and cost efficiency
codex --model gpt-5.6-luna

Inside an existing session, use /model to switch. For a non-interactive connectivity check:

codex exec --model gpt-5.6-terra "Inspect this repository and describe its purpose in one sentence"

This is a minimal, safer starting configuration for the latest Codex, with Sol as the default:

model_provider = "xai"
model = "gpt-5.6-sol"
model_reasoning_effort = "medium"
model_context_window = 1050000
model_auto_compact_token_limit = 900000
approval_policy = "on-request"
sandbox_mode = "workspace-write"

[model_providers.xai]
name = "XAI Router"
base_url = "https://api.xairouter.com"
wire_api = "responses"
requires_openai_auth = false
env_key = "XAI_API_KEY"
supports_websockets = true

Save it to ~/.codex/config.toml, then set your XAI Router API key:

export XAI_API_KEY="your XAI API key"

Start the default Sol profile:

codex

Temporarily switch to Terra or Luna:

codex --model gpt-5.6-terra
codex --model gpt-5.6-luna

This configuration uses the Responses protocol and keeps WebSocket support enabled. approval_policy = "on-request" and sandbox_mode = "workspace-write" are safer defaults for normal use. never and danger-full-access are not required by GPT-5.6 and should be used only when you understand the risk and need fully autonomous execution.

Older examples sometimes included top-level cache_ttl, responses_websockets_v2, and remote_connections. They are not part of the current minimal Codex configuration, so they have been removed here. The 900,000-token auto-compaction threshold leaves room before the models' 922,000-token maximum input and for subsequent output.

If you still need credits, register at m.xairouter.com and choose an appropriate Codex package.


Choosing a reasoning effort

medium is a practical starting point for Sol and Terra. When migrating, OpenAI recommends preserving your existing GPT-5.5 or GPT-5.4 effort as a baseline, then testing that level and one level lower on representative tasks. GPT-5.6 can often maintain or improve quality with fewer tokens.

  • low: latency-sensitive changes with a clear scope.
  • medium: most development, review, and tool-using tasks.
  • high / xhigh: complex debugging, architecture, security, or difficult tasks where evaluations show a measurable gain.
  • max: the highest effort supported by the official GPT-5.6 API for the hardest quality-first workloads. The current Codex config reference still lists model_reasoning_effort only through xhigh, so use the levels supported by your installed Codex version.

Higher reasoning effort does not automatically produce a better engineering outcome. Track task success, test pass rate, total calls, total tokens, latency, and cost.


Prompting guidance

Start GPT-5.6 with a short, clear task description. Keep the goal, real constraints, and acceptance criteria, while removing accumulated instructions that no longer serve a purpose.

Goal: Fix the issue where users are occasionally redirected to the login page after signing in.
Success criteria: Explain the root cause, keep the change minimal, and pass the relevant tests.
Constraints: Do not refactor the authentication module or change unrelated styles.
Output: Report the root cause, changed files, verification commands, and results.

Avoid relying only on β€œbe concise.” GPT-5.6 already tends to compress its answers, and an overly strong brevity instruction can remove required content. Ask it to lead with the conclusion, preserve the evidence, material caveats, and next action, and trim repetition and secondary background first.


Official standard pricing

The following OpenAI standard prices are in USD per 1M tokens.

Up to 272K input tokens:

ModelInputCached inputCache writeOutput
GPT-5.6 Sol$5.00$0.50$6.25$30.00
GPT-5.6 Terra$2.50$0.25$3.125$15.00
GPT-5.6 Luna$1.00$0.10$1.25$6.00

Above 272K input tokens:

ModelInputCached inputCache writeOutput
GPT-5.6 Sol$10.00$1.00$12.50$45.00
GPT-5.6 Terra$5.00$0.50$6.25$22.50
GPT-5.6 Luna$2.00$0.20$2.50$9.00

Once input exceeds 272K tokens, long-context pricing applies to the full request rather than only the tokens above the threshold. GPT-5.6 cache writes cost 1.25 times the uncached input rate, while cache reads remain discounted. Batch and Flex are cheaper, and Priority is more expensive. Always use OpenAI's current pricing page and your XAI Router package terms as the final source of truth.


Summary

For a quick decision:

  1. Choose gpt-5.6-sol for difficult, critical, quality-first work.
  2. Choose gpt-5.6-terra for most everyday Codex workflows.
  3. Choose gpt-5.6-luna for frequent, simpler, budget-sensitive work.

Upgrade the Codex CLI, configure the XAI Router provider, and use --model to move among the three models. The same workflow can then select capability and cost according to the value of each task.

References: