Codex

Point Codex at a Tokenmaxer key.

Install and initialize Ren

Install the Ren CLI, then pair it with your account before configuring this harness.

Terminal · Install
npm install -g @renai-labs/cli
Terminal · Initialize
ren init

Complete the browser pairing flow, then return here to continue.

Connect Codex to Tokenmaxer

Writes the configuration, backs up anything it touches, and adds only the models available from the providers you’ve configured in Tokenmaxer. Run it again after connecting another plan and it adds what is new.

Terminal
ren inference setup codex

Test it

Terminal
codex --profile ren

The session starts on a Ren model, and `/model` lists Ren's models rather than OpenAI's. `codex` on its own still uses your normal OpenAI account and auth.

Configure it manually

Replace <YOUR_KEY> with your key.

  • The provider must be defined at user level

    Codex ignores `model_providers` in a project-local `.codex/config.toml`. The definition has to live in `~/.codex/config.toml`.

  • `model_catalog_json` is the only way Codex reads Ren's model list

    Codex asks a custom provider for its catalogue only when the provider carries an auth command — `http_headers`, `env_key` and `experimental_bearer_token` all leave it on the list it shipped with. Even with one it *merges* rather than replaces, so OpenAI's bundled slugs appear in the picker and Ren rejects them. A profile-level `model_catalog_json` skips both: no catalogue request, no merge, no `models_cache.json`, and the picker holds exactly the file's models.

~/.codex/config.toml

Defines Ren as a provider without selecting it, so your normal Codex setup keeps working.

~/.codex/config.toml
[model_providers.ren]
name = "Ren"
base_url = "https://llm.useren.ai/v1"
wire_api = "responses"

[model_providers.ren.http_headers]
Authorization = "Bearer <YOUR_KEY>"

~/.codex/ren-models.json

Ren's model list, in the shape Codex reads. Without it Codex never asks a header-authenticated provider for a catalogue, and merges the one it shipped with into the picker — OpenAI slugs the gateway rejects. Re-run setup to refresh it.

~/.codex/ren-models.json
curl -fsS "https://llm.useren.ai/v1/models?client_version=$(codex --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')" \
  -H "Authorization: Bearer <YOUR_KEY>" -o ~/.codex/ren-models.json

~/.codex/ren.config.toml

`codex --profile ren` — starts on Claude Sonnet 5. `/model` switches to any of the other 11, across both pools. Ren writes this file whole, so a hand-edit here is replaced on the next setup run.

~/.codex/ren.config.toml
model = "anthropic/claude-sonnet-5"
model_provider = "ren"
model_catalog_json = "~/.codex/ren-models.json"