Skip to main content
Version: next

Codex

Codex is OpenAI's CLI coding agent. It speaks the OpenAI wire format and reads its provider settings from a TOML config file.

Support state: auto-configurable. routerly clients configure writes this file for you. Config file: ~/.codex/config.toml (TOML) Wire format: OpenAI


With the CLI installed and logged in:

routerly clients configure codex --router <your-router>

This mints a router token (or reuses one you pass with --token), backs up your existing ~/.codex/config.toml, and adds the block below. Any other provider or setting already in the file is left untouched.

Minting a new token requires router:write permission on the target router (use --token <existing-token> to skip this).

Manual configuration​

Open ~/.codex/config.toml and add:

model_provider = "routerly"

[model_providers.routerly]
name = "Routerly"
base_url = "http://localhost:3000/v1"
wire_api = "responses"
experimental_bearer_token = "sk-rt-YOUR_ROUTER_TOKEN"

base_url includes the /v1 suffix. Replace http://localhost:3000/v1 with your Routerly instance's URL and sk-rt-YOUR_ROUTER_TOKEN with a router token (create one on the Routers page, or let clients configure mint one for you).

Undo​

Every configure run prints a Backup ID. Restore the file to its exact prior state with:

routerly clients undo <backupId>

See CLI: routerly clients for the full command reference, including inspect (check current status) and doctor (check service reachability).