Last updated

Command Code in Codex — Provider API Models | Codex Router

Command Code in Codex means routing Command Code’s Provider API into the Codex model picker with Codex Router. The official Provider API is an OpenAI-compatible Chat Completions surface plus an Anthropic Messages surface, and it is API-key only — the router no longer signs in through the Command Code CLI.

Command CodeCommand CodeProvider APIAPI key

What the Provider API is

The endpoint is https://api.commandcode.ai/provider/v1. It serves two protocols, which the router exposes as one selectable family:

Provider idProtocolTypical models
commandcodeChat CompletionsDeepSeek, GLM, Kimi, Qwen, MiniMax, GPT, Gemini
commandcode-messagesAnthropic MessagesClaude Sonnet, Opus, Fable and Haiku

Both ids share a single stored key, and enabling or disabling either toggles the whole family together.

Store the key

Create an API key in Command Code Studio, then save it through the hidden prompt and enable the provider:

./bin/model-router codex provider-key commandcode set
./bin/model-router codex providers enable commandcode

When multiple key sources exist, the environment variable wins, then the stored key, then the macOS Keychain. The accepted variables are COMMAND_CODE_API_KEY and COMMANDCODE_API_KEY. On Windows use ./model-router.ps1 codex with the same commands.

Model catalog

These routes ship in the registry:

Picker labelModel ID
DeepSeek V4 Flashcommandcode/deepseek-v4-flash
DeepSeek V4 Procommandcode/deepseek-v4-pro
DeepSeek V4.1 Flashcommandcode/deepseek-v4.1-flash
GLM-5.2commandcode/glm-5.2
GLM-5.3-Flashcommandcode/glm-5.3-flash
Kimi K3commandcode/kimi-k3
Kimi K2.7 Codecommandcode/kimi-k2.7-code
Qwen3.8 Maxcommandcode/qwen3.8-max
Qwen3.7 Maxcommandcode/qwen3.7-max
Qwen3.7 Pluscommandcode/qwen3.7-plus
MiniMax M3commandcode/minimax-m3
MiniMax M2.7commandcode/minimax-m2.7
MiMo-V2.5-Procommandcode/mimo-v2.5-pro
Grok 4.5commandcode/grok-4.5
GPT 5.6 Lunacommandcode/gpt-5.6-luna
GPT 5.5commandcode/gpt-5.5
Gemini 3.5 Flashcommandcode/gemini-3.5-flash
Hy3commandcode/hy3-paid
Hy4 Previewcommandcode/hy4-preview
Step 3.7 Flashcommandcode/step-3.7-flash
Claude Sonnet 5commandcode-messages/claude-sonnet-5
Claude Opus 4.8commandcode-messages/claude-opus-4.8
Claude Fable 5commandcode-messages/claude-fable-5
Claude Haiku 4.5commandcode-messages/claude-haiku-4.5

The live catalog is available without authentication at https://api.commandcode.ai/provider/v1/models. Add more models per machine with ./bin/curate-models commandcode. Override the endpoint with COMMANDCODE_BASE_URL; both routes follow it, so a redirected provider stays coherent.

commandcode/deepseek-v4.1-flash declares text and image input, matching the other V4.1 Flash routes: Command Code documents Image input for the model and its Provider FAQ says message content is text and images with no per-model pre-gate, so pasted screenshots go to the model instead of the vision bridge. commandcode/glm-5.3-flash carries the model’s low · high · max ladder with the ox-alpha clamp, so a Codex build without max cannot send the xhigh rung the model refuses by name, and it compacts at 400K like every other GLM-5.3-Flash route. Both entries bumped their compHash; rebuild the catalog and fully quit and reopen Codex before pasting an image.

The Go-plan fallback

A Go-plan account is refused by /provider/v1 with 403 upgrade_required even though its key is valid. When that exact entitlement response arrives before any response byte has been relayed, the router retries the turn through Command Code’s /alpha/generate transport and remembers the result for that credential. Other 403s, timeouts, rate limits and server failures do not trigger the fallback. The route is rechecked periodically, so an upgraded account returns to the documented Provider API. Both paths use the same stored key.

The CLI is not a harness replacement

Command Code’s headless CLI is a complete autonomous coding agent with its own workspace, tools, permission decisions, sessions and compaction. Launching it behind one Codex Responses request would create a second, hidden tool loop and bypass Codex’s tool events and approvals. It therefore cannot transparently replace the Codex harness, and Codex remains the harness. The router only adapts the model transport and preserves Command Code’s reported cached-token usage.

Verify the integration

./bin/model-router codex doctor
./bin/model-router codex providers
./bin/test-model 'commandcode/glm-5.2' --live --yes

The provider must report SHOW and ready. Fully quit Codex, reopen it, create a new task, and check the picker. For missing entries, see models missing from the picker.

Provider policy

Command Code may restrict or block proxy traffic. Routing its models through Codex Router is at your own risk; check Command Code’s terms before relying on it.

FAQ

What is the Command Code Provider API in Codex? It is Command Code’s OpenAI-compatible Chat Completions surface plus an Anthropic Messages surface at https://api.commandcode.ai/provider/v1. Codex Router adapts those into the Codex picker under the commandcode provider family.

Does Codex Router sign in through the Command Code CLI? No. The route is API-key only. Create a key in Command Code Studio, then store it with ./bin/model-router codex provider-key commandcode set.

What happens on the Command Code Go plan? When /provider/v1 returns the exact pre-byte 403 upgrade_required response, the router retries through /alpha/generate and remembers it for that credential. Other 403s, timeouts and rate limits do not trigger the fallback.

Related: models overview, Claude in Codex, custom models, installation.