Point Codex at any model with magpie

Point Codex at any model with magpie

Share:

Models usually live in separate places: API keys, ChatGPT / Claude / Copilot logins, and each coding agent's own picker. magpie's job, per its website and Get started, is to keep providers in one local app and rewrite each agent's own config.

How this page was checked (2026-10-06): we re-read the official magpie docs and kept the 2026-09-24 screenshots. We did not run a comparative benchmark or an end-to-end gateway session.

Catalog entry: magpie. Related setup: Codex CLI, Claude Code.

magpie cover: one panel, every model

What magpie is for

From the README and Get started:

  • A local gateway on 127.0.0.1:3425 that speaks OpenAI Chat, OpenAI Responses, Anthropic Messages, and Gemini, including streaming and tool calls.
  • One Agents list for installed tools. Clicking a model rewrites only the keys magpie needs in that agent's config (atomic write; comments and ordering kept).
  • Subscriptions you sign in to inside magpie (Claude, ChatGPT, Cursor, Grok, Copilot, Devin, and others listed in current docs) become providers other agents can use. magpie says it does not copy a key for that path.
  • Ollama and LM Studio: no API key.
  • Keys you paste live in ~/.config/magpie/providers.json. magpie says it does not read keys from shell environment variables.

For Codex, the start guide says magpie writes ~/.codex/config.toml ([model_providers.magpie]) and ~/.codex/magpie-models.json, and leaves the ChatGPT sign-in alone.

Install and confirm the setup

Install only when you intend to use magpie on this machine:

curl -fsSL https://usemagpie.ai/install.sh | sh

Then, from a new terminal:

magpie help
magpie ls
magpie presets

Expected result: magpie ls lists agents magpie found. magpie presets lists vendor presets. Neither command needs a paid API key.

If you already run Ollama or LM Studio, the start guide says you can add them with no key. README example:

magpie provider add ollama

Troubleshooting:

  • Command not found: reopen the terminal, or check the installer's printed PATH note. A missing CLI on PATH does not prove the desktop app is absent.
  • Empty agent list: install Codex (or the agent you want) first, then run magpie ls again.
  • Do not paste production API keys into a tutorial. Do not treat an old screenshot of someone else's OpenRouter list as your live model count.

Point Codex at a model

After magpie is installed and at least one provider exists:

  1. Open Providers and add a preset, a subscription tile, or Ollama / LM Studio.
  2. Open Agents, select the Codex row, pick provider/model.
  3. Fully quit Codex, or start a new codex session. magpie's docs state a running session keeps the model it started with.

CLI equivalent from the README (sk-… needs a real vendor key; skip it unless you intend to pay that vendor):

magpie codex moonshot/kimi-k2.5

Screenshot from 2026-09-24 (not recaptured): Codex listing third-party models in its own picker.

Codex's native model picker listing OpenRouter and OpenCode Zen models

Providers panel (2026-09-24 screenshot)

The panel below is the 2026-09-24 capture. Current docs still describe vendors and subscription tiles in one Providers list. Do not read the old "24 OpenRouter models" figure as a live inventory.

magpie's Providers panel, vendors and subscriptions in one list

How the gateway fits

Codex speaks the OpenAI Responses API. Claude Code speaks Anthropic Messages. Gemini CLI uses Google's format. magpie's documented gateway accepts those shapes and forwards to the provider that serves the chosen model.

How the magpie gateway works: agents point at the local gateway, which forwards to providers and subscriptions

Compared with Codex Router: Router is a Codex-oriented path when quota is tight. magpie is a local gateway for many agents. If you already run Codex Router, magpie is not an automatic replacement. Pick one wiring and keep the other as fallback until you have tested a real session.

For why Codex's model list matters at all, see importing models into Codex.

Limits and recovery

  • magpie must be running for gateway models (magpie tray or magpie serve in the start guide). An agent on its own vendor login does not have to go through magpie.
  • Switching models does not change an already-open session.
  • Subscription reuse touches local credential files. Read magpie's README scope and the vendor terms before routing a paid plan into a different agent.
  • The gateway listens on loopback. Other processes on the same machine can still reach that port.
  • Restore an agent with magpie default, or by picking a native model.

In one line: magpie is a local model switcher and protocol gateway. Confirm the install with magpie ls, then treat subscription routing and third-party keys as a separate, terms-sensitive step.

Sources (2026-10-06): usemagpie.ai, Get started, GitHub README.

Comments

No comments yet. Be the first to comment!

Related Tools

Related Articles

Publisher

AI Nexus Team

AI Nexus Team

@hunterzhang86

8 min read

Categories