Router9
Documentation
Integrations

Codex

Router9 and the OpenAI Codex CLI — MCP tools today, model routing pending

Codex logo

Codex is OpenAI's terminal coding agent. Two things connect a harness to Router9 — the model it talks to and the MCP tools it can call — and for Codex today they land differently.

Model routing — not currently supported

Codex cannot use Router9 as its model provider yet.

Since Codex 0.146, a custom model_provider must speak the OpenAI Responses APIwire_api = "chat" (Chat Completions) was removed. Pointing Codex at Router9 with the old setting fails at startup:

Error loading config.toml: `wire_api = "chat"` is no longer supported.
How to fix: set `wire_api = "responses"` in your provider config.

Switching to wire_api = "responses" doesn't help either: Router9 is an OpenAI Chat Completions gateway and does not expose /v1/responses (it returns 404). So there is currently no Codex model configuration that works against Router9, and this page intentionally does not show one — see Choosing models for the harnesses that do route through Router9 today (opencode, Goose, Hermes, and any Chat Completions client).

Until Router9 offers a Responses-API endpoint, run Codex on its own OpenAI model and use Router9 for tools via MCP, as below.

MCP Setup — supported

MCP is independent of the model, so Codex can call Router9's hosted Skills (image, audio, memory, artifacts) while running on its own model. Codex reads MCP servers from ~/.codex/config.toml.

Add Router9 as a streamable-HTTP MCP server with one command:

codex mcp add router9 --url https://api.router9.com/v1/mcp \
  --bearer-token-env-var ROUTER9_API_KEY

Or write it into ~/.codex/config.toml by hand:

[mcp_servers.router9]
url = "https://api.router9.com/v1/mcp"
bearer_token_env_var = "ROUTER9_API_KEY"

bearer_token_env_var names the environment variable holding your key — Codex sends it as Authorization: Bearer <token>:

export ROUTER9_API_KEY=sk-r9k-your-key-here

Confirm it is registered with codex mcp list — Router9 shows as enabled with a Bearer-token auth. The Router9 tools (image_generate, memory_list, …) then become available inside a Codex session. See Install MCP Server for the full tool list.

Skills (optional): Router9 offers image and audio Skills as agent tools. MCP is the recommended way to expose them; otherwise call them directly as REST endpoints (/v1/image/*, /v1/audio/*, /v1/search/) with your sk-r9k- key — see the API Reference.

Tips

  • Codex on Windows/macOS/Linux all read the same ~/.codex/config.toml; the MCP block above is identical across platforms.
  • The MCP connection and the model provider are configured independently — Router9 tools work regardless of which model Codex runs.

On this page