magpie runs a local OpenAI, Anthropic, and Gemini-compatible gateway so many coding agents can share providers, subscriptions, and failover routing from a menu bar app or CLI.
Overview
magpie centralizes model choice across numerous AI coding agents such as Claude Code, Codex, Gemini CLI, OpenCode, and many others listed in its documentation. Instead of editing each agent’s config separately, you pick models from one list and magpie rewrites only the relevant keys while preserving comments and formatting.
A gateway on 127.0.0.1:3425 translates between OpenAI Chat, OpenAI Responses, Anthropic Messages, and Gemini APIs, including streaming, tool calls, and reasoning payloads. Providers can be API keys, local runtimes like Ollama, or subscriptions discovered from agent sign-ins. Multiple accounts per provider support automatic failover when quotas or rate limits hit.
Routing groups let an agent treat several models as one endpoint with strategies such as ordered fallback, rotation, usage-based selection, or intent routing via a small classifier model. Optional privacy masking replaces secrets in prompts with placeholders before traffic leaves the machine and restores them in responses.
The product runs as a menu bar application on macOS, Windows, and Linux, with TUI, web UI, CLI, Docker, and Termux builds. Profiles save and restore full multi-agent setups under one name, and usage views track tokens, cache activity, and cost per agent session.
Key features
- Local multi-protocol API gateway
- Unified model picker per agent
- Subscription and API provider pools
- Quota-aware account failover
- Routing groups with multiple strategies
- Optional prompt secret masking
- Atomic surgical agent config edits
- Menu bar, TUI, web UI, and CLI
Use cases
- Running Claude Code on third-party models
- Sharing ChatGPT plans across agents
- Failover across multiple API accounts
- Switching entire dev stacks via profiles