Configure Codex CLI with a RocketKey API key: ~/.codex/config.toml and wire_api responses
Add the RocketKey provider to ~/.codex/config.toml (wire_api responses) and set ROCKETKEY_API_KEY so Codex CLI uses your RocketKey monthly plan.
Updated 21 Oct 2026
Codex CLI reads providers from ~/.codex/config.toml (user level) and reads the key from an environment variable. Every snippet below uses the placeholder key sk-rk-YOUR_KEY_HERE.
1. Add the provider to config.toml
Open (or create) ~/.codex/config.toml — on Windows %USERPROFILE%\.codex\config.toml — and add:
model_provider = "rocketkey"
[model_providers.rocketkey]
name = "RocketKey"
base_url = "https://rocketkeyapi.indexes.social/v1"
env_key = "ROCKETKEY_API_KEY"
wire_api = "responses"- Order matters:
model_provider(andmodel, if you set one) are top-level keys and must come before the first[table]line of the file, i.e. at the top. Placed after a line such as[profiles.x], TOML reads them as part of that table and Codex does not use RocketKey. The[model_providers.rocketkey]block can go anywhere after them. wire_api = "responses": Codex uses the Responses API, fully supported by RocketKey.env_key: the environment variable holding your key; Codex never reads the key from the file.- To set a default model, add
model = "<model id>"right belowmodel_provider(also before the first[table]line), with an ID from the Models page.
2. Set the key variable
export ROCKETKEY_API_KEY='sk-rk-YOUR_KEY_HERE'$env:ROCKETKEY_API_KEY = 'sk-rk-YOUR_KEY_HERE'set ROCKETKEY_API_KEY=sk-rk-YOUR_KEY_HEREAdd the line to your shell profile (~/.bashrc, ~/.zshrc, or Windows environment variables) so you don't have to set it in every new terminal.
3. Check it works
Run codex in a project folder and send a short request. If it fails: