Integrations/Codex CLI/Configure Model Provider

Configure Model Provider

Add a provider block to ~/.codex/config.toml.

1. Edit the config file

Open ~/.codex/config.toml (create it if missing) and add:

toml
model = "YOUR_MODEL_ID"
model_provider = "bigmodel"

[model_providers.bigmodel]
name = "StarUnion"
base_url = "https://www.starunion.net/v1"
env_key = "BIGMODEL_API_KEY"
wire_api = "chat"

2. Provide the key

bash
export BIGMODEL_API_KEY=YOUR_API_KEY

3. Run

bash
codex
FieldNotes
base_urlthe StarUnion OpenAI-compatible endpoint, no trailing slash
env_keyname of the environment variable holding the key
wire_apikeep chat, i.e. the /chat/completions protocol
modelmodel ID from the Model Plaza, case-sensitive

A config file can hold several [model_providers.*] blocks — switch by changing model_provider at the top.

Updated: 2026-08-24