Skip to main content

Short answer

config.toml is the main local configuration file for Codex CLI. You can use it to set the default model, model provider, sandbox, approvals, reasoning effort, retry behavior, and other settings. For a custom OpenAI-compatible provider, the important part is to make model_provider point to [model_providers.<id>], then define base_url, wire_api, and authentication behavior in that provider table. Do not commit API Keys to a public repository. Keep API Keys in local environment variables, CLI login state, protected local configuration, or a secure store managed by your tool.

When you need it

  • You want Codex CLI to use a third-party OpenAI-compatible provider
  • You need a fixed default model or review model
  • You want to adjust sandbox, approval, or reasoning effort
  • You are fixing wrong model_provider, base_url, or wire_api values
  • You are preparing a reusable Codex CLI config example for a team

Common locations

SystemTypical path
macOS / Linux~/.codex/config.toml
WindowsC:\Users\YOUR_USER\.codex\config.toml
Project-level instructions usually belong in AGENTS.md inside the repository. Do not mix them with user-level config.toml. The following example follows the Codex setup page in this documentation. Copy the current model ID from the GPT Key group in the model plaza before using it.
model_provider = "custom"
model = "gpt-5.5"
review_model = "gpt-5.4"
model_reasoning_effort = "high"
model_context_window = 1000000
model_auto_compact_token_limit = 900000
windows_wsl_setup_acknowledged = true

[model_providers]
[model_providers.custom]
name = "LLMEasy"
base_url = "https://www.llmeasy.ru/v1"
wire_api = "responses"
requires_openai_auth = false
request_max_retries = 4
stream_max_retries = 8
stream_idle_timeout_ms = 300000
supports_websockets = false

Common mistakes

  • Defining [model_providers.custom] but forgetting model_provider = "custom".
  • Putting the Claude Code https://www.llmeasy.ru into Codex CLI.
  • Using a marketing model name instead of an API model ID.
  • Committing API Keys, tokens, or login state to a repository.
  • Running untrusted commands with overly broad sandbox or approval settings.

About LLMEasy

In Codex CLI, LLMEasy is a custom OpenAI-compatible provider. Use https://www.llmeasy.ru/v1 for base_url and choose a model ID from the GPT Key group. This only changes where model requests are sent. Codex CLI still controls file access, command execution, sandbox, and approvals.

References