Codex CLI setup (standard)
Configure Codex CLI with config.toml and auth.json on macOS/Linux or Windows.
Get <BASE_URL> and <API_KEY> from API Keys -> Use key.
If you login to Codex CLI with your OpenAI account and still want requests to use our API, set env_key and export OPENAI_API_KEY in your shell profile.
Config directory
macOS/Linux: ~/.codex
Windows: %userprofile%\.codex
Create the folder if missing.
config.toml
toml
model_provider = "OpenAI"
model = "gpt-5.5"
review_model = "gpt-5.5"
model_reasoning_effort = "xhigh"
disable_response_storage = true
network_access = "enabled"
windows_wsl_setup_acknowledged = true
[model_providers.OpenAI]
name = "OpenAI"
base_url = "<BASE_URL>"
env_key = "OPENAI_API_KEY"
wire_api = "responses"
requires_openai_auth = true
[features]
goals = trueauth.json
json
{
"OPENAI_API_KEY": "<API_KEY>"
}macOS zsh profile (required for OpenAI-account login flow)
Add this to ~/.zshrc:
bash
export OPENAI_API_KEY="<API_KEY>"Then reload your shell:
bash
source ~/.zshrc