config.toml. For HiLinkup, use the OpenAI-compatible base URL and the Responses wire API.
Codex configuration uses
~/.codex/config.toml for user-level settings. A named profile loads ~/.codex/config.toml first, then overlays ~/.codex/<profile>.config.toml. Provider settings should be kept in user-level config or a profile, not in project .codex/config.toml.Examples use the HiLinkup platform model
aliyun/kimi-k3, a Chinese model example. Confirm available code models with /v1/models and the console.Codex uses Responses only
For current Codex CLI custom providers,responses is the only supported wire_api value and is also the default when omitted.
Verify the API first
- macOS / Linux
- Windows PowerShell
Option 1: edit user config
Recommended for long-term use.- macOS
- Linux
- Windows PowerShell
Ctrl + O, press Enter, then exit with Ctrl + X.Store the key:Option 2: profile config
- macOS / Linux
- Windows PowerShell
Option 3: one-off command
- macOS / Linux
- Windows PowerShell
Verify
Common issues
Codex still does not use HiLinkup
Codex still does not use HiLinkup
Check that
model_provider = "hilinkup" is in the active user-level config. When using --profile hilinkup, the file must be ~/.codex/hilinkup.config.toml, or %USERPROFILE%\.codex\hilinkup.config.toml on Windows.Codex cannot find the API key
Codex cannot find the API key
Confirm
env_key = "HILINKUP_API_KEY" and verify that the same terminal can read it. Use echo $HILINKUP_API_KEY on macOS/Linux or echo $env:HILINKUP_API_KEY in PowerShell.Responses does not work
Responses does not work
Codex custom providers use Responses. Verify
https://api.hilinkup.com/v1/responses with the Responses example. If a model only supports Chat Completions, select a model that supports Responses; do not set wire_api to "chat".Do not put provider settings in project .codex/config.toml
Do not put provider settings in project .codex/config.toml
Codex project-level
.codex/config.toml cannot override model_provider, model_providers, and provider authentication settings. Put them in user-level ~/.codex/config.toml or ~/.codex/hilinkup.config.toml.Do not override the built-in openai provider
Do not override the built-in openai provider
Do not define
[model_providers.openai]. openai is a reserved built-in provider ID. Use a custom ID such as hilinkup.