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 = "gpt-5.3-codex"
model_reasoning_effort = "high"

[model_providers.primex]
base_url = "https://gateway.primex.work/v1"

Set your key

export OPENAI_API_KEY=prx-YOUR_KEY

Then run codex as usual. Requests are billed through your Primex credits.

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 — gpt-5.3-codex (recommended) or gpt-5.5 — so its agentic file/shell tools work. Chat-only models will reject those built-in tools with a 400.