How to enable a 1M context window for GPT-5.6 Sol in Codex
Set a one-million-token context budget and compaction threshold for GPT-5.6 Sol in config.toml, or enable it for one Codex CLI session. Practical guidance.
Quick answer
Set model, model_context_window, and model_auto_compact_token_limit at the top of config.toml, then fully restart Codex and start a new conversation. GPT-5.6 Sol has an official API context window of 1,050,000 tokens. The configuration below gives Codex a 1,000,000-token context budget and starts automatic compaction around 900,000 tokens.
Save the setting in config.toml
Open the Codex user configuration file:
If you set CODEX_HOME, edit config.toml in that directory. Otherwise use the default paths below.
| System | Path |
|---|---|
| macOS / Linux | ~/.codex/config.toml |
| Windows | %USERPROFILE%\.codex\config.toml |
Place these lines at the top level, before every [section] header:
model = "gpt-5.6-sol"model_context_window = 1000000model_auto_compact_token_limit = 900000Configuration parameters
| Parameter | Purpose and location | Defaults and examples |
|---|---|---|
model | Root; the full Model ID from the model plaza. | Example: gpt-6-astra; replace as needed. |
model_context_window | Root; the client’s context token budget. | Example: 1000000; defaults come from model metadata and do not expand server limits. |
model_auto_compact_token_limit | Root; the token threshold that triggers auto-compaction. | Example: 900000; omission uses the model and client default policy. |
Save the file, fully quit Codex, reopen it, and start a new conversation. Existing conversations may retain their previous model and context settings.
Enable it for one CLI session
Use -c overrides when you do not want to change your defaults.
macOS / Linux
codex -m gpt-5.6-sol \ -c model_context_window=1000000 \ -c model_auto_compact_token_limit=900000Windows PowerShell
codex -m gpt-5.6-sol ` -c model_context_window=1000000 ` -c model_auto_compact_token_limit=900000The overrides expire when that CLI session ends.
Verify the configuration
- Fully restart Codex and create a new conversation.
- Confirm that the active model is
gpt-5.6-sol. - If the model is unavailable, check the current Model ID and provider support in the model plaza.
- If Codex ignores the values, confirm that they are top-level fields in the correct user file and are not declared twice.
Why the usable context may be lower
model_context_window tells Codex the context budget available to the model. Output tokens, tool calls, system instructions, client settings, and server-side limits can reduce the effective space. Codex may also compact history before the full budget is reached. Treat one million as the requested budget, not a promise that every request can fill it.
Usage and cost
A larger context can retain more code, terminal output, and conversation history during long tasks, but it can also increase input tokens, latency, and cost substantially. The default is usually better for short tasks. Check current model and billing details in the model plaza.
Related docs
- Codex installation and custom provider setup
- Complete Codex config.toml guide
- How model_provider, Base URL, and wire_api work

