Skip to main content

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.
This setting cannot give a one-million-token window to a model that does not support it. The usable context can also vary with the Codex version, provider, server limits, reserved output and tool tokens, and compaction policy. It is not a guarantee that exactly 1,000,000 tokens will be displayed or usable.

Save the setting in config.toml

Open the Codex user configuration file: Place these lines at the top level, before every [section] header:
Save the file, fully quit Codex, reopen it, and start a new conversation. Existing conversations may retain their previous model and context settings.
The 900000 compaction threshold leaves room for model output, tool results, and later messages before the configured context budget is exhausted.

Enable it for one CLI session

Use -c overrides when you do not want to change your defaults.
The overrides expire when that CLI session ends.

Verify the configuration

  1. Fully restart Codex and create a new conversation.
  2. Confirm that the active model is gpt-5.6-sol.
  3. If the model is unavailable, check the current Model ID and provider support in the model plaza.
  4. 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.

References