Skip to main content

Codex CLI

Codex works with Primex out of the box. Its default wire_api = "responses" targets a Responses-passthrough model, so no protocol tweaks are needed.

Configure ~/.codex/config.toml​

model_provider = "primex"
model = "YOUR_LIVE_RESPONSES_MODEL"
model_reasoning_effort = "high"

[model_providers.primex]
name = "Primex"
base_url = "https://gateway.primexos.com/v1"
env_key = "OPENAI_API_KEY"
wire_api = "responses"

Set your key​

export OPENAI_API_KEY=prx-YOUR_KEY

Then run codex as usual. Requests are billed through your Primex credits. The custom provider reads the key from OPENAI_API_KEY through env_key; see the official configuration reference.

Why a passthrough model matters​

Codex sends Responses-only tools (its apply_patch custom tool and built-ins like tool_search) that a chat endpoint cannot represent. Use a Responses-passthrough model from the live catalogue so its agentic file/shell tools work. Chat-only models will reject those built-in tools with a 400.