Codex Can Run Grok, GLM, and DeepSeek: Import Three Providers in Three Minutes

Codex Can Run Grok, GLM, and DeepSeek: Import Three Providers in Three Minutes

Share:

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.json after OpenCode sign-in)
    • Grok CLI official session (~/.grok/auth.json from grok login --oauth)
    • Z.ai GLM Coding Plan (zai-coding-plan in OpenCode, or your own Coding Plan API key)

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-coding
  • Grok OAuth: official Grok CLI session → OK
  • Z.ai GLM Coding Plan key: protected file → OK
  • OpenCode 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

  1. codex-router is a non-official community project; credentials live only in local secrets / Keychain / official CLI sessions.
  2. It modifies ~/.codex/config.toml (local openai_base_url + merged-models.json); your ChatGPT sign-in stays.
  3. Zen models such as Gemini are not in the default Go preset; add them with curate-models opencode-zen.
  4. 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

Related Articles

Publisher

AI Nexus Team

AI Nexus Team

@hunterzhang86

6 min read

Categories