CloseRouter

Codex

Connect Codex to CloseRouter through the Responses API.

1. Open the settings file

text
~/.codex/config.toml

2. Set the key

Set the CLOSEROUTER_API_KEY environment variable before starting Codex. The configuration below reads that variable.

3. Configure the provider

If model_provider is already set, change it to closerouter; do not duplicate the setting.

TOML
model = "openai/gpt-5.4-mini"
model_provider = "closerouter"

[model_providers.closerouter]
name = "CloseRouter"
base_url = "https://api.closerouter.dev/v1"
wire_api = "responses"
env_key = "CLOSEROUTER_API_KEY"

Check the connection

Save the file and restart the application. Select the configured CloseRouter model. If it is missing or the key is rejected, check the file location, API address and key.