Skip to content

Codex Gateway setup

Codex Gateway runs a local proxy and puts claude-codex-* models in Claude Code’s /model picker. It uses your ChatGPT/Codex subscription through the supported proxy, so no OpenAI API key is required.

/plugin install codex-gateway@eigenwise-toolshed --scope user
/codex-gateway:codex-gateway setup

The setup skill installs or updates the proxy, checks authentication, and starts the local gateway. Use /codex-gateway:codex-gateway doctor when the picker is missing models or the gateway port is unavailable. Once it is healthy, choose a claude-codex-* model with /model; regular Claude model ids continue to use the Anthropic API.

A Sidequest-routed agent keeps its resolved Codex route through compaction. A child agent can inherit that route only when Claude Code supplies same-session parent lineage; unrelated markerless agents stay rejected. Route logs label these requests dispatch-inherited with the parent agent ID and never include prompt content.

Gateway wiring uses each recorded project’s private .claude/settings.local.json, so it does not write the team’s committed settings.json. On a machine with no saved wiring mode, the first interactive setup asks once: “Global (all projects wired automatically via user settings) or per-project (each project opts in via its private settings.local.json — recommended)?” It persists the answer and never asks again. Non-interactive runs default to per-project with a printed notice. Change the saved mode later with /workbench:update-toolshed --wiring-mode global|local; switching to global keeps existing local blocks and lists them as redundant. Run /workbench:update-toolshed to wire recorded projects and migrate an older global gateway block. For a project that has not been recorded, run node <plugin>/bin/codex-gateway.js env --write-project from that project. Wiring applies to new Claude Code sessions, so restart open sessions after changing it.

The gateway pins Claude’s Opus, Sonnet, and Fable aliases to their shipped 1M model ids. Pin a different native model persistently with node <plugin>/bin/codex-gateway.js pin --opus claude-opus-4-8[1m]; --sonnet and --fable work the same way. Run pin --opus default to clear one, or pin to see the effective pins and which ones are overridden. After changing a pin, re-run env --write-project (or /workbench:update-toolshed) and start a new Claude Code session. The override is saved outside the plugin cache, so an update and a re-wire preserve it.

Claude Code Remote Control cannot use a local ANTHROPIC_BASE_URL in the same way. Run /codex-gateway:remote-control-compatibility to safely switch compatibility mode on or off before using Remote Control, then restore gateway mode when you return.