Short version: Codex CLI talks to any API that speaks the Responses format. Add a provider block to ~/.codex/config.toml, export your key as an environment variable, and run codex exec. Below are the exact files, commands and output from a clean run on December 2, 2026.
What you need
- A WRAITHERIX account with a small balance. The whole test, 8 paid requests, cost roughly 12 cents.
- Node.js and npm. We used Node v24.16.0 on macOS.
- A terminal. On a Mac, press Cmd+Space, type "Terminal" and hit Enter.
Install
npm install -g @openai/codex
codex --version
We got codex-cli 0.173.0. If npm fails with EACCES, reinstall Node.js from nodejs.org or with Homebrew (brew install node), which sets permissions correctly.
Get a key
Sign in at wraitherix.com, open "API keys" in the left menu, click "Create API key", name it and save. The key starts with sk- so copy it with the copy icon in the key's row and keep it safe.

Configure the provider
Codex reads ~/.codex/config.toml. Create the folder if it is missing (mkdir -p ~/.codex), then run nano ~/.codex/config.toml (it creates the file if needed), paste the text below, press Ctrl+O and Enter to save, then Ctrl+X to exit:
model_provider = "wraitherix"
model = "gpt-5.6-sol"
[model_providers.wraitherix]
name = "WRAITHERIX"
base_url = "https://api.wraitherix.com/v1"
wire_api = "responses"
env_key = "WRAITHERIX_API_KEY"

The fields:
base_urlends with/v1.wire_api = "responses"is the request format Codex expects.env_keyis the name of the environment variable that holds the key. The key itself stays out of the file, so it does not end up in home-folder backups or travel with the settings file.modelis the default model. Current models and prices are in the catalog.
Set the variable in the same terminal window:
export WRAITHERIX_API_KEY="sk-your-key"
It lasts until you close the window. To make it permanent on a Mac, add the same line to ~/.zshrc.
First request
codex exec --skip-git-repo-check 'What is 17*23? Reply with the number only.'
codex exec runs one task and exits. --skip-git-repo-check is needed outside a git repository: without it Codex prints Not inside a trusted directory and does nothing. The answer came back in 3 seconds. The lines Reading additional input from stdin... and tokens used are normal. The header printed by Codex shows provider: wraitherix and model: gpt-5.6-sol, which confirms the request went through the gateway.

Let it fix a bug
In an empty folder we created two files with nano calc.py and nano test_calc.py. calc.py has a function that subtracts instead of adding, and the test checks it:
# calc.py
def add(a, b):
return a - b
# test_calc.py
from calc import add
assert add(2, 3) == 5
print("ok")
The test fails with AssertionError. Then:
codex exec --skip-git-repo-check -s workspace-write 'add in calc.py is broken. Fix it and run test_calc.py.'
-s workspace-write lets the agent edit files in the working folder; the default sandbox is read-only. Codex read both files, changed a - b to a + b, ran the test and printed ok. It took 47 seconds. We checked afterwards: calc.py returns a + b and python3 test_calc.py passes.

The usage log in the dashboard shows five requests for this task, 3.5 cents in total. The plain arithmetic question cost 1.7 cents: Codex adds a long built-in instruction to the request: on gpt-5.6-sol the input was about 9,500 tokens, and more on the other models. The tokens used figure Codex prints at the end is counted differently, so it is lower.
Other models
Add -m <model>:
| Model | Result |
|---|---|
| gpt-5.5 | answered 391 in 5 s |
| gpt-5.4-mini | answered 391 in 4 s; Codex warned it has no metadata for this model |
| gpt-5.3-codex | 429 Too Many Requests after 1 s |
The Model metadata ... not found warning means Codex does not know that model's parameters. It is harmless: Codex falls back to defaults. A 429 means "too many requests". We got it after retries and did not dig into the cause. Retry later or switch models.
Troubleshooting
We triggered these on purpose.
Missing environment variable: WRAITHERIX_API_KEY: theexportwas not run in this terminal window.401 Unauthorized: Invalid API key: wrong, mistyped or deleted key. Codex retries five times before printing it.503 ... No available channel for model not-a-model: the model name does not exist. Copy it from the catalog. Codex retries here too before showing the error.
Prefer not to edit files?
Every key in the dashboard has a "⋯" menu item that sends it to CC Switch, which writes the Codex config for you. See our CC Switch guide.
How we tested
December 2, 2026, macOS, Node v24.16.0, codex-cli 0.173.0. Everything ran in an isolated home folder with no other settings, on a test key. Costs come from the WRAITHERIX request log. The run log is saved.
