Codex Can Run Grok, GLM, and DeepSeek: Import Three Providers in Three Minutes
The result first
After setup, the model list when you start a new task in the Codex app looks like this:
| Source | Examples |
|---|---|
| Native GPT | Sol, Terra, Luna |
| OpenCode Go | Grok 4.5, GLM-5.3, Kimi, DeepSeek V4 Flash |
| Grok OAuth | grok-oauth/grok-4.5, grok-4.6 |
| Z.ai Coding | zai-coding/glm-5.3, glm-5.2, glm-5-turbo |
No new app, no lost ChatGPT sign-in; the picker simply gains three more sources. This is done by a non-official community project called codex-router: it wires your OpenCode Go subscription, the Grok CLI OAuth session, and the Z.ai GLM Coding Plan into Codex's model picker through a local proxy, so native GPT models keep working untouched.
Prerequisites
- macOS with ChatGPT / Codex app installed and signed in
- Node.js 22.19+, Git, uv (or Python 3.10+)
- At least one of these credentials:
- OpenCode Go subscription (saved at
~/.local/share/opencode/auth.jsonafter OpenCode sign-in) - Grok CLI official session (
~/.grok/auth.jsonfromgrok login --oauth) - Z.ai GLM Coding Plan (
zai-coding-planin OpenCode, or your own Coding Plan API key)
- OpenCode Go subscription (saved at
Providers without credentials show setup needed and do not affect the others.
Step 1: Install codex-router
curl -fsSL https://raw.githubusercontent.com/duolahypercho/codex-router/main/install.sh | sh -s -- --prepare-only --no-tray
The stable directory is ~/.local/share/codex-router (or brew tap duolahypercho/codex-router && brew install codex-router, which can be slower on first install). Add the CLI to your PATH:
mkdir -p ~/.local/bin
ln -sfn ~/.local/share/codex-router/bin/model-router ~/.local/bin/codex-router
Step 2: Add credentials
Keys stay on your machine; never paste them into chat or commits:
cd ~/.local/share/codex-router
./bin/provider-key opencode-go set # paste the OpenCode Go key interactively
./bin/provider-key zai-coding set # Z.ai GLM Coding Plan key
If OpenCode is already signed in on this machine, read the key from ~/.local/share/opencode/auth.json or macOS Keychain (security find-generic-password) and write it in. Grok needs no key: as long as grok login --oauth has an official session, the router reads ~/.grok/auth.json directly.
Step 3: Wire into Codex and verify
cd ~/.local/share/codex-router
./install.sh --target codex --auto \
--providers opencode-go,grok-oauth,zai-coding \
--no-tray
./bin/model-router codex doctor
This doctor output means success:
Enabled providers: opencode-go, grok-oauth, zai-codingGrok OAuth: official Grok CLI session→ OKZ.ai GLM Coding Plan key: protected file→ OKOpenCode Go/Zen key: protected file→ OK
Step 4: Restart the Codex app
Fully quit ChatGPT / Codex (right-click Quit in the Dock, not just closing the window), reopen it, and start a new task. The three provider sources are now selectable in the model list.
Day-to-day commands
codex-router codex status # router status
codex-router codex doctor # health check
codex-router codex providers list # which providers are available
Uninstall with codex-router codex uninstall when you no longer need it. Back up your config first:
cp ~/.codex/config.toml ~/.codex/config.toml.bak-before-codex-router
Notes
- codex-router is a non-official community project; credentials live only in local secrets / Keychain / official CLI sessions.
- It modifies
~/.codex/config.toml(localopenai_base_url+merged-models.json); your ChatGPT sign-in stays. - Zen models such as Gemini are not in the default Go preset; add them with
curate-models opencode-zen. - On a fresh machine without Grok CLI / Z.ai / OpenCode Go credentials, the matching provider fails and shows no models in the picker; that is expected.
Getting to know these tools and models: Codex CLI, opencode, Grok 4.6, GLM-5.3, DeepSeek V4 Flash.
Comments
No comments yet. Be the first to comment!
Related Tools
OpenCode
opencode.ai
An open-source AI coding agent that lives in your terminal, helping you understand codebases, plan features, and write code efficiently.
Pi
pi.dev
Minimal terminal coding harness that adapts to your workflows: four core tools, ~1k-token system prompt, TypeScript extensions, skills, session trees, 15+ providers, and four modes (TUI, print, RPC, SDK).
Grok
x.ai
xAI's frontier multimodal AI model with real-time X data access, 1M token context, Aurora image generation, and industry-leading reasoning capabilities.
Related Articles
Seven AI Coding CLIs, Six Months: No Matter How Strong the Model, Work Needs Supervision
Claude Code, Codex, opencode, pi, omp and DeepSeek Harness all have personalities. After six months of deep use I run a division of labor: pi for the fastest cheapest reviews, omp for complex PRs, DeepSeek Harness on V4 Flash for high-frequency low-cost review, and Claude Code, Qoder and Cursor for writing. No matter how strong the model, work needs supervision — ideally from an independent third party.
Skills + Hooks + Plugins: How Anthropic Redefined AI Coding Tool Extensibility
An in-depth analysis of Claude Code's trinity architecture of Skills, Hooks, and Plugins. Explore why this design is more advanced than GitHub Copilot and Cursor, and how it redefines AI coding tool extensibility through open standards.
Claudesidian: Transform Obsidian into an AI-Powered Second Brain
Discover Claudesidian, an open-source project that perfectly integrates Obsidian with Claude Code. Built-in PARA method, custom commands, and automated workflows for a complete idea-to-implementation solution.