Codex
Point Codex at a Gateway key.
Run this
Writes the configuration below, backs up anything it touches, and picks up only the models your key actually serves. Run it again after connecting another plan and it adds what is new.
ren inference setup codexCheck it worked
codex --profile renThe session starts on a Ren model. `codex` on its own still uses your normal OpenAI account and auth.
Configure it by hand instead
The same result, written yourself. 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_context_window` is global, so each window needs its own profile
Models with a smaller window than the profile states will not compact in time and the request fails at the API.
~/.codex/config.toml
Defines Ren as a provider without selecting it, so your normal Codex setup keeps working.
[model_providers.ren]
name = "Ren"
base_url = "https://llm.useren.ai/v1"
wire_api = "responses"
[model_providers.ren.http_headers]
Authorization = "Bearer <YOUR_KEY>"Claude models
~/.codex/ren.config.toml
`codex --profile ren` — Claude Sonnet 5 at a 1,000,000-token window. `--model` swaps within the profile, so it also covers Claude Opus 5, Claude Fable 5. Ren writes this file whole, so a hand-edit here is replaced on the next setup run.
model = "anthropic/claude-sonnet-5"
model_provider = "ren"
model_context_window = 1000000~/.codex/ren-haiku.config.toml
`codex --profile ren-haiku` — Claude Haiku 4.5 at a 200,000-token window. Ren writes this file whole, so a hand-edit here is replaced on the next setup run.
model = "anthropic/claude-haiku-4-5"
model_provider = "ren"
model_context_window = 200000ChatGPT models
~/.codex/ren-codex.config.toml
`codex --profile ren-codex` — GPT-5.6 Terra at a 272,000-token window. `--model` swaps within the profile, so it also covers GPT-5.6 Sol, GPT-5.6 Luna, GPT-5.5, GPT-5.4, GPT-5.4 Mini. Ren writes this file whole, so a hand-edit here is replaced on the next setup run.
model = "openai/gpt-5.6-terra"
model_provider = "ren"
model_context_window = 272000~/.codex/ren-codex-spark.config.toml
`codex --profile ren-codex-spark` — GPT-5.3 Codex Spark at a 128,000-token window. Ren writes this file whole, so a hand-edit here is replaced on the next setup run.
model = "openai/gpt-5.3-codex-spark"
model_provider = "ren"
model_context_window = 128000