Setup guide

Provider setup guide

Browse setup steps and troubleshooting by tool.

Provider setup guide/Codex CLI Configuration

Codex CLI Configuration

Codex CLI is Codex in the terminal. It is suitable for letting Codex read code, modify files, run tests, and explain errors in local projects. The desktop client's settings are on the Codex client page; this section specifically covers the terminal CLI.

What this tool is and what it is used for

Terminal Codexconfig.tomlCustom ProviderFor use within the project

Configuration File Location

systemExample PathDescription
WindowsC: \Users\YourUsername\. codex\config.tomlChange the username to your own computer's username
macOS / Linux~/. codex/config.tomlIf there is no file, create a new config.toml

How to write a custom Provider

If you are only using the official account, follow the official login process first. Only add a custom provider when the provider explicitly offers Codex / OpenAI compatible configurations.

Codex CLI Login Test
codex login codex "Please reply only: Configuration successful"
SettingHow to FillAttention
modelModel ID / Model Name in the provider Backend Model ListDo not fill in a display name you came up with yourself, and do not change the case, hyphens, or dots
model_providerThe name of the Provider belowmust be consistent with [model_providers.xxx] the xxx in the
base_urlAPI address provided by the provider backendDecide whether to include it according to the backend example /v1
env_keyLocal environment variable nameWrite the variable name here, do not write the Key directly
wire_apiInterface protocolSelect according to the official Codex documentation and the provider's instructions

Key and testing

The above env_key is just the variable name, the actual Key should be placed in the local environment variable. Set it temporarily for testing first, and after confirming success, consider saving it long-term.

Temporary testing in PowerShell
$env:MZ_PROXY_API_KEY = "YOUR_KEY" codex "Please reply only: Configuration successful"

In TOML model and model_provider Place it at the beginning of the file; do not append it under the [model_providers.xxx] section.

Codex CLI Documentation Check the official Codex CLI entry.
Codex configuration basics Check the location and scope of config.toml.
Codex configuration reference Check fields such as model_providers, base_url, env_key.