Skip to main content
RocketKey

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:

toml
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 (and model, 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 below model_provider (also before the first [table] line), with an ID from the Models page.

2. Set the key variable

macOS/Linux
export ROCKETKEY_API_KEY='sk-rk-YOUR_KEY_HERE'
PowerShell
$env:ROCKETKEY_API_KEY = 'sk-rk-YOUR_KEY_HERE'
CMD
set ROCKETKEY_API_KEY=sk-rk-YOUR_KEY_HERE

Add 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:

  • 401: ROCKETKEY_API_KEY is not set in the window running Codex, or the key is wrong. See error 401.
  • 404 model not found: the model ID in config.toml is not offered. See error 404.
  • 402: daily cap reached. See error 402.

Need help?

Pick a contact channel below.

Support hours: 8:00 – 22:00 (GMT+7), every day

We never ask for your password or API key.