Claude Code on Kimi. Codex on DeepSeek. Gemini CLI on GLM. OpenCode on your ChatGPT plan.
Switch any of them from the menu bar. One local gateway serves them all,
and when a quota runs out, it quietly moves on to the next account.
Download · Docs · Reference · Plugins · Discord · English · 简体中文
| agents, one list | wire APIs, one gateway | routing modes | config files edited by hand |
You probably use more than one agent. Each keeps its model in its own file, in its own format, with its own keys and base URLs, and its own opinion about which vendors it supports. The subscription you pay for works in one agent and nowhere else. And when it runs dry at 3 pm, you're back to editing config files.
magpie gathers all of it into one place.
|
Every agent on your machine, in one list. Click a model, pick another. magpie changes exactly one key in the agent's own config. Comments, order and formatting stay untouched. |
|
Group models from several providers. When one is rate-limited or out of quota, the next one answers. Your agent never sees the error. |
|
Your Claude, ChatGPT, Copilot, Gemini or Grok sign-in becomes a provider that every other agent can use. No key to copy. |
OpenCode auth plugins and pi packages from npm run inside magpie. A plugin can also be gateway middleware that rewrites every request and reply. |
Tokens, cache hits, cost at list price, balances and quota windows for every provider, account and session, with limits per key. |
flowchart LR
subgraph A["Your agents"]
direction TB
a1["Claude Code"]
a2["Codex"]
a3["Gemini CLI"]
a4["OpenCode · Zed · Cursor CLI · 40+ more"]
end
subgraph M["magpie · 127.0.0.1:3425"]
direction TB
g["Gateway<br/>Chat · Responses · Messages · Gemini"]
r["Routing groups<br/>fail-over · smart · pace"]
p["Plugins & middleware"]
g --> r --> p
end
subgraph P["Your providers"]
direction TB
p1["API keys<br/>DeepSeek · Kimi · GLM · OpenRouter …"]
p2["Subscriptions<br/>Claude · ChatGPT · Copilot · Gemini · Grok"]
p3["Local models<br/>Ollama · LM Studio"]
end
A --> M --> P
Click a value and a searchable list opens: every model of every provider you added, as provider/model. Pick one and the agent's config is rewritten safely and atomically. Start a new session and the agent is on the new model.
Profiles save the setup of every agent under one name ("Budget", "Focus") and switch them all back in one move. Each agent can also have its own short list of models, so its picker shows only what you want there.
magpie lives where you are: a menu bar panel on macOS, Windows and Linux, a full window, a TUI (magpie tui), a web UI (magpie web, for WSL or a server over SSH) and a plain CLI.
|
|
Pick a preset, paste a key, done. Model lists come straight from the vendor, with names and reasoning levels filled in from models.dev, so a model released this morning is in your picker on the next refresh. Nothing is compiled in.
Presets include Anthropic · OpenAI · Google Gemini · DeepSeek · Kimi · Zhipu GLM · MiniMax · StepFun · Qwen · Baidu Qianfan · Tencent Cloud · Huawei Cloud MaaS · Volcengine Ark · Mistral · Groq · xAI · OpenRouter · Together · Fireworks · SiliconFlow · NVIDIA NIM · ModelScope · Ollama · LM Studio … and any OpenAI- or Anthropic-compatible URL.
Already set up elsewhere? Import brings in the providers from CC Switch, Claude Code, Codex and Alma. Add to magpie links let a provider's website hand its config to magpie in one click. Each key, like each account, can go through a proxy of its own.
A routing group is several models an agent picks as one, such as group/daily-coding. The gateway spreads requests over every member's keys and accounts:
| Mode | What it does |
|---|---|
smart |
Of the subscriptions with quota left, use the one that renews soonest, so less is wasted at the reset |
order |
Use the first model until it can't answer, then the next |
rotate |
Move to the next member on each turn |
usage |
Use the least-used member first |
pace |
Use the account with the most of its week left per hour until it resets |
Conversations stay with the account that answered them while the vendor's prompt cache is still worth keeping. Intent routing goes further: a small model of your choice reads each new turn, so tests go to the strong model and quick questions to the fast, cheap one. Groups can contain groups, and the Routing view shows every decision live.
|
|
An agent you're signed in to is a subscription with models behind it, so magpie offers it as a provider. Add several accounts per subscription and magpie fails over between them.
- Claude: drives the real local
claudebinary and bridges your agent's tools over MCP - Codex / ChatGPT: your ChatGPT plan's models, in every other agent
- GitHub Copilot, Gemini (Code Assist), Antigravity, Grok (SuperGrok) and more
- Any OpenCode auth plugin or pi package from npm
Daily warm-up starts each Claude and ChatGPT account's 5-hour window at the times of day you choose, or the moment the last one resets, so your windows line up with your day instead of with your first prompt.
magpie plugin add opencode-gemini-auth # an OpenCode plugin from npm
magpie plugin add pi-antigravity # a pi package, the same way
magpie plugin login google-plugin # its own sign-in flow, in magpiemagpie runs plugins on Bun, downloaded the first time a plugin needs it. A plugin signs in, lists its models and makes each request; agents use those models like any other provider's. Browse magpie-community/plugins, or write your own.
A plugin can also be gateway middleware: JavaScript that sees what every agent sends and gets back, whatever the provider. onRequest can rewrite a request or turn it away, onEvent sees each streamed event, onResponse sees the whole reply. It runs in-process, about a microsecond per event, and a hook that throws or runs too long leaves the request as it was.
// alias.middleware.js — magpie plugin add ./alias.middleware.js
export function onRequest(body, ctx) {
if (body.model === "fast") return { ...body, model: "deepseek/deepseek-chat" };
}Ready-made middleware, most of it what New API does for its channels, with the same JSON
| Package | What it does |
|---|---|
param-override |
New API's param_override: set, delete, move or rewrite request fields, under conditions, or turn a request away |
model-map |
New API's model_mapping: send a model under another name; replies keep the name asked for |
system-prompt |
Your system prompt on every request, or some agents' or models' |
word-guard |
New API's sensitive-word filter: turn away or mask words in what users send, and in replies |
think-tags |
Take <think>…</think> out of replies, or put reasoning_content into them |
magpie plugin add @magpie-community/middleware-model-map
magpie plugin options model-map '{"mapping": {"fast": "deepseek/deepseek-chat"}}'Find them under Plugins › Discover › Gateway middleware. See Gateway middleware.
- Tokens, cache reads and writes, reasoning and calls, with cost at list price, in dollars or yuan. Set your own price for any model.
- Balances and quota windows for every key, plan and subscription account (
magpie quota). A reset reminder warns you before a window renews with much of it unused. - Sessions: every agent conversation with its cost and title, reopened in your terminal with one click.
- Context: how full each request's context window is, how much came from the cache, and what fills it, part by part.
- By account and by upstream key, so you can check a vendor's bill line by line, and OTLP export to your own observability stack.
- On your network. Turn on Share on local network and give each client a named gateway key, each with its own daily, weekly or monthly token and cost limit.
- Remote magpie. A laptop can use the providers, accounts and routing groups of the magpie on your desktop, while still wiring its own agents.
- Docker. Run
ghcr.io/yetone/magpieon a server or a NAS and manage it from the web UI. - Sync. Back up to a file, or keep machines in sync over WebDAV (Nutstore, Nextcloud…) or S3.
|
📚 Library. Write instructions, MCP servers and skills once; magpie writes them into each agent's files in that agent's format, and removes only what it wrote. 🖼 Images and video. Give any agent an image tool through MCP, made with the model you choose, and videos with a Grok subscription. ☕ Keep awake. Your computer doesn't go to sleep in the middle of an agent's task. |
⬆️ Install and update agents. The Agents page shows each CLI's version, updates it the way it was installed, and gives the commands to install the ones you don't have yet. 🐧 WSL. On Windows, agents inside WSL distros are wired too, and their sessions counted. 🎨 At home on your desktop. Light and dark, and on Omarchy magpie takes your theme's look. |
|
Claude Code · Claude Desktop · Codex · Gemini CLI · Antigravity CLI · OpenCode · OpenChamber · MiMo Code · Pi · oh-my-pi · Aside · OmO · Goose · Cursor CLI · Cursor Private Inference · Zed · VS Code Chat · VS Code Insiders · VSCodium Chat · JetBrains Air · Copilot (JetBrains) · Copilot CLI · Crush · DeepSeek Harness · Reasonix Studio · Command Code · fx · Devin · Hermes Agent · Mister Morph · Kimi Code · Qwen Code · Muse Code · Empryo · MiniMax Code · Droid · Cline · Qoder · Qoder CN · Grok Build · ZCode · WorkBuddy · CodeBuddy Code · Pencil · T3 Code · OpenHanako · AtomCode · Alma · Cindy |
magpie shows only the agents installed on your machine; setup notes for some of them are in the reference. Anything else that takes a base URL can use the gateway too:
export OPENAI_BASE_URL=http://127.0.0.1:3425/v1 OPENAI_API_KEY=magpie
export ANTHROPIC_BASE_URL=http://127.0.0.1:3425 ANTHROPIC_API_KEY=magpie
export GOOGLE_GEMINI_BASE_URL=http://127.0.0.1:3425 GEMINI_API_KEY=magpie1 · Install. Download the app from usemagpie.ai, or run:
curl -fsSL https://usemagpie.ai/install.sh | shMac builds are signed and notarised, and every build updates itself. Behind a firewall, use --proxy or --mirror. Or go install github.com/yetone/magpie@latest, or the Docker image.
2 · Add a provider. Open magpie and go to Providers → Add provider. Pick a preset, or sign in with a subscription.
3 · Pick a model for each agent on the Agents page. Start a new session and it's on the new model.
Or do it all from the terminal:
magpie provider add deepseek sk-… # a preset needs only the key
magpie claude deepseek/deepseek-v4-pro # Claude Code on DeepSeek
magpie codex moonshot/kimi-k2.5 # Codex on Kimi
magpie group add "Opus anywhere" models=claude/claude-opus-5-5,copilot/claude-opus-5.5 routing=smart
magpie claude group/opus-anywhere # fails over between subscriptions
magpie save work && magpie use work # profiles
magpie quota # what's left on every plan
magpie tui # the whole thing, in a terminal| Get started | The guided tour |
| Reference | Every agent, provider option, gateway endpoint, CLI command and file |
| Plugins | Use plugins and write your own |
| Intent routing | Route each turn by what it asks for |
| Import links | "Add to magpie" buttons for provider websites |
Your prompts, replies, keys and accounts go only to the providers you use. Once a day a released magpie tells us it is in use: a random id, its version and system, and which agents, providers and models it is used with, by magpie's own ids (a provider you added yourself is only custom), and for each partner listed first in the add sheet, how many times a day it was shown, opened and added (counts only). No names, URLs, accounts, keys, prompts or usage. Turn part or all of it off in Settings → Privacy, or with DO_NOT_TRACK=1. What is sent, exactly.
Questions, ideas, or a model that won't show up? Tell us on Discord. That is where feedback goes.
This repository doesn't take pull requests. Only maintainers can open them. If you'd like a fix or a feature, describe it on Discord and we'll build it.
If magpie saved you from editing one more config file, a ⭐ helps others find it.