Codex CLI
Codex CLI is OpenAI's own tool, and out of the box it only talks to OpenAI models. Point its openai_base_url at Tempr Gateway and Codex CLI can run Claude, Gemini, DeepSeek — anything on your gateway allowlist — with the same codex commands and workflow you already use.
There's no setting in stock Codex CLI to reach a non-OpenAI model. Changing model in config.toml to any provider/model id on your allowlist is enough — Codex CLI just sees a chat-completions response and has no idea (or opinion) about which provider actually generated it.
-
Create a virtual key
In the Portal, create a Gateway virtual key. Keys are prefixed
tvk_and shown once at creation. -
Add a provider key
Gateway is BYOK: add a key for at least one provider from the supported list.
-
Edit the config file
Create or edit
~/.codex/config.toml:
# Codex CLI, running on Claude instead of an OpenAI model
model = "anthropic/claude-sonnet-4-5"
openai_base_url = "https://api.temprhq.io/v1"
When Codex CLI launches, choose Provide your own API key and paste your virtual key (starts with tvk_).
Model ids — not just OpenAI's
Use the fully-qualified provider/model form — openai/gpt-5 for an actual OpenAI model, but also anthropic/claude-sonnet-4-5, google/gemini-3-pro, or any other id from GET /v1/models.
What's next
- Authentication & virtual keys — scoping keys with model allowlists, budgets, and rate limits.
- Models, limits & logs — request logs and analytics for everything you send through the gateway.