A local gateway lets developers use any LLM model with any coding agent, switch providers when quotas run out, and mask sensitive data before requests leave their machine.
Each coding agent—Claude Code, Codex, Gemini CLI—stores its configuration separately: different keys, different base URLs, different model formats. A subscription you pay for works in one agent only. Magpie, an MIT-licensed tool written in Go, centralizes this by running a local gateway that sits between your agents and their providers.
What it does
Instead of configuring each agent individually, you add providers once to Magpie and assign models to agents from a single list. The gateway rewrites the one configuration value that matters in each agent’s own format.
Magpie supports API keys, local models, and vendor subscriptions: Claude, ChatGPT, Copilot, Gemini and Grok plans you’re already signed in to.
Failover and masking
When a provider’s quota runs out, Magpie moves to your next account in a routing group without the agent seeing an error. With one account and no group, the error reaches the agent as normal.
Optionally, you can enable masking in Settings → Privacy. Keys, passwords and emails in prompts are masked on your computer before the request leaves it, then restored in the reply. This keeps sensitive strings off the vendor’s servers.
Installation and interfaces
Install with curl -fsSL https://usemagpie.ai/install.sh | sh. Magpie runs on macOS, Windows, Linux, Docker and Termux as a menu bar app, window, TUI, web UI or CLI. The script handles dependencies on Linux (asking for sudo if needed for WebKitGTK 4.1), and Nix users can install with nix profile install github:yetone/magpie-releases.
From the terminal, add a provider with magpie provider add deepseek sk-…, assign a model with magpie claude deepseek/deepseek-v4-pro, or create failover groups with magpie group add. Check remaining quota across all accounts with magpie quota.
Who it’s for
Magpie is built for developers using multiple agents, multiple providers, or multiple accounts. If you use one agent on its vendor’s own plan and that’s enough, you don’t need it. The project has 41,000 stars on GitHub.
Go deeper
Get the latest AI updates in the Tech AI Magazine app
iPhone · Android
Explain it Like I'm 12
Simplifying Coding with Magpie
Magpie is a tool that helps developers work with different coding helpers, called agents, and large language models (LLMs). Think of it like a school backpack that holds all your supplies for different subjects. Instead of carrying separate bags for each class, you have one bag that keeps everything organized.
Each coding agent, like Claude Code or Codex, has its own settings. This is like how each of your teachers has different rules. Normally, you would have to change settings for each agent separately. But with Magpie, you only set things up once. It connects everything together.
When you want to use a coding agent, you can pick from a list in Magpie. It takes care of the tricky parts, like changing the settings to match what each agent needs. This way, you can use different coding helpers without getting confused.
Magpie also helps when one of your accounts runs out of usage, which is like when you run out of time on a game. Instead of stopping the game, Magpie moves to your next account without causing any problems. If you want, it can also hide important information, like passwords, before sending it out. This is like covering your answers during a test so no one can peek.
You can install Magpie on many devices, like your computer or phone, and it works in different ways, like through a menu or a web page. It’s designed for developers who use many coding agents and accounts. If you only use one agent and that works for you, you probably don’t need Magpie.
Magpie is popular among developers, and you can find out more about it on GitHub, a site where people share coding projects.