Guides · Codex CLI
Codex CLI on Sideren.
Codex talks the OpenAI Responses protocol. One provider block in config.toml points it at the gateway; the key travels through an environment variable.
One command
npx sideren setup --tool codex --key sdn_your_keyThe CLI writes the provider block below into ~/.codex/config.toml (with a backup) and prints the export line for your key. See CLI.
By hand
Add a provider to ~/.codex/config.toml. Two details matter: the base URL includes /v1, and the wire protocol is responses.
[model_providers.sideren]
name = "Sideren"
base_url = "https://api.sideren.io/v1"
env_key = "SIDEREN_API_KEY"
wire_api = "responses"
model_provider = "sideren"
model = "sdn-gpt-oss-120b"Then export the key Codex will read:
export SIDEREN_API_KEY=sdn_your_keymodel accepts any catalog id — a coding flagship like sdn-glm-5 is a strong daily driver for heavy sessions.
Troubleshooting
- Empty responses? Reasoning models spend hidden reasoning tokens from
max_output_tokens— a very low budget can be consumed before any text is emitted. Raise it (4,000+ is a safe floor) or pick a non-reasoning model. - 401 unauthorized? Codex reads the key from the variable named in
env_key— make sureSIDEREN_API_KEYis exported in the shell that launches it. - 404s? Unlike Claude Code, the Codex base URL must end in
/v1. - Protocol errors? Keep
wire_api = "responses"— the gateway serves the Responses dialect on/v1/responsesfor exactly this client.
Note
Switching models mid-project is a one-line change to model — the provider block stays put.