Magpie Guide (2026): Codex Subscription in Claude Code
What this guide does: Use the open-source tool magpie to run Claude Code on the models in your Codex subscription, with no proxy to run yourself. Everything is done on Windows: four steps, then how to switch back.
magpie is an open-source project (GitHub yetone/magpie, MIT license, site usemagpie.ai, docs usemagpie.ai/docs) made of a panel and a local gateway. The panel lists the AI agents installed on your machine, one row each, showing the current model and whether it is connected; click the model dropdown to change it. Every request goes to the gateway at 127.0.0.1:3425 first, and magpie translates it into whatever protocol the vendor behind the model speaks.
This guide uses two of its features: reading the ChatGPT sign-in Codex already stored, and pointing Claude Code at the models behind that subscription.

📚 On this page
- Before You Start: Three Requirements
- Step 1: Download and Install magpie
- Step 2: Confirm magpie Found Your Codex Sign-In
- Step 3: Point Claude Code at a Codex Model on the Agent Page
- Step 4: Verify the Switch
- Advanced: Switching Models from the Command Line
- Advanced: Multiple Accounts and Routing Groups
- How to Switch Back
- Troubleshooting
- Frequently Asked Questions FAQ
- Related Guides
- Summary
Before You Start: Three Requirements
- A ChatGPT (Codex) subscription, already signed in on this machine. magpie reads the sign-in file Codex keeps:
C:/Users/<you>/.codex/auth.jsonon Windows,~/.codex/auth.jsonon macOS and Linux. If you have never signed in, sign in to Codex once first. No subscription yet? See Codex guide. - Claude Code installed. If it is not, run
npm install -g @anthropic-ai/claude-code, which needs Node.js. - Windows 10 or 11. macOS and Linux work the same way; this guide uses Windows. The latest version at the time of writing is v0.1.3225 (2026-11-07); builds update themselves, so there is no manual upgrade step.
Step 1: Download and Install magpie
Download the Windows build from usemagpie.ai with the Download for Windows button, or get it by hand from the yetone/magpie-releases Releases page:
magpie-windows-amd64.exe— the build with a UI: tray icon plus a windowmagpie-cli-windows-amd64.exe/magpie-cli-windows-arm64.exe— command-line only, used in the Advanced section below

The Windows build is not code-signed yet, so SmartScreen may stop it on the first launch. Click More info, then Run anyway.
Once it is running, magpie sits in the tray and opens a panel when you click it. The gateway lives as long as the magpie process does: quit magpie and the gateway is gone, along with any agent connected to it. Leave it running in the tray while you work.
Step 2: Confirm magpie Found Your Codex Sign-In
Open the Providers page in the left sidebar. If Codex is signed in on this machine, a Codex row appears, marked as signed in with your account and the plan you are on (the screenshot shows ChatGPT Go). magpie reads Codex's own sign-in file and refreshes the token when it expires, so nothing is copied or pasted.

If the row is missing, check two things in order:
- Whether Codex is actually signed in. Run
codex loginin a terminal and look again. - Whether the sign-in file lives somewhere else. If you moved Codex's config directory, use Import local config at the bottom of the Providers page and import
auth.jsonby hand.
At this point the Codex subscription is a usable provider.
Step 3: Point Claude Code at a Codex Model on the Agent Page
Open the Agent page. The Claude Code row has a Details section that names the config file it manages: C:/Users/<you>/.claude/settings.json on Windows.
Turn on the switch on the Claude Code row to connect it. A model dropdown appears; open it, type codex/ to filter, and pick one — the screenshot uses gpt-6-luna. What your subscription offers is what the list shows.

When you pick, magpie changes only the provider and model keys in settings.json. Comments, ordering and formatting in the file stay as they were.
Below the main model, Claude Code has a set of tiers: Opus, Sonnet, Haiku, Fable, subagent and auto mode. Each tier can have its own model and its own reasoning effort (the screenshot sets it to the highest). You switch between tiers inside Claude Code with /model; leave a tier unset and it follows the main model.

Step 4: Verify the Switch
The change takes effect right away — no new session needed. Check any one of these three places:

- The model on the Claude Code row in magpie's Agent page changed
- A request shows up on the Usage page in magpie, with the provider and model it used
- Ask Claude Code which model it is running on (in the screenshot it answers that it is Codex, based on GPT-6 Luna)
If it answers normally, it is connected. If not, see Troubleshooting below.
Advanced: Switching Models from the Command Line
The CLI does the same thing without the panel. On Windows, download the magpie-cli-windows-amd64.exe build:
magpie ls # every agent on this machine and its current settings
magpie claude codex/gpt-6-luna # point Claude Code at a Codex model
magpie sync # refresh the model listsClaude Code and Codex can both run on the same subscription: each agent gets its own model, and one does not affect the other.
Advanced: Multiple Accounts and Routing Groups
The second thing magpie is good at is quota. You can add several accounts to one subscription; when one runs out, requests move to the next account and the agent never sees the error.
If the models differ too, a routing group treats several models as one:
magpie group add "daily" models=codex/gpt-6-luna,claude/claude-sonnet-5 routing=smartPoint Claude Code at that group (group/daily) and its members take turns according to the smart policy.
The Routing page shows the live picture: which agent's request, which account it went through, when the quota resets, plus three counters for requests, reroutes and errors.
With a single account and no second provider there is nothing to move to, and the quota error reaches Claude Code untouched.

How to Switch Back
Three options, depending on what you want:
- Use a different model: on the Agent page, pick the
claude/entry for Claude Code again, or any other provider's model. - Undo this agent's config: turn off the connect switch on the Claude Code row (Disconnect), which writes
settings.jsonback as it was. - Before uninstalling: turn the switch off first, then uninstall, so no config is left pointing at a gateway that no longer exists.
If you previously connected Claude Code through CC Switch and CLIProxyAPI, switch it back to the official config there before magpie takes over. Two tools editing the same file overwrite each other.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| No magpie in the tray, Claude Code cannot connect | magpie is not running; the gateway lives inside its process | Start magpie again and leave it in the tray |
| No Codex row on the Providers page | Codex is not signed in, or its sign-in file is not in the default place | Run codex login once, or import auth.json with Import local config |
No codex/ models in the list | The subscription sign-in expired, or the model list is stale | Sign in to Codex again, then run magpie sync |
| Requests fail with a quota error | The subscription quota is used up and there is only one account | Wait for the quota to reset, or add a second account to the subscription |
| The installer is blocked by the system | The Windows build has no code signature yet | Click More info, then Run anyway |
Frequently Asked Questions FAQ
Do I need an API key to run Claude Code on my Codex subscription through magpie?
Do I need CC Switch?
How do I confirm Claude Code is really using a Codex model?
What model name do I enter?
I have a Claude subscription. Can I switch back after moving to Codex?
What happens when the subscription quota runs out?
Related Guides
- CC Switch guide for Claude Code — the other way to edit Claude Code's config, worth comparing with magpie
- CLIProxyAPI: turn a Codex subscription into an API key — use this if you want one generic API key instead
- Codex guide — get the subscription working first
- ChatGPT Plus vs Pro — check which models your plan includes
Summary
Codex subscription → magpie gateway → Claude Code, three links in one chain. The thing easiest to forget: magpie has to stay running, or there is no gateway.
