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, orwire_apivalues - You are preparing a reusable Codex CLI config example for a team
Common locations
| System | Typical path |
|---|---|
| macOS / Linux | ~/.codex/config.toml |
| Windows | C:\Users\YOUR_USER\.codex\config.toml |
AGENTS.md inside the repository. Do not mix them with user-level config.toml.
Recommended config example
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.Common mistakes
- Defining
[model_providers.custom]but forgettingmodel_provider = "custom". - Putting the Claude Code
https://www.llmeasy.ruinto 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. Usehttps://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.
Related docs
- Codex LLMEasy setup guide
- What are model_provider, base_url, and wire_api?
- What are Codex CLI sandbox and approval modes?
- OpenAI-compatible API vs Anthropic-compatible API

