codex-router
External-model router for Codex with guided Kimi OAuth/API, DeepSeek, safe migration, and rollback.
Codex Router is an external-model routing proxy that allows AI coding assistants like Codex, Claude Code, Cursor, DeepSeek Harness, and Gemini CLI to use alternative LLM providers beyond their built-in defaults. It translates the OpenAI Responses API and Anthropic Messages protocols to support providers including Kimi (OAuth and API), DeepSeek, Anthropic, xAI Grok, GitHub Copilot, local Ollama models, and dozens more through a unified local gateway. The router preserves native features like tool calling, streaming, image input, and reasoning effort controls while adding capabilities such as automatic model failover, vision bridging for text-only models, and credential isolation across providers.
Key Features
Use Cases
- 01Use DeepSeek V4 or Kimi K3 models in Codex without switching to a different coding assistant
- 02Route Claude Code to GitHub Copilot models or local Ollama instances for on-premise inference
- 03Automatically fail over to a free model when your primary provider's quota runs out mid-conversation
- 04Paste screenshots into text-only models like DeepSeek V4 Pro by bridging to a vision model (GPT, Qwen, or local Qwen2.5-VL)
- 05Run Cursor App or Cursor Agent with external providers instead of Cursor's built-in backend
- 06Manage multiple ChatGPT subscriptions and switch between accounts while preserving separate usage tracking
Related Agents
View morehermes-agent
The agent that grows with you
agency-agents
A complete AI agency at your fingertips - From frontend wizards to Reddit community ninjas, from whimsy injectors to reality checkers. Each agent is a specialized expert with personality, processes, and proven deliverables.
openinterpreter
A coding agent for open models like Kimi K3
cline
Autonomous coding agent as an SDK, IDE extension, or CLI assistant.
codex-router — FAQ
What is Codex Router?+
Codex Router is a local proxy that routes AI coding assistant requests (from Codex, Claude Code, Cursor, etc.) to external LLM providers like DeepSeek, Kimi, Anthropic, GitHub Copilot, and local models. It preserves tool calling, streaming, and other native features while adding failover and vision bridging.
How do I install Codex Router for Codex on macOS or Linux?+
Run: curl -fsSL https://raw.githubusercontent.com/duolahypercho/codex-router/main/install.sh | sh -s -- --target codex --guided --with-tray. This installs the router, sets up provider authentication, and adds the Control Center tray app. Fully quit and reopen Codex afterward.
Which AI clients does Codex Router work with?+
It works with Codex App/CLI, Claude Code, Cursor App and Cursor Agent, DeepSeek Harness, Gemini CLI, OpenClaw, opencode, pi, omp, Command Code, and Hermes Agent. Each client requires its own integration command (e.g., ./bin/model-router dsh enable for DeepSeek Harness).
Do I need API keys or subscriptions for external providers?+
Yes, most providers require an API key (DeepSeek, Anthropic, GitHub Copilot, OpenRouter, etc.) or OAuth login (Kimi Code CLI, Grok CLI). A few free gateways (OpenCode Free, Kilo Free) exist but must be explicitly enabled. The router also supports local Ollama/LM Studio models that run on your machine.
Is Codex Router free?+
The router software is free and MIT-licensed. External model usage costs depend on each provider's pricing—API keys bill separately, coding-plan subscriptions have monthly quotas, and local models are free but require your own hardware.
How does automatic failover work?+
When a provider returns a quota/balance error (402, 429 with long retry-after, or exhausted plan), the router rebuilds the turn for the next eligible enabled model and sends it again. You get one clean answer instead of a billing error. It only uses models you've already credentialed and enabled.
How do I install codex-router?+
Open the source repository on GitHub and follow its README. codex-router is a agent — MCP Agents Market links you directly to the official repo.
Is codex-router free?+
codex-router is an open-source project hosted on GitHub. Check the repository for its license and any usage requirements.