yetone/magpie
Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.
About yetone/magpie
yetone/magpie is an open-source project on GitHub, mainly written in Go. Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar. It currently holds 3,727 stars and 218 forks with 0 open issues, and was last pushed on an unknown date (repository created unknown).
Project Overview
AI Homed tracks it on the Today's Trending board.
GitHub Repository Details
README
magpie
One place to pick every agent's model: Codex on DeepSeek, Claude Code on Kimi, Gemini CLI on GLM, from the menu bar. usemagpie.ai
magpie is a single screen that lists each AI agent on your machine and
the model it is set to. Click a value, pick a model. That is the whole app.
It lives in the menu bar: click the icon and a panel drops down; the same
screen also opens as a normal window (magpie, or Open magpie in the tray menu),
and there is a terminal version (magpie tui) and a plain CLI.
◉ magpie
▸ Claude Code claude-fable-5-1[1m] ~/.claude/settings.json
Codex gpt-6-astra effort medium
Gemini CLI gemini-3.1-pro
OpenCode anthropic/claude-sonnet-5 small anthropic/claude-haiku-4-5
MiMo Code anthropic/claude-sonnet-5
Pi openrouter/z-ai/glm-5.2:batch
Goose anthropic/claude-sonnet-5
Cursor auto
Copilot CLI claude-fable-5
↑↓ agent · ←→ field · ↵ change · s save profile · p profiles · q quit
- One small binary. Under 15 MB with the desktop app (it uses the system
- Edits config files surgically. Only the one key you change is touched;
settings.json, config.toml,
opencode.jsonc or config.yaml survive intact. Writes are atomic.
- One endpoint for every agent. magpie runs a local gateway that speaks
http://127.0.0.1:3425/v1 and pick
from one catalog; the translation between APIs happens in magpie, streaming
and tool calls included.
- Your subscriptions, shared. Sign in to Claude Code, Codex (ChatGPT)
- Providers with one field. Pick a preset (Anthropic, OpenAI, Gemini,
- Real model lists, nothing compiled in. With a key in hand magpie asks
- Each agent's own model list. Under an agent's name on the Agents page,
/model included, its ChatGPT models too) or
put it back; other agents still use it, and a new model is shown.
- Profiles. Snapshot every agent's settings under a name and switch all of
- Real logos, no framework. Plain HTML over the system webview; brand
Agents
| Agent | File | Fields |
| ------------ | --------------------------------- | --------------- |
| Claude Code | ~/.claude/settings.json | provider, model, opus/sonnet/haiku/fable (through magpie) |
| Claude Desktop | Claude/ + Claude-3p/configLibrary/ in ~/Library/Application Support (%LOCALAPPDATA% on Windows, ~/.config on Linux) | provider (its third-party gateway mode: Code and Cowork on magpie, no Anthropic sign-in; restart Desktop) |
| Codex | ~/.codex/config.toml | provider, model, effort |
| Gemini CLI | ~/.gemini/settings.json, ~/.gemini/.env | auth, model |
| OpenCode | ~/.config/opencode/opencode.json(c) ($OPENCODE_CONFIG_DIR) | model, small |
| OpenChamber | ~/.config/openchamber/preferences.json ($OPENCHAMBER_DATA_DIR; magpie's provider in OpenCode's config) | model, small (its own defaults, over OpenCode's) |
| MiMo Code | ~/.config/mimocode/mimocode.json(c) | model, small |
| Pi | ~/.pi/agent/settings.json | model |
| OmO (omo-ai) | ~/.omo/agent/settings.json (+ models.json; $OMO_CODING_AGENT_DIR, $SENPI_CODING_AGENT_DIR) | model |
| Goose | ~/.config/goose/config.yaml | model |
| Cursor CLI | ~/.cursor/cli-config.json | model |
| Copilot CLI | ~/.copilot/settings.json | model |
| Crush | ~/.config/crush/crush.json | large, small |
| DeepSeek Harness (dsh) | ~/.dsh/config.yaml ($DSH_HOME) | model |
| Command Code | ~/.commandcode/settings.json (+ providers.json) | model |
| fx | ~/.fx/settings.json | model (a keyless magpie provider) |
| omp (oh-my-pi) | ~/.omp/agent/config.yml (+ models.yml) | model |
| Devin | ~/.config/devin/config.json (%APPDATA%\devin\config.json on Windows) | model |
| Hermes Agent | ~/.hermes/config.yaml ($HERMES_HOME) | model |
| Kimi Code | ~/.kimi/config.toml ($KIMI_SHARE_DIR) | model (a magpie provider; magpie's models in Kimi's /model) |
| MiniMax Code (mcode) | ~/.minimax/config.yaml ($MINIMAX_DATA_DIR) | model (a magpie custom provider; magpie's models in its /model) |
| Droid (Factory) | ~/.factory/settings.json ($FACTORY_HOME_OVERRIDE) | model (magpie's models as BYOK customModels, in Droid's /model) |
| Cline (CLI) | ~/.cline/data/settings/providers.json ($CLINE_DIR) | model, effort (magpie takes its openai-compatible provider) |
| Qoder (CLI) | ~/.qoder/settings.json ($QODER_CONFIG_DIR) | model, effort (a magpie custom provider; needs a Qoder plan with BYOK) |
| Qoder CN (CLI) | ~/.qoder-cn/settings.json ($QODERCN_CONFIG_DIR) | model, effort (as Qoder; its own accounts, a Qoder CN plan with BYOK) |
| Grok Build | ~/.grok/config.toml ($GROK_HOME) | model, effort |
| ZCode | ~/.zcode/v2/config.json | provider (magpie's models in ZCode's picker) |
| WorkBuddy | ~/.workbuddy/models.json ($WORKBUDDY_CONFIG_DIR) | provider (magpie's models in WorkBuddy's picker) |
| OpenHanako | ~/.hanako/provider-catalog.json + agents//config.yaml ($HANA_HOME; its local API while it runs) | model (the primary agent's; magpie's models as a provider) |
| Alma | Alma's local API (localhost:23001, while Alma runs) | model (Alma's default; magpie's models as a provider) |
Provider-scoped agents (OpenCode, MiMo Code, Pi, OmO, Goose, Crush, omp, Hermes Agent) take provider/model.
Only agents that are installed or configured are shown.
Providers and the gateway
Every model an agent can pick is spelled provider/model and served by
magpie's gateway, so agents never hold vendor keys or vendor URLs. Add a
provider, and its models appear in every agent's picker:
magpie presets # the vendors magpie knows, grouped: vendors, relays, local
magpie provider add deepseek sk-… # a preset needs only the key
magpie provider add ollama # local servers need none
magpie provider add "My Relay" url=https://relay.example.com/v1 key=sk-… models=gpt-5.5,claude-sonnet-5
magpie providers # host, key, exposed models, who uses what
magpie provider deepseek # one provider in detail
magpie provider models deepseek # re-fetch the vendor's list (add ids to choose which to expose)
magpie provider test deepseek # one tiny request per API, with latency
magpie provider key deepseek sk-… # replace the key
magpie provider rm deepseek
magpie models # the catalog agents see
magpie claude deepseek/deepseek-chat # use it
Custom providers take url= (an OpenAI-compatible base), anthropic= (an
Anthropic-compatible base), or both, plus responses= when the vendor has a
separate Responses endpoint, catalog= to borrow a models.dev list, and
models= to name the models to expose. Anything a preset does not know can
be overridden the same way.
One magpie can serve several computers (an office one, a personal one):
share it on the network (Settings → Share on local network), and on each
other computer add it as a Remote magpie — in the app's Add sheet, or
magpie provider add remote-magpie sk-magpie-… url=http://192.168.1.20:3425 id=office.
Each computer's own magpie still wires its agents, while the providers,
routing groups (office/group/…) and usage are the shared one's. A request
goes on in the API the agent spoke — Anthropic Messages, Responses, Chat
Completions, token counting — and a model the shared magpie's provider serves
on another API only is turned into that API once, never on both computers.
Baidu Qianfan's Token Plans
are available as baidu-qianfan: a personal (个人版) and an enterprise (企业版)
plan and pay as you go, each with its own Chat Completions, Responses and
Anthropic Messages endpoints, and a key that works only on its own plan. Add
it with magpie provider add baidu-qianfan — the id it carried its
first day, qianfan-token-plan, is taken too. The plans serve no model list,
so the preset carries their documented models; pay as you go serves its own
at /v2/models.
Plugins
A subscription magpie doesn't sign in to itself can come from an
OpenCode provider plugin: the npm packages OpenCode
users install to sign in to a plan (their auth hook) work in magpie as they
do there. magpie runs them on Bun, downloaded the first
time a plugin needs it, and the plugin signs in, lists the models and makes
each request; magpie serves them to agents like any provider's.
magpie plugin add opencode-gemini-auth # an npm package, or a path to a plugin of your own
magpie plugin # the plugins, what each signs in to, and whether you are
magpie plugin login google-plugin # its sign-in: the method, its questions, the browser or a key
magpie plugin logout google-plugin
magpie plugin off opencode-gemini-auth # on brings it back; rm removes it; update updates them all
A provider id magpie already has (google, openai, anthropic) is
-plugin. In the app, Settings → Plugins adds and removes them, and
the providers they sign in to are in Add provider → From plugins.
What a model costs
A call is counted at its effective price: what you set for that provider and model if you did, otherwise what the provider's own catalogue lists, and otherwise what models.dev lists for the model's maker. Out of the box that last one is the whole story, and it is the wrong number for any provider that does not charge list price — a relay reselling at a discount or a multiplier is counted at whatever the model's maker charges. Say what a provider actually charges, and the usage ledger and the session totals use that:
magpie model price relay-a/gpt-5.5 # what it is counted at, and where that came from
magpie model price relay-a/gpt-5.5 0.12,0.60,0.01,0.15 # input,output,cache read,cache write
magpie model price relay-a/gpt-5.5 --reset # take your price off this model
magpie model prices # every model you priced
The four numbers are USD per million tokens. All four are asked for, because
a price missing one would understate the rest of every call; 0 is a model
served at no cost, which is a price, not the absence of one.
The order a price is looked for in is: **the price for this model → the price
for /*, which covers every model of that provider → what the
provider's own catalogue lists → what models.dev lists for the maker.**
--reset removes the first, and says so when a /* price is
still in force; reset that one by name to take it away too.
A price is one provider's tariff for one model, not the model's own: the same model through two providers is two prices, and each keeps its own. Nothing an agent can see changes. The model list, the agents' own settings and the pickers that choose a model for a background task — an image, a web search, a description — all still work from the catalogue; only the cost reports read the effective price.
Two things worth knowing. The ledger and the session totals re-price when they are read, so adding or changing a price restates earlier figures: they are estimates at the effective price, not settled charges. And a price is per provider and model — usage records do not retain which key or account served a call, so a provider charging different tariffs per account cannot be costed exactly from a single provider-wide price.
What a model takes
A provider that serves a model models.dev does not list, or lists at the wrong size, has a window and a reply limit magpie cannot know. Say what they are:
magpie model context relay-a/gpt-5.5 262144 # the window a request may hold, or 1m
magpie model output relay-a/gpt-5.5 131072 # the most a reply may hold, or 128k
magpie model context "relay-a/*" 200000 # every model of that provider
magpie model output relay-a/gpt-5.5 --reset # take your limit off this model
The * is quoted because zsh treats a name it cannot expand as a command
that failed, rather than passing the name on as bash does.
Both are looked for in this order: **this model → this provider's * → the
provider's own list → models.dev. --reset removes only the value this
model has of its own.
A provider you keep unlisted, or switch off, takes them like any other: the numbers are kept, and are what its models take once it is serving again.
A window is a number agents are shown and a routing input**: at 95% of the
window a request held on a routing-group member moves to one that takes more,
so overstating a window makes that move happen too late. A reply limit is
advertised in /models and is what a group advertises the smallest of; the
gateway does not itself cap a reply by it.
Saving a window or a reply limit writes that number into the model lists magpie
keeps in the agents' own files — Pi's contextWindow and maxTokens, OpenCode's
limit, and Crush's, droid's, Cline's, Qoder's and Zcode's — which an agent reads
at start-up. A session already running therefore keeps the window it began with,
while the gateway's own /models and every request from then on are right at
once.
Routing groups
A routing group is several models, from one provider or many, that an agent
picks as one: group/. The gateway routes each request over every
member's keys and accounts together. A model two of your providers serve
under the same name becomes a group on its own; the Routing view in the app
and magpie group make any other:
magpie groups # yours, then those magpie found
magpie group add "Opus anywhere" models=claude/claude-opus-5-5,copilot/claude-opus-5.5 routing=order stays=session
magpie group opus-anywhere # one group, its models in order
magpie group set opus-anywhere models+=openrouter/anthropic/claude-opus-5.5 routing=usage
magpie group set opus-anywhere models-=copilot/claude-opus-5.5
magpie group rm opus-anywhere # one magpie found is hidden; magpie group restore brings it back
magpie claude group/opus-anywhere # use it
routing= is smart (the default: of the subscriptions with quota to
spare, the one whose allowance renews soonest first), order (the first
model until it can't answer, then the next), rotate (each turn to the next
member) or usage (least used first). stays= is how long a conversation
stays with the key or account that answered it: auto (the default, while
the vendor's cache of it is worth keeping), session, turn or off.
models= replaces the whole list, in order; a bare model id works when only
one provider serves it.
The app's Import from other apps dialog can copy providers from Claude Code's
settings.json (CLAUDE_CONFIG_DIR when set) and Codex's config.toml
(CODEX_HOME when set) into magpie. Codex imports custom
[model_providers.*] entries with an inline experimental_bearer_token,
including fixed headers for custom providers in
[model_providers.*.http_headers] and models from
[profiles.*] or model_catalog_json. Review the entries before importing;
subsequent changes to agent settings are not automatically copied to magpie.
Entries that point back to magpie or only name an env_key are skipped.
Signed-in agents as providers
An agent you have signed in to is a subscription with models behind it, so
magpie offers it as a provider too. Claude Code (an OAuth login in the macOS
Keychain or ~/.claude/.credentials.json), Codex (a ChatGPT login in
~/.codex/auth.json), Copilot (a GitHub login in
~/.config/github-copilot/apps.json), Devin (devin auth login, kept in
~/.local/share/devin/credentials.toml) and Qoder (signed in from magpie with
its OAuth device flow, kept in magpie's own config; Qoder CN is its own
subscription beside it, for accounts on qoder.cn made with an Alibaba Cloud
account or a phone number, which can't sign in on qoder.com) appear in magpie providers and in
the Providers tab as signed in as …, with their models spelled
claude/claude-sonnet-5, codex/gpt-5.5, copilot/claude-sonnet-4.5 or
devin/swe-2-max in every other agent's picker. magpie reads the agent's own credentials each
time, refreshes tokens the way the agent does — writing a rotated token
back where the agent will find it — and stores nothing but your model
picks; sign out of the agent and the provider is gone. The model list is
the vendor's own too: magpie asks Anthropic's, Copilot's or Codex's API with
that same sign-in, so a model added upstream appears on the next refresh.
The ChatGPT backend only streams and rejects a few parameters, so magpie
translates non-streaming requests and drops what it would refuse.
Claude subscriptions are different: Anthropic classifies another agent's
system prompt as third-party traffic even when the OAuth request otherwise
looks like Claude Code. magpie therefore drives the genuine local claude
binary for every Claude subscription generation. The caller's tools are
bridged into that live turn over MCP, and tool results resume the same Claude
Code process; Pi, OpenCode and every other agent use this path automatically.
The generated harness stays out of Anthropic's system-prompt classifier while
its instructions remain part of the user context. This requires Claude Code
to be installed and signed in.
A Grok subscription (SuperGrok, signed in with Grok Build) talks straight
to the Responses API the grok CLI uses, a Devin subscription to the API the
devin CLI uses, and a Cursor subscription to the agent API cursor-agent
uses, each with the CLI's sign-in and the caller's tools passed through
(Cursor's model calls them as MCP tools; none of Cursor's own tools run).
Google sign-ins — Gemini CLI's and Antigravity's — talk to Google's Code
Assist API directly: magpie reads Gemini CLI's own login from ~/.gemini or
signs one in itself, and refreshes the token in memory. Google no longer
serves Gemini CLI's sign-in to individual accounts, only to Gemini Code
Assist Standard and Enterprise, which need a Google Cloud project named
(magpie accounts project gemini , or
GOOGLE_CLOUD_PROJECT in ~/.gemini/.env). Google may suspend an
Antigravity account it sees used outside Antigravity, so magpie asks before
adding one; use an account you can afford to lose.
Connecting anything else
The gateway listens on 127.0.0.1:3425 (MAGPIE_ADDR changes it) and starts
with the app; magpie serve runs it alone. It exposes:
| Path | API |
| ------------------------ | -------------------------- |
| /v1/chat/completions | OpenAI chat completions |
| /v1/responses | OpenAI Responses |
| /v1/messages | Anthropic Messages |
| /v1/messages/count_tokens | Anthropic token counting |
| /v1beta/models/{model}:generateContent | Google Gemini (also :streamGenerateContent, :countTokens) |
| /v1/models, /v1beta/models | the catalog |
Each /v1/models entry includes reasoning and supported_reasoning_levels
([{"effort":"low"}, ...]). A routing group lists only the levels every
member supports. native_endpoints (["/v1/messages"]) names the APIs a
request for the model is passed straight through on; it is left out of a
routing group, and of a model every request to is translated anyway.
Requests pass straight through when the vendor speaks the agent's API and
are translated otherwise, streaming, tool calls and reasoning included. The
key is magpie (any value works; the gateway only listens on loopback), and
models are named provider/model. Anything with a base-URL setting can use
it:
| Tool speaks | Base URL | Environment |
| ----------- | -------------------------- | --------------------------------------------- |
| OpenAI | http://127.0.0.1:3425/v1 | OPENAI_BASE_URL, OPENAI_API_KEY=magpie |
| Anthropic | http://127.0.0.1:3425 | ANTHROPIC_BASE_URL, ANTHROPIC_API_KEY=magpie |
| Gemini | http://127.0.0.1:3425 | GOOGLE_GEMINI_BASE_URL, GEMINI_API_KEY=magpie |
An optional X-Magpie-Account: header (the account's email
or login, or its id on the Routing page) pins a request to one account of a
subscription with several: only it is tried, and an unknown account, one
whose plan lacks the model, or one resting is an error rather than another
account's reply. The header is not sent on to the vendor.
The Gateway tab in the app has this as copy buttons and ready-made
snippets (shell, curl, Python, Node) for each API, the list of model ids,
and the recent calls; MAGPIE_DEBUG=1 logs every call to the terminal.
Claude Code gets ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN and the
model variables in the env block of settings.json; picking a native
model (opus, sonnet…) removes them and restores whatever was there.
Codex gets a [model_providers.magpie] table, model_catalog_json
pointing at ~/.codex/magpie-models.json (written from the catalog, so the
models show in Codex's own list) and a valid model/effort; picking a
native model removes all of that. Your ChatGPT sign-in is never touched.
Codex reads its model list at start-up, so restart it after a switch.
OpenCode, Pi, Crush get a magpie provider entry and magpie/provider/model.
Gemini CLI switches auth between API key, Google account and Vertex;
the API key goes to ~/.gemini/.env. Picking a catalog model points
GOOGLE_GEMINI_BASE_URL at the gateway (which speaks the Gemini API), sets
auth to API key with the gateway token, and names the model in
settings.json; a native model puts the previous auth back.
Import links
A vendor or relay can hand its users a ready-made provider as a link:
``` magpie://import?preset=deepseek&key=sk-… magpie://import?name=Acme%20Relay&chat=https://api.acme.example/v1&anthropic=https://api.acme.exa