diff --git a/docs/reference.md b/docs/reference.md index 8e8491ff1..fd8be6271 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -120,7 +120,7 @@ line; agents connected to magpie lose it when it quits. | Air (JetBrains IDEs) | `~/.jetbrains/acp.json` (`%USERPROFILE%\.jetbrains\acp.json` on Windows; the Air plugin in 2026.2+ IDEs, shared with AI Assistant's custom agents) + `magpie-opencode.json` beside it | model (the same `Magpie` ACP agent as the Air app's, in Air's agent menu in the IDE; needs OpenCode installed; a `Magpie (WSL )` agent too for each running WSL distro that has OpenCode, for WSL projects) | | Copilot CLI | `~/.copilot/settings.json` | model | | Crush | `~/.config/crush/crush.json` | large, small | -| DeepSeek Harness (dsh) | `~/.dsh/profiles/*/cordis.patch.yml` (`$DSH_HOME`; a custom provider, Magpie, its key `MAGPIE_GATEWAY_KEY` in `~/.dsh/.env` and dsh's own key store `~/.dsh/.credentials.yaml`, which the desktop app reads; on one of magpie's models its `web-search-deepseek` row also goes to the gateway, which searches with the model or Settings › Web search, unless dsh has a `DEEPSEEK_API_KEY` or a row of your own), or `~/.dsh/config.yaml` before dsh 0.1.5 | model, effort | +| DeepSeek Harness (dsh) | `~/.dsh/profiles/*/cordis.patch.yml` (`$DSH_HOME`; a custom provider, Magpie, its key `MAGPIE_GATEWAY_KEY` in `~/.dsh/.env` and dsh's own key store `~/.dsh/.credentials.yaml`, which the desktop app reads; on one of magpie's models its `web-search-deepseek` row also goes to the gateway, which searches with the model or Settings › Models › Web search, unless dsh has a `DEEPSEEK_API_KEY` or a row of your own), or `~/.dsh/config.yaml` before dsh 0.1.5 | model, effort | | Reasonix Studio (2.x, or a native Go `reasonix` 2.x / 1.39.x CLI) | `~/.reasonix/config.toml` + `.env` (`%APPDATA%/reasonix` on Windows; `$REASONIX_HOME`) | model (Executor), planner (Plan), effort (a dedicated `magpie` provider, shared by Studio and the native CLI) | | Command Code | `~/.commandcode/settings.json` (+ `providers.json`) | model | | fx | `~/.fx/settings.json` | model (a keyless `magpie` provider) | diff --git a/docs/subsystems/gateway-routing.md b/docs/subsystems/gateway-routing.md index 81af39d85..82ef08777 100644 --- a/docs/subsystems/gateway-routing.md +++ b/docs/subsystems/gateway-routing.md @@ -1938,7 +1938,7 @@ longer still ends: only a real event of the reply would keep it. Covered by `Tes ## Which providers search for another model -`Searchers()` (Settings › Web search's picker) and `autoSearcher` (magpie's +`Searchers()` (Settings › Models › Web search's picker) and `autoSearcher` (magpie's own pick) take a provider by `searchRank`, and its models by `searchableModel`, from the same rules that send a provider's own search tool on (`searchesItself`, `modelSearches`, `remoteSearch`). A provider @@ -2042,7 +2042,7 @@ whom, why it didn't search, and which one searched in its place (`kindWhy`). A searcher named in Settings gives way only to the ones the user put -after it, `SearcherThen` (Settings › Web search's "If it fails" row), in +after it, `SearcherThen` (Settings › Models › Web search's "If it fails" row), in their order. One that can't search now, is the one named, or is the same model is skipped. The first that searches answers, and the row says why the named one didn't search (`searchingInstead`). No other provider @@ -2062,7 +2062,7 @@ search APIs, when any are set up. Covered by `TestSearcherThenFromSettings` cover how the list is saved. Settings only takes a provider `Searchers()` offers. A save without the list keeps it, since the page's `prefsKeep` doesn't send it; `[]` clears it. `namedFailed` keeps the last search it didn't make, with the one that -searched in its place (`Instead`), and clears it when it next searches. Settings › Web search shows that (`SearcherFailed`, +searched in its place (`Instead`), and clears it when it next searches. Settings › Models › Web search shows that (`SearcherFailed`, `searchFailed`) at the start of the row's help, which wraps whole. Gearclickist on Discord picked Grok. Their grok-4.7 rows were about 1.3k tokens, the size of a request Grok ran no search for (one that searched diff --git a/docs/subsystems/plugin-runtime.md b/docs/subsystems/plugin-runtime.md index 5b07679c5..32a5378f2 100644 --- a/docs/subsystems/plugin-runtime.md +++ b/docs/subsystems/plugin-runtime.md @@ -270,7 +270,7 @@ still means off; a page is its own plugin's to turn on and off. | --- | --- | --- | --- | | Router strategy | A module's `export const strategies = {name: (pool, seats, options) => order}` (or `{order}` objects) are routings `/`, registered with `routes.Register` while the gateway serves `middleware.Points()` and the plugin is on and loaded; off or reloaded, they are removed. 20ms each, fail open: an error, a timeout or what isn't an order of the seats is the listed order, counted on the Plugins page. The routing pickers offer the served ones (`jsRoutings` in the settings state); a routing saved whose plugin is gone shows as it is and is the listed order. providers.json keeps such a routing as saved (`provider.PluginRouting`), so a plugin turned off and on again routes its groups again. | `plugins/middleware` ("JS gateway plugins", from the same module as its [middleware](gateway-middleware.md)) | [`points.go`](../../internal/middleware/points.go), [`app.js`](../../internal/gui/assets/app.js), [`client.js`](../../internal/gui/assets/plugins/routing/client.js), [`groups_cli.go`](../../internal/cli/groups_cli.go), [`routing.go`](../../internal/provider/routing.go) | | Usage observer | `export function onUsage(row, options)` gets each usage row of an allow-list (no bodies, prompts or ids), from a bounded queue off the request path: a full queue drops and counts, and a request never waits. 250ms each, fail open. | `plugins/middleware` ("JS gateway plugins", from the same module as its [middleware](gateway-middleware.md)) | [`points.go`](../../internal/middleware/points.go) | -| Search API | Its `search` hook's entries, each a web search API in Settings › Web search (`:`), asked in the search APIs' order with a quarter of a search's time. An entry with a key, none (`keyOptional`) or the user's address (`url`), or one with `auth` naming a provider the plugin's own `auth` hook signs in to: it takes no key, asks that provider's accounts that are on in the order its model requests take them, and its `ctx.getAuth()` is the one account chosen, renewed first within the search's time; a refusal rests the account for search only. Off, no search asks it. | `plugins/search` (Web search, Essential) | [Plugin tools](plugin-tools.md) ("Search APIs from a plugin"), [provider plugins](provider-plugins.md) | +| Search API | Its `search` hook's entries, each a web search API in Settings › Models › Web search (`:`), asked in the search APIs' order with a quarter of a search's time. An entry with a key, none (`keyOptional`) or the user's address (`url`), or one with `auth` naming a provider the plugin's own `auth` hook signs in to: it takes no key, asks that provider's accounts that are on in the order its model requests take them, and its `ctx.getAuth()` is the one account chosen, renewed first within the search's time; a refusal rests the account for search only. Off, no search asks it. | `plugins/search` (Web search, Essential) | [Plugin tools](plugin-tools.md) ("Search APIs from a plugin"), [provider plugins](provider-plugins.md) | | Tool | Its OpenCode `tool` hook's tools, offered to every agent by magpie's MCP server at `/mcp/magpie/tools`, each named `_`, each call held to the calling key's limit and run in the host within 55s. Off, no tool is listed and a call says the plugin is off. | `plugins/tools` ("Plugin tools", Essential; `InUse` counts the plugins on that give tools, from `plugin-tools.json`), `gwtool.PluginTools` | [Plugin tools](plugin-tools.md) | | A page in the window | `magpie.page {title, file, icon}` and `magpie.permissions` in package.json, installed from npm, GitHub or a folder like any plugin (`plugin.WindowPage`: `file` an .html inside the plugin, the icon in the page's folder, reads kept to `plugin.PageReads`). An on plugin's page gets a tab in the sidebar's Plugins group, after the built-in pages (`pluginpages.js`, a kernel `page` part). It runs in an iframe sandboxed to `allow-scripts`, its files served from `/_magpie/plugin//` (an HMAC of the spec with a secret of this run) under a policy of `sandbox allow-scripts`, its own folder only, `connect-src 'none'`. The frame talks to the window by `postMessage`: the window answers only its own frame (`ev.source`), with the theme, its own options (`/api/plugin-pages/options`, at most once a second, saved without restarting the host for a page-only plugin) and the reads it declared (`/api/plugin-pages/read`, checked again by the server): `usage:summary` (totals and the top 20 models), `usage:day` (`pageDay`, `usageapi.SpanOf`: one day, `{date, from, tz}` with today by default and a day after today refused; a `from` (a date, or `all` for the first day with calls) makes it the days from there to `date`, `from` in the answer, and a `from` after `date` is refused, its totals, its first 12 agents by tokens with each one's first 12 models and providers, the days up to it that had calls over the heatmap's span, the agents' and providers' logos as data: pictures, `pageIconOf`, and Settings' currency and rate) and `providers:list` (ids and names). Nothing secret is readable, since a page can still send its frame to another site. A page can share a picture it drew (`magpie.image.copy(png)`, `magpie.image.save(png, name)`, a PNG Blob of 16MB at most): its sandbox has no download or clipboard, and the app's window copies text only, so the window hands the base64 PNG to `/api/plugin-pages/image` (`pageimage.go`), which checks the page is one magpie shows, that it is a PNG of 8192px a side at most, and twice a second at most a page, then puts it on the system clipboard with the system's own tool (`clipimage.go`: osascript's `«class PNGf»`, PowerShell's `Clipboard.SetDataObject` with PNG and a bitmap, `wl-copy` or `xclip`, the file's path always an argument) or saves it in Downloads under a name never over a file there. In `magpie web` the server is another computer: the browser's window downloads it and uses `navigator.clipboard` itself, else (plain http, a webview without it) copies the picture as a selected `` with the copy command, else tells the page to save it (`page-image-no-clipboard.test.cjs`). The window's side is `pageshare.js`, imported the first time a page shares a picture, so it weighs nothing on the core. Tests: `TestDayOf`, `TestPluginPageReadsADay`, `TestPluginPageSharesAPicture`, `TestPageImageName`, `TestClipImageCommand`, `plugin-page.test.cjs` (image.copy and image.save). The day card (`@magpie-community/page-day-card`) reads `usage:day`. `noFramedAPI` turns away every `/api/` request a sandboxed frame or another site can send (`Origin: null`, `Sec-Fetch-Dest` a frame, a cross-site subresource), since the desktop window's API has no key; `webGuard` lets the prefix through without the cookie the frame never sends, and the token is the key. A page that throws, or doesn't say hello in 10s, is broken through the kernel (`ctx.broke`), with Try again. The frame is made the first time the page is opened. When the reader goes to another page it is told (`{event: "visibility", data: {visible: false}}`, the bridge's `magpie.visible` and `magpie.onVisibility(fn)`), since a frame in a hidden view isn't hidden to itself, and told again on coming back. A page left 10 minutes (`IDLE_MS`) has its frame let go, with its scripts, timers and connections, and loads again when it is next opened; `magpie.page.keepAlive: true` (`plugin.PageSpec.KeepAlive`, anything but `true` is false) keeps it however long, for a page that works while no one looks at it. Tests: `TestWindowPanels` (keepAlive), `plugin-page-idle.test.cjs`. The Plugins page shows the page and its reads on the row before the plugin is on. A plugin that is only a page is in-magpie-only: no Bun host starts for it. A page whose plugin also has a part for the host (a local service its page goes to, as Magiczerowxy/magpie-chat's does) starts the host when its HTML is served, if none is up (`pageHost`, `plugin.Warm`), waiting up to 7s: the host otherwise starts only on a call, so after a Restart (a plugin installed, updated or set, a Bun update) or a crash the page's service was down, and WebKit leaves a frame that navigates to a refused address on its old document with no error. A page reaches its service through magpie too, when the plugin declares it (`magpie.page.service {port, option}`, `plugin.ServiceSpec`: the port, or the plugin option named, from its plugins.json `options`): in `magpie web`, where 127.0.0.1 is the viewer's own computer, not the server (aigcfree on Discord: a server behind nginx, a Windows PC's browser, "127.0.0.1 refused to connect"), `/api/plugin-pages` gives the page a `service` under its token, `_magpie/service/`, and the bridge hands it to the frame as `magpie.service`, an absolute address (the desktop window gets none, and the page goes to 127.0.0.1 as before; a slot page gets none). `servePageService` reverse-proxies it to 127.0.0.1:: Host set to the service's own (its rebinding check), the window's cookie taken off, Origin only absent or `null` (403 otherwise), Set-Cookie dropped, everything it sends sandboxed (`sandbox allow-scripts; frame-ancestors 'self'`, `Referrer-Policy: no-referrer`), streamed as it comes (`FlushInterval -1`, `X-Accel-Buffering: no` on an event stream, which `webCompressed` never gzips), a redirect to its own address made relative, and the gateway's port never served (a request from this server is loopback, which the gateway takes without a key). The way in is the page's: the token, which only a signed-in `/api` hands out, behind `AllowGuard`; the service stays on loopback. Its entry starts the host as the page's HTML does, and a service not up yet answers its frame with a 502 page that tries again in 2s. The chat page (`@magpie-community/page-chat` 0.1.1) goes to `magpie.service` when given one, else 127.0.0.1, and asks its `api/…` by relative address. Tests: `TestPluginPageServiceListedToBrowserOnly`, `TestPluginPageServiceSpec`, `TestPluginPageServiceProxied`, `TestPluginPageServiceDown`, `TestServiceLocation`, `plugin-page.test.cjs` (`magpie.service`). Discover lists a market entry of `kind: "page"` under Pages with the Page chip, and a GitHub repository tagged `magpie-plugin` whose package.json has `magpie.page.file` as a Page (`TaggedRepos`, which then checks that file is committed, as it does a provider's entry; `TestTaggedRepos`, `plugin-kinds-discover.test.cjs`). Tests: `TestWindowPageStaysInside`, `TestPluginPageServedShutIn`, `TestPluginPageReadsWhatItDeclared`, `TestPluginPageNoAPI`, `TestPluginPageWebGuard`, `TestPluginPageStartsItsHost`, `plugin-page.test.cjs`. Example: `internal/gui/testdata/page-plugin`. A magpie that serves no pages (a command such as `magpie plugin update`, `servesPages` in `internal/cli`) starts its host with each service its plugin's option moves on a free port of its own (`plugin.ServePages`, `hostOptions`): a plugin that waits on its port, as page-chat does, loads at once beside the app's host holding it, and doesn't go on trying for it to take it when the app's host restarts (#5187). A service no option moves is started as before. Tests: `TestHostServingNoPagesLeavesHeldPort`, `TestHostOptionsMoveOnlyTheService`, `TestServesPages`. | the window, no built-in plugin: the page is the plugin's own on/off | [`page.go`](../../internal/plugin/page.go), [`pluginpage.go`](../../internal/gui/pluginpage.go), [`pagebridge.js`](../../internal/gui/pagebridge.js), [`pluginpages.js`](../../internal/gui/assets/pluginpages.js) | diff --git a/docs/subsystems/provider-plugins.md b/docs/subsystems/provider-plugins.md index 584eb47c6..7e6f4cac5 100644 --- a/docs/subsystems/provider-plugins.md +++ b/docs/subsystems/provider-plugins.md @@ -124,7 +124,7 @@ Embeddings, rerank, speech and transcriptions reach a plugin provider whatever A A plugin's model that says it gives video (`capabilities.output.video`, or `modalities.output: ["video"]`) makes videos (`customVideomakers`; the Grok plugin keeps its own). Start, poll and content go OpenAI-shaped through the plugin's `fetch` on the account, to `/videos`, `/videos/{id}` and `/videos/{id}/content` (`videoBase`, `Provider.OpenAIBase`): a POST of OpenAI's video body (`remoteVideoBody`: `model` as the plugin's id for it, `prompt`, `seconds`, `size`, `input_reference` as a data URL), answered `{id, object: "video", status, progress, model}`; the id is the vendor's, path-escaped in the GET. The poll and content GETs carry no model, so `pluginFetch` sends them under the loader's base (else the provider's `api`, else its npm's). The video's id names the account that started it (`keyMark`: `a` + `signer`), and `markedKey` asks after it on that account of the plugin's (`AlsoOn`) while it is signed in. Key account and model holds apply to all three routes (`videoAsker`, `videoModelHeld`, which needs the answer's `model`), and the start is in the usage ledger. `TestPluginMakesVideos`. -A plugin can instead mark single models of its list with `searches: true` (on the `config` hook's model or the `models` hook's list): a model that searches the web by itself when asked in plain words, such as Trae's search model. The host passes it through (`plugin.Model.Searches`), `pluginCatalog` makes it the catalog model's `WebSearch` "native", and the gateway offers the provider in Settings › Web search's picker and its own pick with those models alone (`pluginSearches`, `partSearcher`). +A plugin can instead mark single models of its list with `searches: true` (on the `config` hook's model or the `models` hook's list): a model that searches the web by itself when asked in plain words, such as Trae's search model. The host passes it through (`plugin.Model.Searches`), `pluginCatalog` makes it the catalog model's `WebSearch` "native", and the gateway offers the provider in Settings › Models › Web search's picker and its own pick with those models alone (`pluginSearches`, `partSearcher`). ## A plugin's service tiers diff --git a/internal/agent/dsbot.go b/internal/agent/dsbot.go index 6071e4c04..14062fc1b 100644 --- a/internal/agent/dsbot.go +++ b/internal/agent/dsbot.go @@ -132,5 +132,5 @@ func dsbot(home string) *Agent { var ( noticeDsbotUnopened = newNotice("DS Bot hasn't been opened yet: it starts on this the first time it opens.") noticeDsbotNewBots = newNotice("New Bots in DS Bot start on this, unless a default model for Bots is set in DS Bot. A Bot made before keeps its own model until you pick another for it.") - noticeDsbotSearch = newNotice("DS Bot's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Web search.") + noticeDsbotSearch = newNotice("DS Bot's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Models › Web search.") ) diff --git a/internal/agent/dsh.go b/internal/agent/dsh.go index f46d0982e..4b1fcc0fd 100644 --- a/internal/agent/dsh.go +++ b/internal/agent/dsh.go @@ -3462,7 +3462,7 @@ func dshSettingsEndpoint(path string) bool { var ( noticeDsh1 = newNotice("New dsh sessions start on this. A session made before keeps its model, open now or reopened later, until you pick another in it with /model or the model button by its message box. A dsh started with -p or in a terminal reads it at start-up.") noticeDsh2 = newNotice("dsh reads its config at start-up — restart open dsh sessions to use this.") - noticeDsh3 = newNotice("dsh's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Web search.") + noticeDsh3 = newNotice("dsh's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Models › Web search.") noticeDsh4 = newNotice("~/.dsh/settings.yaml sets its own DeepSeek endpoint or key, which dsh puts over magpie's; clear it in dsh's Models page to go through magpie.") noticeDsh5 = newNotice("DeepSeek Harness Desktop hasn't been opened yet: it starts on this the first time it opens.") ) diff --git a/internal/agent/dsh_search.go b/internal/agent/dsh_search.go index 10927a250..610a160ec 100644 --- a/internal/agent/dsh_search.go +++ b/internal/agent/dsh_search.go @@ -7,7 +7,7 @@ package agent // through magpie alone has no such key, and every search failed asking for // one (Packing1 on Discord). While dsh starts on a model of magpie's, magpie // points the row at the gateway, with its own key and that model, or the -// searcher Settings › Web search names when the user named one +// searcher Settings › Models › Web search names when the user named one // (dshSearchModel): the gateway answers the server tool as Anthropic does, // by the model's own search or magpie's (web_search_tool_result blocks // either way). A row of @@ -31,7 +31,7 @@ const ( // dshSearchModel is the model magpie's search row asks, for a dsh that // starts on start (a model of magpie's, without its prefix): the searcher -// Settings › Web search names, when the user named one, else start. Asking +// Settings › Models › Web search names, when the user named one, else start. Asking // start sent every search to the model dsh works on, which, unable to // search by itself, asked the named searcher in turn: two requests a // search, and a model that takes one call at a time timed out (我只会玩单机 diff --git a/internal/agent/dsh_search_test.go b/internal/agent/dsh_search_test.go index c1c3fff44..2bd44523f 100644 --- a/internal/agent/dsh_search_test.go +++ b/internal/agent/dsh_search_test.go @@ -113,7 +113,7 @@ func TestDshSearchThroughGateway(t *testing.T) { } } -// 我只会玩单机 on Discord: with a searcher named under Settings › Web search +// 我只会玩单机 on Discord: with a searcher named under Settings › Models › Web search // (GPT-6 Luna), dsh's search row still asked the model dsh starts on, which // can't search by itself and asked the searcher in turn: two requests a // search, and a model that takes one call at a time timed out. The row diff --git a/internal/gateway/search.go b/internal/gateway/search.go index bfae0c731..9c694381c 100644 --- a/internal/gateway/search.go +++ b/internal/gateway/search.go @@ -920,9 +920,9 @@ func (s *Server) modelSearch(ctx context.Context, query string) (string, []Hit, case errors.Is(first, errCantServe): return "", nil, fmt.Errorf("%w (no other provider could search in its place)", err) case len(settings.Load().SearcherThen) > 0: - return "", nil, fmt.Errorf("%w (the searchers picked in Settings › Web search, in their order: no other provider searches in their place)", err) + return "", nil, fmt.Errorf("%w (the searchers picked in Settings › Models › Web search, in their order: no other provider searches in their place)", err) } - return "", nil, fmt.Errorf("%w (the searcher picked in Settings › Web search: no other provider searches in its place)", err) + return "", nil, fmt.Errorf("%w (the searcher picked in Settings › Models › Web search: no other provider searches in its place)", err) } return said, hits, nil } diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.js index 29da9d0de..4fce18000 100644 --- a/internal/gui/assets/i18n.js +++ b/internal/gui/assets/i18n.js @@ -5248,10 +5248,10 @@ const I18N = { "agy takes magpie's gateway and model only from how it is started — start it with {command}": "agy 只从启动方式中获取 magpie 的网关和模型,请这样启动它:{command}", "Type agy in a new terminal: magpie added it to {profiles}, to start agy on magpie's gateway and model (in a terminal open now: {command}).": "在新终端中直接输入 agy 即可:magpie 已把它加入 {profiles},会用 magpie 的网关和模型启动 agy(已打开的终端中请用:{command})。", "dsh reads its config at start-up — restart open dsh sessions to use this.": "dsh 启动时读取配置,需重启已打开的 dsh 会话才会生效。", - "dsh's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Web search.": "dsh 的联网搜索经过 magpie,而 magpie 目前还没有可用的搜索方式:请添加一个自带搜索的供应商(DeepSeek、Claude、Codex 等),或在“设置 › 联网搜索”中配置搜索 API。", + "dsh's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Models › Web search.": "dsh 的联网搜索经过 magpie,而 magpie 目前还没有可用的搜索方式:请添加一个自带搜索的供应商(DeepSeek、Claude、Codex 等),或在“设置 › 模型 › 联网搜索”中配置搜索 API。", "DS Bot hasn't been opened yet: it starts on this the first time it opens.": "DS Bot 还没打开过:第一次打开时就会使用这项设置。", "New Bots in DS Bot start on this, unless a default model for Bots is set in DS Bot. A Bot made before keeps its own model until you pick another for it.": "DS Bot 里新建的 Bot 会使用这项设置,除非在 DS Bot 中设置了 Bot 的默认模型。之前建好的 Bot 保留自己的模型,直到你为它另选一个。", - "DS Bot's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Web search.": "DS Bot 的联网搜索经过 magpie,而 magpie 目前还没有可用的搜索方式:请添加一个自带搜索的供应商(DeepSeek、Claude、Codex 等),或在“设置 › 联网搜索”中配置搜索 API。", + "DS Bot's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Models › Web search.": "DS Bot 的联网搜索经过 magpie,而 magpie 目前还没有可用的搜索方式:请添加一个自带搜索的供应商(DeepSeek、Claude、Codex 等),或在“设置 › 模型 › 联网搜索”中配置搜索 API。", "fx reads its settings at start-up — restart open fx sessions to use this.": "fx 启动时读取设置,需重启已打开的 fx 会话才会生效。", "magpie couldn't ask WSL {distro} its networking mode (it has no wslinfo) and %UserProfile%\\.wslconfig doesn't set it to mirrored, so its {agent} was pointed at Windows ({url}) rather than 127.0.0.1; magpie listens there for WSL, and it answers once Windows' firewall lets WSL in. For 127.0.0.1, set networkingMode=mirrored under [wsl2] in %UserProfile%\\.wslconfig and run wsl --shutdown, then pick the model again.": "magpie 无法获取 WSL {distro} 的网络模式(其中没有 wslinfo),且 %UserProfile%\\.wslconfig 未将其设为 mirrored,因此其中的 {agent} 指向 Windows({url})而不是 127.0.0.1;magpie 会在该地址为 WSL 监听,Windows 防火墙放行 WSL 后即可连通。若要使用 127.0.0.1,请在 %UserProfile%\\.wslconfig 的 [wsl2] 下设置 networkingMode=mirrored 并运行 wsl --shutdown,然后重新选择模型。", "magpie restarted the app-server codex sessions share, which none was on, so new codex sessions have this; restart the Codex app, if it is open, to see it there.": "magpie 已重启 codex 会话共用的 app-server(当时没有会话连着它),新的 codex 会话已生效;如果 Codex 应用开着,需重启它才能看到。", @@ -10690,10 +10690,10 @@ const I18N = { "agy takes magpie's gateway and model only from how it is started — start it with {command}": "agy 只從啟動方式中取得 magpie 的閘道和模型,請這樣啟動它:{command}", "Type agy in a new terminal: magpie added it to {profiles}, to start agy on magpie's gateway and model (in a terminal open now: {command}).": "在新終端機中直接輸入 agy 即可:magpie 已把它加入 {profiles},會用 magpie 的閘道和模型啟動 agy(已開啟的終端機中請用:{command})。", "dsh reads its config at start-up — restart open dsh sessions to use this.": "dsh 啟動時讀取設定,需重啟已打開的 dsh 會話才會生效。", - "dsh's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Web search.": "dsh 的聯網搜尋經過 magpie,而 magpie 目前還沒有可用的搜尋方式:請新增一個自帶搜尋的供應商(DeepSeek、Claude、Codex 等),或在“設定 › 聯網搜尋”中設定搜尋 API。", + "dsh's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Models › Web search.": "dsh 的聯網搜尋經過 magpie,而 magpie 目前還沒有可用的搜尋方式:請新增一個自帶搜尋的供應商(DeepSeek、Claude、Codex 等),或在“設定 › 模型 › 聯網搜尋”中設定搜尋 API。", "DS Bot hasn't been opened yet: it starts on this the first time it opens.": "DS Bot 還沒開啟過:第一次開啟時就會使用這項設定。", "New Bots in DS Bot start on this, unless a default model for Bots is set in DS Bot. A Bot made before keeps its own model until you pick another for it.": "DS Bot 裡新建的 Bot 會使用這項設定,除非在 DS Bot 中設定了 Bot 的預設模型。之前建好的 Bot 保留自己的模型,直到你為它另選一個。", - "DS Bot's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Web search.": "DS Bot 的聯網搜尋經過 magpie,而 magpie 目前還沒有可用的搜尋方式:請新增一個自帶搜尋的供應商(DeepSeek、Claude、Codex 等),或在“設定 › 聯網搜尋”中設定搜尋 API。", + "DS Bot's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Models › Web search.": "DS Bot 的聯網搜尋經過 magpie,而 magpie 目前還沒有可用的搜尋方式:請新增一個自帶搜尋的供應商(DeepSeek、Claude、Codex 等),或在“設定 › 模型 › 聯網搜尋”中設定搜尋 API。", "fx reads its settings at start-up — restart open fx sessions to use this.": "fx 啟動時讀取設定,需重啟已打開的 fx 會話才會生效。", "magpie couldn't ask WSL {distro} its networking mode (it has no wslinfo) and %UserProfile%\\.wslconfig doesn't set it to mirrored, so its {agent} was pointed at Windows ({url}) rather than 127.0.0.1; magpie listens there for WSL, and it answers once Windows' firewall lets WSL in. For 127.0.0.1, set networkingMode=mirrored under [wsl2] in %UserProfile%\\.wslconfig and run wsl --shutdown, then pick the model again.": "magpie 無法取得 WSL {distro} 的網路模式(其中沒有 wslinfo),且 %UserProfile%\\.wslconfig 未將其設為 mirrored,因此其中的 {agent} 指向 Windows({url})而不是 127.0.0.1;magpie 會在該位址為 WSL 監聽,Windows 防火牆放行 WSL 後即可連通。若要使用 127.0.0.1,請在 %UserProfile%\\.wslconfig 的 [wsl2] 下設定 networkingMode=mirrored 並執行 wsl --shutdown,然後重新選擇模型。", "magpie restarted the app-server codex sessions share, which none was on, so new codex sessions have this; restart the Codex app, if it is open, to see it there.": "magpie 已重啟 codex 會話共用的 app-server(當時沒有會話連著它),新的 codex 會話已生效;如果 Codex 應用開著,需重啟它才能看到。", @@ -16134,10 +16134,10 @@ const I18N = { "agy takes magpie's gateway and model only from how it is started — start it with {command}": "agy は magpie のゲートウェイとモデルを起動方法からしか受け取りません。次のように起動してください:{command}", "Type agy in a new terminal: magpie added it to {profiles}, to start agy on magpie's gateway and model (in a terminal open now: {command}).": "新しいターミナルで agy と入力するだけです:magpie が {profiles} に追加し、magpie のゲートウェイとモデルで agy を起動します(開いているターミナルでは:{command})。", "dsh reads its config at start-up — restart open dsh sessions to use this.": "dsh は起動時に設定を読み込みます。反映するには開いている dsh セッションを再起動してください。", - "dsh's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Web search.": "dsh のウェブ検索は magpie を経由しますが、magpie にはまだ検索手段がありません。自前で検索するプロバイダ(DeepSeek、Claude、Codex など)を追加するか、「設定 › ウェブ検索」で検索 API を設定してください。", + "dsh's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Models › Web search.": "dsh のウェブ検索は magpie を経由しますが、magpie にはまだ検索手段がありません。自前で検索するプロバイダ(DeepSeek、Claude、Codex など)を追加するか、「設定 › モデル › ウェブ検索」で検索 API を設定してください。", "DS Bot hasn't been opened yet: it starts on this the first time it opens.": "DS Bot はまだ一度も開かれていません。初めて開いたときからこの設定で始まります。", "New Bots in DS Bot start on this, unless a default model for Bots is set in DS Bot. A Bot made before keeps its own model until you pick another for it.": "DS Bot で新しく作る Bot はこの設定で始まります(DS Bot で Bot の既定モデルを設定している場合を除く)。以前に作った Bot は、別のモデルを選ぶまで自分のモデルのままです。", - "DS Bot's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Web search.": "DS Bot のウェブ検索は magpie を経由しますが、magpie にはまだ検索手段がありません。自前で検索するプロバイダ(DeepSeek、Claude、Codex など)を追加するか、「設定 › ウェブ検索」で検索 API を設定してください。", + "DS Bot's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Models › Web search.": "DS Bot のウェブ検索は magpie を経由しますが、magpie にはまだ検索手段がありません。自前で検索するプロバイダ(DeepSeek、Claude、Codex など)を追加するか、「設定 › モデル › ウェブ検索」で検索 API を設定してください。", "fx reads its settings at start-up — restart open fx sessions to use this.": "fx は起動時に設定を読み込みます。反映するには開いている fx セッションを再起動してください。", "magpie couldn't ask WSL {distro} its networking mode (it has no wslinfo) and %UserProfile%\\.wslconfig doesn't set it to mirrored, so its {agent} was pointed at Windows ({url}) rather than 127.0.0.1; magpie listens there for WSL, and it answers once Windows' firewall lets WSL in. For 127.0.0.1, set networkingMode=mirrored under [wsl2] in %UserProfile%\\.wslconfig and run wsl --shutdown, then pick the model again.": "magpie は WSL {distro} のネットワークモードを取得できず(wslinfo がありません)、%UserProfile%\\.wslconfig でも mirrored に設定されていないため、{agent} の接続先は 127.0.0.1 ではなく Windows({url})にしました。magpie はそこで WSL 向けに待ち受けており、Windows のファイアウォールが WSL を通せば応答します。127.0.0.1 にするには %UserProfile%\\.wslconfig の [wsl2] に networkingMode=mirrored を設定して wsl --shutdown を実行し、モデルを選び直してください。", "magpie restarted the app-server codex sessions share, which none was on, so new codex sessions have this; restart the Codex app, if it is open, to see it there.": "magpie は codex セッションが共有する app-server を再起動しました(接続中のセッションはありませんでした)。新しい codex セッションには反映されています。Codex アプリが開いている場合は、再起動すると反映されます。", @@ -21578,10 +21578,10 @@ const I18N = { "agy takes magpie's gateway and model only from how it is started — start it with {command}": "agy übernimmt magpies Gateway und Modell nur aus seinem Startbefehl – so starten: {command}", "Type agy in a new terminal: magpie added it to {profiles}, to start agy on magpie's gateway and model (in a terminal open now: {command}).": "Tippe agy in einem neuen Terminal: magpie hat es zu {profiles} hinzugefügt und startet agy mit magpies Gateway und Modell (in einem schon offenen Terminal: {command}).", "dsh reads its config at start-up — restart open dsh sessions to use this.": "dsh liest seine Konfiguration beim Start – offene dsh-Sitzungen neu starten, damit es gilt.", - "dsh's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Web search.": "Die Websuche von dsh läuft über magpie, das noch nichts zum Suchen hat: einen Anbieter einrichten, der selbst sucht (DeepSeek, Claude, Codex, …), oder eine Such-API unter Einstellungen › Websuche.", + "dsh's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Models › Web search.": "Die Websuche von dsh läuft über magpie, das noch nichts zum Suchen hat: einen Anbieter einrichten, der selbst sucht (DeepSeek, Claude, Codex, …), oder eine Such-API unter Einstellungen › Modelle › Websuche.", "DS Bot hasn't been opened yet: it starts on this the first time it opens.": "DS Bot wurde noch nie geöffnet: Beim ersten Öffnen startet es mit dieser Einstellung.", "New Bots in DS Bot start on this, unless a default model for Bots is set in DS Bot. A Bot made before keeps its own model until you pick another for it.": "Neue Bots in DS Bot starten damit, sofern in DS Bot kein Standardmodell für Bots gesetzt ist. Ein schon angelegter Bot behält sein eigenes Modell, bis du ein anderes für ihn wählst.", - "DS Bot's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Web search.": "Die Websuche von DS Bot läuft über magpie, das noch nichts zum Suchen hat: einen Anbieter einrichten, der selbst sucht (DeepSeek, Claude, Codex, …), oder eine Such-API unter Einstellungen › Websuche.", + "DS Bot's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Models › Web search.": "Die Websuche von DS Bot läuft über magpie, das noch nichts zum Suchen hat: einen Anbieter einrichten, der selbst sucht (DeepSeek, Claude, Codex, …), oder eine Such-API unter Einstellungen › Modelle › Websuche.", "fx reads its settings at start-up — restart open fx sessions to use this.": "fx liest seine Einstellungen beim Start – offene fx-Sitzungen neu starten, damit es gilt.", "magpie couldn't ask WSL {distro} its networking mode (it has no wslinfo) and %UserProfile%\\.wslconfig doesn't set it to mirrored, so its {agent} was pointed at Windows ({url}) rather than 127.0.0.1; magpie listens there for WSL, and it answers once Windows' firewall lets WSL in. For 127.0.0.1, set networkingMode=mirrored under [wsl2] in %UserProfile%\\.wslconfig and run wsl --shutdown, then pick the model again.": "magpie konnte WSL {distro} nicht nach seinem Netzwerkmodus fragen (es hat kein wslinfo), und %UserProfile%\\.wslconfig setzt ihn nicht auf mirrored, daher zeigt sein {agent} auf Windows ({url}) statt auf 127.0.0.1; dort lauscht magpie für WSL, und es antwortet, sobald die Windows-Firewall WSL durchlässt. Für 127.0.0.1 networkingMode=mirrored unter [wsl2] in %UserProfile%\\.wslconfig setzen, wsl --shutdown ausführen und das Modell erneut wählen.", "magpie restarted the app-server codex sessions share, which none was on, so new codex sessions have this; restart the Codex app, if it is open, to see it there.": "magpie hat den App-Server, den codex-Sitzungen teilen, neu gestartet (keine war verbunden), neue codex-Sitzungen haben es also; die Codex-App, falls offen, neu starten, um es dort zu sehen.", @@ -21882,10 +21882,10 @@ const NOTICES = [ "an open Claude Code session keeps the effort it started with — restart it to use this.", "an open Claude Code session keeps the ultracode it started with — restart it to use this.", "dsh reads its config at start-up — restart open dsh sessions to use this.", - "dsh's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Web search.", + "dsh's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Models › Web search.", "DS Bot hasn't been opened yet: it starts on this the first time it opens.", "New Bots in DS Bot start on this, unless a default model for Bots is set in DS Bot. A Bot made before keeps its own model until you pick another for it.", - "DS Bot's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Web search.", + "DS Bot's web search goes through magpie, which has nothing to search with yet: set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Models › Web search.", "fx reads its settings at start-up — restart open fx sessions to use this.", "magpie couldn't ask WSL {distro} its networking mode (it has no wslinfo) and %UserProfile%\\.wslconfig doesn't set it to mirrored, so its {agent} was pointed at Windows ({url}) rather than 127.0.0.1; magpie listens there for WSL, and it answers once Windows' firewall lets WSL in. For 127.0.0.1, set networkingMode=mirrored under [wsl2] in %UserProfile%\\.wslconfig and run wsl --shutdown, then pick the model again.", "magpie restarted the app-server codex sessions share, which none was on, so new codex sessions have this; restart the Codex app, if it is open, to see it there.", diff --git a/internal/gui/search_mix_test.go b/internal/gui/search_mix_test.go index df7bcbcc0..6dc937fb5 100644 --- a/internal/gui/search_mix_test.go +++ b/internal/gui/search_mix_test.go @@ -9,7 +9,7 @@ import ( "github.com/yetone/magpie/internal/provider" ) -// Settings › Web search › Advanced asks the search APIs together (#2845's +// Settings › Models › Web search › Advanced asks the search APIs together (#2845's // mix, heyiwei5 on X): "mix" names two or more to ask at once, an empty // list asks them one at a time again, and the settings say which are // mixed. One named alone, or one not set up, is refused and changes diff --git a/internal/gui/searcher_relay_test.go b/internal/gui/searcher_relay_test.go index 21b2a9bb4..12e42531a 100644 --- a/internal/gui/searcher_relay_test.go +++ b/internal/gui/searcher_relay_test.go @@ -12,7 +12,7 @@ import ( // A custom provider on OpenAI's Responses API, saved by the editor with // "Searches the web by itself" ticked and its models typed in because it -// has no model list, is offered in Settings › Web search's searcher +// has no model list, is offered in Settings › Models › Web search's searcher // picker with those models (axelburks on Discord): it was named among the // relays to pick there, with nothing to pick. func TestSearcherPickerOffersResponsesRelay(t *testing.T) { diff --git a/site/docs-index.sums b/site/docs-index.sums index 9be4d2550..ea200ee29 100644 --- a/site/docs-index.sums +++ b/site/docs-index.sums @@ -31,7 +31,7 @@ d042047b8d4e480702a6986c52135154ded05388ff82e63f215d652ea55f0c6e docs/cursor-pr cf2645267d38d072f0467a02f6888b3a8848b27c3b14fa2461cda904ab07b793 docs/deepseek.html 592efa01b2064ec67e8b25b3a0ea93155498e6d0de494a6d33f961cf0a86851e docs/docker.html 0df2e589a2a8d2f0a91344d79ba15eff4a63dbd4d26e9a24601fec9c61a1d90e docs/droid.html -9f1fae865cb49fe2279ef8230b0abb7c4056509827840ccd2b055f814b0bfd3b docs/ds-bot.html +4ea324a67bf788a62585120a5685a66c977f1fccd7bf2ca39a4f5f6dae63fa04 docs/ds-bot.html 1e11349a9456e75797816776f8f420de351683df7d2aaf09c18688aaf5d781b5 docs/empryo.html 989c2fff08b49a8d93a787cd6570e84fc5227578688ccefb8b2af08bbca5901c docs/fireworks.html a63424b4dbe198bf56da31bcf74367271c567d3c5336c11ebaca98683978a1b5 docs/free-models.html @@ -82,7 +82,7 @@ f3b062404993ee53684e2282e28c21af93f13003e7d09a13e0a06efcf36d1634 docs/ja/craft- 1dce97081a8170168bc329f4f6c5cf555a207a8a90d375cb19de4c7ec9aba488 docs/ja/deepseek.html 23e29639adc543621b4b265b66e8effe63760389ed6b3badb11addf6cba00bb7 docs/ja/docker.html e1b20bd4d38845588252a3b083f13517309bea5fbc4c1961f1a9a0291a870a44 docs/ja/droid.html -a8e739bb4e75c7568fb7fbf3da1c3e565f9c7f4f285bfad32a025d89f693ddda docs/ja/ds-bot.html +82360502ec915c659a80d388eeb3fe359e68d65a86b5e4dcb46fbbdeefc488c7 docs/ja/ds-bot.html aa1c027a828a9f7cae0297aeb86e8d91759bf2cacb10875e56c1fe49f162a40c docs/ja/empryo.html 7b9ca0a2da3f1f4738a0a25486d4ce9983faa81a63d0733230d3286c17eada1f docs/ja/fireworks.html 95e71edf43ccb1bdaa8b31fdfa9cd877d4a0c9caae022ea9f69b95a159d9c0f2 docs/ja/free-models.html diff --git a/site/public/docs/ds-bot.html b/site/public/docs/ds-bot.html index d86e4f8a8..db7b5f040 100644 --- a/site/public/docs/ds-bot.html +++ b/site/public/docs/ds-bot.html @@ -208,7 +208,7 @@

New Bots and older ones

New Bots in DS Bot start on DSH's agent-default-model, so a Bot you make now is on the model you picked in magpie, unless a default model for Bots is set in DS Bot. A Bot made before keeps its own model until you pick another for it. magpie says so on the Agents page.

-

DS Bot's web search goes through magpie too. When magpie has nothing to search with yet, it asks you to set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Web search.

+

DS Bot's web search goes through magpie too. When magpie has nothing to search with yet, it asks you to set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Models › Web search.

Before DS Bot is opened

You can set it up before DS Bot is ever opened; magpie says it starts on this the first time it opens. DS Bot's first open writes the profile's files only where they are missing, so the patch list magpie made is kept.

Switching back

diff --git a/site/public/docs/ja/ds-bot.html b/site/public/docs/ja/ds-bot.html index 8c2f0b295..0485f35c7 100644 --- a/site/public/docs/ja/ds-bot.html +++ b/site/public/docs/ja/ds-bot.html @@ -208,7 +208,7 @@

新しい Bot と既存の Bot

DS Bot の新しい Bot は DSH の agent-default-model で始まるので、これから作る Bot は magpie で選んだモデルになります。DS Bot で Bot の既定モデルを設定している場合はそちらが優先です。前に作った Bot は、別のモデルを選ぶまで自分のモデルのままです。magpie もエージェントページでそう伝えます。

-

DS Bot のウェブ検索も magpie を通ります。magpie にまだ検索手段がないときは、自分で検索できるプロバイダー(DeepSeek、Claude、Codex など)か、設定 › ウェブ検索 の検索 API を設定するよう案内します。

+

DS Bot のウェブ検索も magpie を通ります。magpie にまだ検索手段がないときは、自分で検索できるプロバイダー(DeepSeek、Claude、Codex など)か、設定 › モデル › ウェブ検索 の検索 API を設定するよう案内します。

DS Bot を開く前に

一度も開いていない DS Bot にも先に設定できます。magpie は、初めて開いたときからこのモデルで始まると伝えます。DS Bot は初回起動時にないプロファイルファイルだけを書くので、magpie が先に作ったパッチリストは残ります。

元に戻す

diff --git a/site/public/llms-full.txt b/site/public/llms-full.txt index ca1181a88..6e8a44e88 100644 --- a/site/public/llms-full.txt +++ b/site/public/llms-full.txt @@ -6531,7 +6531,7 @@ New Bots in DS Bot start on DSH's agent-default-model, so a Bot you make now is ## Web search -DS Bot's web search goes through magpie too. When magpie has nothing to search with yet, it asks you to set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Web search. +DS Bot's web search goes through magpie too. When magpie has nothing to search with yet, it asks you to set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Models › Web search. ## Before DS Bot is opened diff --git a/site/public/search/en.json b/site/public/search/en.json index f7825721a..212075ebb 100644 --- a/site/public/search/en.json +++ b/site/public/search/en.json @@ -1 +1 @@ -[["/docs/agent-drift","Agent drift",[["","","When magpie connects an agent, it remembers what it set in the agent's config. From then on the Agents page keeps checking two things: whether the config still says what magpie set, and, when it does, whether the agent's latest requests actually reached magpie's gateway. When they don't, the agent's row is marked with the reason and a fix: usually Apply again (on the status line, Reconnect), or How to fix when an address doesn't answer or a proxy is in the way. Here are the five things magpie can say, one by one. Two things are not a problem: moving from one magpie model to another in the agent's own model picker isn't flagged, and a provider named magpie that you wrote by hand is yours, so magpie neither flags nor overwrites it."],["unwired","“No longer goes through magpie — its config was changed”","The model is still magpie's, but the part of the config that sends requests to magpie (the gateway's address, for one) was changed: by a hand edit, an update of the agent that rewrote its config, or another tool. Press Apply again magpie writes what it set once more and renews its record. The mark goes away. Restart the agent Most agents read their config at start-up, so one that is open needs reopening."],["replaced","“Was switched off {model} outside magpie”","magpie set a magpie model, and the config now has the agent's own model there, one that doesn't go through magpie. The detail says what the field is now and what magpie set. You have two choices: Apply again: magpie's model goes back, and so do the other fields magpie set with it, such as an effort. Keep current settings: the change was yours on purpose. magpie forgets what it set, keeps your config as it is and stops flagging it. The row menu has this item only in this case."],["bypassed","“Was used without going through magpie — restart it after applying”","The config is right, yet the agent was used after magpie set it up and none of its requests reached magpie. Most often the agent was already open before magpie changed its config and still runs on the old one; something outside the file, such as an environment variable, can also override it. The detail says which: Its last request went to another host, not magpie: it was started before magpie set it up and still runs on its old config. It couldn't reach magpie at a given time: magpie wasn't running then, so it has none of magpie's models. It was used at a given time, but none of its requests reached magpie. The fix each time is to quit and reopen the agent. Press Apply again first if you like: it renews the record, so a use before then no longer counts."],["unreachable","“Is set up, but nothing answers at the address it reaches magpie by”","The config is right, but the agent reaches magpie at an address other than this computer's loopback (127.0.0.1), nothing answers there, and magpie itself answers fine here. That is usually an agent in WSL, or a forward of your own. magpie tries the address from here in the background. When an agent in WSL is pointed at the address magpie listens on for WSL and nothing answers, Windows' firewall is keeping WSL out. Allow magpie when Windows asks, or run this in PowerShell as administrator (-Program is magpie.exe's real path; the detail gives the whole command): New-NetFirewallRule -DisplayName 'magpie (WSL)' -Direction Inbound -Action Allow -Profile Any -InterfaceAlias 'vEthernet (WSL*)' -Program '…\\magpie.exe' WSL's network counts as Public, so a rule for Private networks only doesn't do. On Windows 11 you can also turn on mirrored networking in .wslconfig, and WSL then reaches magpie at 127.0.0.1: # %UserProfile%\\.wslconfig [wsl2] networkingMode=mirrored Under WSL's NAT networking, Windows as WSL sees it answers only while something listens there: magpie itself with Settings › Network and sharing › Share on local network on (it then listens on every address, and asks other computers for a gateway key), or a forward of your own (netsh interface portproxy, which may need setting up again after Windows restarts). If it answers here and WSL still can't connect, it is the firewall: allow the gateway's port (3425 by default) for the WSL network. When the address a WSL distro reaches Windows at has moved, the detail names the new one and the button reads Use {url}: pressing it points the agent there. Outside WSL, whatever forwarded the address to magpie isn't listening any more: start it again, or point the agent at magpie's address on this computer."],["proxied","“Reaches magpie through a proxy that doesn't pass its requests on”","This one is Codex. Codex sends its requests for magpie through a proxy set in the environment or the system settings, and that proxy doesn't pass them back to magpie: every turn fails with 502 Bad Gateway, whichever model it is on. magpie asks which proxy Codex would use the way Codex does (a terminal's environment for Codex in a terminal, the login shell's for the ChatGPT app's Codex), and the detail names the proxy and where it is set. Any one of these fixes it: Have the proxy send 127.0.0.1 direct: a DIRECT rule for 127.0.0.0/8, or rule mode rather than global. When the proxy comes from a *_PROXY variable, add 127.0.0.1 to NO_PROXY where that variable is set. On Windows, add 127.0.0.1 to “Don't use the proxy server for addresses beginning with” in Windows' proxy settings (127.* there is not enough for Codex). On macOS and Linux, add NO_PROXY to your shell profile; Codex in a terminal and the ChatGPT app's Codex both read it: # ~/.zshrc export NO_PROXY=127.0.0.1 Then quit and reopen Codex."],["off","Disconnect from magpie","If you can't fix it now, or don't want the agent on magpie at all, pick Disconnect from magpie in the row menu: magpie puts the agent's config back as it was before and forgets what it set. To connect it again later, set it up on the Agents page."],["faq","FAQ","Why does magpie say the config was changed after I switched models in the agent? The model you switched to doesn't go through magpie. Pick Keep current settings to keep it, or Apply again to go back to magpie. Moving from one magpie model to another in the agent isn't flagged. It still says the agent bypassed magpie after Apply again? The agent was open before magpie set it up and still runs on its old config. Quit and reopen it; once a new request reaches magpie, the mark goes away. An agent in WSL can't reach magpie. What do I do? Most often Windows' firewall keeps WSL out: allow magpie when Windows asks, or run the New-NetFirewallRule command the detail gives in PowerShell as administrator. On Windows 11, networkingMode=mirrored in .wslconfig also works. Codex fails every turn with 502 and magpie says a proxy doesn't pass its requests on? A proxy takes Codex's requests for magpie. Have it send 127.0.0.1 direct, or add 127.0.0.1 to NO_PROXY, then reopen Codex. Related: Use DeepSeek, Kimi, GLM, Claude or any model in Codex and Remote magpie. Something else fails? See Fixing common errors, or ask on Discord."]]],["/docs/aionui","AionUi",[["","","AionUi is an Electron desktop app that runs Claude Code, Codex and Gemini CLI, and has a chat of its own. It keeps its model providers in its own database, their keys encrypted, so magpie writes nothing there. It opens AionUi's own add-provider link instead, which brings up AionUi's add-model form with magpie filled in, for you to confirm in AionUi. AionUi then has every model in magpie: DeepSeek, GLM, Kimi, Qwen, an OpenAI or Anthropic key, and the Claude, ChatGPT or Copilot subscription you signed in to."],["add","Add magpie to AionUi","Open AionUi once Once AionUi has run, its data folder has an aionui folder and magpie's Agents page lists it. Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Click Add magpie On AionUi's row, click Add magpie. AionUi opens Settings → Model's add form with magpie filled in: name magpie, platform custom (OpenAI-compatible), the gateway's address and a key. Confirm it in AionUi Nothing is added until you do. The link magpie opens looks like this: aionui://add-provider?api_key=…&base_url=http%3A%2F%2F127.0.0.1%3A3425%2Fv1&name=magpie&platform=custom If nothing opens, nothing on this computer handles AionUi's links yet: open AionUi once or install it again, then click Add magpie again."],["models","Picking models","The magpie provider's address ends in /v1, as AionUi's own OpenAI preset does, and it lists every model in magpie from the gateway, named provider/model (for example deepseek/deepseek-v4-pro). A provider you add to magpie later shows up when AionUi fetches the list again, with nothing changed in AionUi. Several accounts behind one model, the rest after a 429 and fallback work as they do for every other agent."],["cli","From the command line","magpie aionui add # opens AionUi to add magpie; confirm it there"],["status","How magpie knows it was added","magpie reads AionUi's database (aionui/aionui-backend.db in AionUi's data folder: ~/Library/Application Support/AionUi on macOS, %APPDATA%\\AionUi on Windows, ~/.config/AionUi on Linux) read-only, for a provider at the gateway's address. It can read it while AionUi runs, and never writes it. Once there is one, the row says it's added, and you can click again to add it again. When the database can't be read, magpie says it doesn't know, not that it isn't added."],["usage","Usage and keys","The key in the link is AionUi's own, so its requests are counted as AionUi's in magpie's usage, apart from other agents."],["faq","FAQ","Do I need an API key to use Claude or ChatGPT in AionUi? No. Sign in to a Claude, ChatGPT or Copilot subscription in magpie and its models show up under AionUi's magpie provider. Does magpie change AionUi's settings? No. magpie opens AionUi's own add-model form, and you confirm it. It only reads AionUi's database to show whether magpie was added. What address and platform does the magpie provider use? Platform custom (OpenAI-compatible), at http://127.0.0.1:3425/v1, or the gateway address you set in magpie. AionUi isn't on magpie's Agents page. magpie lists AionUi once it has run on this computer. Open AionUi once, then look again. More desktop apps on the same models: Every model in Cherry Studio, through magpie and AstrBot on any model. Using coding agents too? See Subscriptions in any agent. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/alma","Alma",[["","","Alma is a desktop AI chat app that keeps its providers and settings in the app, not in a file magpie can edit. magpie adds a provider named magpie through the local API Alma serves while it runs, and makes it the default model, so Alma runs on any model in magpie: DeepSeek, GLM, Kimi, Qwen, Claude or a ChatGPT subscription."],["on","Set up Alma","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Open Alma magpie can change Alma's settings only through a running Alma. When it isn't open, magpie says to open Alma and try again. Pick a model for Alma on the Agents page Pick a model via magpie; it becomes Alma's default model. magpie alma deepseek/deepseek-v4-pro"],["api","Through Alma's local API","While it runs, Alma serves a local API at http://localhost:23001, and that is what magpie uses: GET /api/providers Alma's providers POST /api/providers magpie's provider PUT /api/providers/:id/models its model list GET /api/settings, PUT it back chat.defaultModel, imageGen.model magpie's provider is of type openai at the gateway's /v1, with magpie's own key for Alma. Alma's requests carry only the AI SDK's User-Agent, so the key is how the gateway knows them for Alma's. The default model is chat.defaultModel, as providerId:model; Alma takes only the whole settings, so magpie puts the rest back as they were."],["models","Models and thinking levels","Alma works out a model's capabilities from models.dev by its id, and magpie's ids (codex/gpt-5.5) aren't models.dev's, so such a model would show no thinking. magpie tells Alma each model's capabilities: a model that reasons comes with the thinking levels Alma knows, and its window, output limit and images when magpie knows them. One you set yourself in Alma's model options (tool calling) stays as you set it. Models added or dropped in magpie reach Alma while it is open."],["image","Image generation","When magpie has an image model and Alma's image generation model is Auto, picking one of magpie's models for Alma makes magpie's image model Alma's too. An image model you picked is left as it is."],["off","Switching back","Switching back clears Alma's default model when it is magpie's, leaving it to Alma, puts an image generation model of magpie's back to Auto, and removes magpie's provider. If Alma has been uninstalled, magpie remembers, and takes its provider out once Alma is installed again and answers. magpie alma default"],["faq","FAQ","Can Alma run on DeepSeek, GLM or a ChatGPT subscription? Yes. Open Alma and pick a via-magpie model for Alma on magpie's Agents page. magpie adds a magpie provider and makes it the default model. magpie says Alma isn't running. Why? Alma's settings change only through the local API it serves while it runs. Open Alma and try again. Why do magpie's models have thinking levels in Alma? magpie tells Alma each model's capabilities: whether it reasons, its thinking levels and its window. What happens when I switch back? magpie's provider is removed, a default model of magpie's is cleared for Alma to pick, and the image generation model goes back to Auto. More desktop apps on the same models: Kun on any model, Every model in Cherry Studio, through magpie, OpenHanako on any model and OpenPencil on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/alternatives","magpie vs CC Switch vs CCR",[["","","magpie, CC Switch and Claude Code Router (CCR) all help you run AI coding agents on the providers and models you choose. They overlap, and each is good at something. This page puts them side by side, using each project’s own README for the other two and magpie’s source for magpie. CC Switch A desktop app (Tauri 2) that manages twelve tools, from Claude Code, Codex and Gemini CLI to OpenCode, OpenClaw, Hermes, Pi and Kimi Code. It switches a tool’s provider by writing only the key fields of its config, backing it up first, and keeps MCP servers, skills and prompts for every tool in one place. An optional local routing mode converts API formats and fails over through a queue. It ships over 90 provider presets. Claude Code Router A local model gateway and control plane at 127.0.0.1:3456. Agents such as Claude Code, Codex, Kimi CLI, Kilo Code, OpenCode and Pi get one stable endpoint through an agent profile, and routing rules decide where each request goes: conditions on headers and bodies, rewrites, retries, credential pools and ordered fallbacks. It adds tools to models (vision, web search, MCP, browser automation) and logs every request with its cost. Desktop app, npm CLI with a web UI, or Docker. magpie A menu bar (tray) app with a window, a TUI and a CLI. It points each agent at a local gateway at 127.0.0.1:3425 that speaks OpenAI Chat Completions, OpenAI Responses, Anthropic Messages and Gemini and translates between them, so any agent can use any model, including a Claude, ChatGPT, GitHub Copilot or Gemini sign-in. Several keys and sign-ins can stand behind one model, with failover before the agent sees an error."],["table","Side by side","magpie CC Switch as of its README, Nov 2026 Claude Code Router as of its README, Nov 2026 Agents Over 20, among them Claude Code, Codex, Gemini CLI, OpenCode, Pi, Goose, Crush, GitHub Copilot CLI, VS Code, Kimi Code, Hermes Agent and Snow CLI 12: Claude Code, Claude Desktop, Codex, Gemini CLI, Grok Build, OpenCode, OpenClaw, Hermes, Pi, MiniMax Code, Kimi Code, Oh My Pi Claude Code, Claude Design, Codex, Grok CLI, Kimi CLI, Kilo Code, OpenCode, Pi, ZCode, WorkBuddy, and compatible API clients How it switches Edits the one setting it changes in each agent’s config and points the agent at its local gateway Direct: rewrites the key fields of the tool’s config. Routing (optional): a local proxy, default port 15721 Local gateway; an agent profile connects the agent to it Protocol translation OpenAI Chat Completions, OpenAI Responses, Anthropic Messages and Gemini, both directions In Routing mode, for Claude Code, Codex, Gemini CLI and Grok Build Providers in OpenAI Chat / Responses, Anthropic Messages or Gemini format behind one endpoint Subscription sign-ins Claude Pro/Max, ChatGPT Plus/Pro, GitHub Copilot, Gemini Code Assist, Antigravity Accounts (Beta): GitHub Copilot, ChatGPT, xAI (Grok), Kimi Code Not stated (providers can import a local login where supported) Routing and failover Several keys and sign-ins behind one model; picks by intent, order, round robin, least used or quota; rests rate-limited accounts and fails over Failover queue per tool with a circuit breaker (Routing mode); Aggregation puts several providers’ models in one list Conditions on headers and bodies, prefixes, rewrites, retries, credential pools, key rotation, ordered fallback models GUI and CLI Menu bar / tray app with a window, TUI, CLI; Docker Desktop app with a tray menu; CLI not stated Desktop app; npm CLI with a browser UI; Docker Platforms macOS (signed and notarised), Windows, Linux Windows 10+, macOS 12+ (signed and notarized), Linux (glibc 2.35+, WebKitGTK 4.1) Windows, Linux (AppImage), macOS (Apple Silicon, Intel); signing not stated License MIT MIT MIT The CC Switch and Claude Code Router columns say only what their READMEs said in November 2026; where a README doesn’t say, the cell says “not stated”. Both projects move quickly, so check their pages for what has changed since."],["fit","Which one fits","CC Switch fits when you mostly switch each tool between providers by hand and want its config left close to how you wrote it, with MCP servers, skills and prompts managed for every tool from one app. Its provider presets are the largest of the three, and it reaches tools the others don’t list, such as Claude Desktop, OpenClaw and Oh My Pi. Claude Code Router fits when you want a gateway you can program: rules on headers and bodies, request rewrites, credential pools, client keys with their own quotas, and a log of every request with its cost. It also adds tools such as web search and browser automation to models that lack them, and runs headless from npm or Docker. magpie fits when you use several agents and want each on a different model, Codex on DeepSeek and Claude Code on Kimi, say, or a Claude or ChatGPT subscription in another agent. Every agent goes through one translating gateway, and one model can be served by several accounts that take turns and fail over. They can sit side by side. magpie’s gateway is an OpenAI-, Anthropic- and Gemini-compatible endpoint, so a tool that takes a custom base URL can use it as a provider."],["faq","FAQ","What is a CC Switch alternative? magpie and Claude Code Router both cover part of what CC Switch does. magpie switches the model of each agent and runs every agent through one translating gateway with subscription sign-ins and failover; Claude Code Router is a programmable local gateway with routing rules and request logs. What is a claude-code-router alternative? CC Switch, if you mostly want to switch each tool’s provider and keep its config as written; magpie, if you want a translating gateway for many agents with Claude, ChatGPT, Copilot or Gemini sign-ins and accounts that fail over. CC Switch vs claude-code-router: what is the difference? By their READMEs, CC Switch is a desktop manager that rewrites each tool’s config and offers an optional local routing proxy, while Claude Code Router is a local gateway at 127.0.0.1:3456 that agents connect to through profiles and that routes each request by rules. Does magpie rewrite my agent’s config like CC Switch? It edits only the one setting it changes in each agent’s config file, keeping comments and order, and points the agent at its gateway at 127.0.0.1:3425. Picking the agent’s own model again puts the old value back. Is magpie a proxy like claude-code-router? Yes, magpie runs a local gateway too. It speaks OpenAI Chat Completions, OpenAI Responses, Anthropic Messages and Gemini and translates between them, so Codex, which speaks only Responses, and Claude Code, which speaks only Messages, can use any provider’s model. Are all three free and open source? Yes. magpie, CC Switch and Claude Code Router are each released under the MIT license. Guides: Models in Claude Code, Models in Codex, Subscriptions in any agent. Ask on Discord if you get stuck."]]],["/docs/ante","Ante",[["","","Ante is antigma.ai's coding agent in the terminal, the ante command. It ships its own providers, and takes more of yours in catalog.json, merged on top. magpie adds a provider named magpie there and has Ante start on it in settings.json, so Ante runs on any model in magpie: DeepSeek, GLM, Kimi, Qwen, Claude or a ChatGPT subscription."],["on","Set up Ante","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Pick a model for Ante on the Agents page Pick a model via magpie. Restart Ante Ante reads catalog.json once per process, so a running one needs a restart. magpie ante deepseek/deepseek-v4-pro"],["catalog","catalog.json","The file is ~/.ante/catalog.json, or $ANTE_HOME/catalog.json when ANTE_HOME is set. A key under providers is what --provider takes. magpie's entry points at the gateway's /v1 on the OpenAiCompatible wire style, which is how Ante speaks Chat Completions, and the gateway takes every model on it. magpie's models are listed in preferred_models, Ante's model picker. // ~/.ante/catalog.json { \"providers\": { \"magpie\": { \"display_name\": \"magpie\", \"base_url\": \"http://127.0.0.1:3425/v1\", \"wire_style\": \"OpenAiCompatible\", \"preferred_models\": [ { \"id\": \"deepseek/deepseek-v4-pro\", \"display_name\": \"…\", \"context_limit\": …, \"max_tokens\": …, \"supported_efforts\": […] } ] } } } The entry has no auth: the gateway listens on this computer and lets its requests in without a key, and Ante counts a provider with no auth block as signed in. A bearer env_key would mean putting a key into Ante's environment, which is yours to decide. An auth block, http_headers or extra_body you add inside magpie's entry stays, which is how a gateway shared on the network or reached from WSL gets its key. Your own providers and the models section are left alone. magpie doesn't write support_vision either: Ante takes a model as seeing images unless told otherwise, and false would have Ante drop your images before the gateway, which can describe them to a model that can't see. A routing group gets no thinking levels, since which member answers each turn, and what it takes, is the group's to decide."],["settings","settings.json","Being in the catalog isn't enough. The provider a session starts on is provider and model in ~/.ante/settings.json; with neither set, Ante takes the first signed-in provider in catalog order, and the ones it ships come first. So magpie sets those two as well, and saves what was there. // ~/.ante/settings.json { \"provider\": \"magpie\", \"model\": \"deepseek/deepseek-v4-pro\" }"],["restart","Restart Ante","Ante reads the catalog once per process, so an edit needs a restart. It parses the file leniently: an entry it can't read is skipped with a notice and the rest still load, so a bad entry would cost you magpie's provider, not your own."],["off","Switching back","Switching back puts Ante's original provider and model back (or nothing, which leaves Ante to its own detection) and takes magpie's entry out of the catalog, with a providers map left empty and files magpie made. A provider you picked in Ante's own /providers while magpie was set up is your choice and stands. magpie ante default"],["faq","FAQ","Can Ante run on DeepSeek, GLM or a ChatGPT subscription? Yes. Pick a via-magpie model for Ante on magpie's Agents page, then restart Ante. Why didn't Ante use magpie's provider when it was in the catalog? Ante starts on provider and model in settings.json, else the first signed-in provider it ships. magpie sets those two as well. Why is there no API key in magpie's entry? The gateway takes no key on this computer, and Ante counts a provider with no auth as signed in. An auth block you add stays. Does switching back restore my settings? Yes. Your original provider and model go back and magpie's entry comes out; a choice you made in Ante since stands. More agents on the same models: omp on any model, StepCode on any model, Avibe on any model and Aside on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/anthropic","Anthropic in Claude Code, Codex, Gemini CLI and OpenCode",[["","","Anthropic serves Claude on its Messages API, at api.anthropic.com. Add an Anthropic API key to magpie once, and Claude Code, Codex, Gemini CLI, OpenCode and every other agent you connect can use Claude models through magpie’s local gateway at 127.0.0.1:3425, each agent with a model of its own. Agents that speak another API are translated on the way."],["add","Add Anthropic","Get a key Make one on console.anthropic.com. An API key starts with sk-ant-api. Add the provider In magpie’s Providers tab, press + Add provider, pick Anthropic, paste the key and save. magpie asks Anthropic which models the key can use. Pick it for an agent In the Agents tab, click the model on the agent’s row and choose a Claude model such as claude-opus-5-5. magpie provider add anthropic magpie provider test anthropic Model ids in magpie are provider/model, so Anthropic’s read anthropic/claude-opus-5-5: the provider, then Anthropic’s own id. The key is kept in magpie’s settings; magpie doesn’t take it from your shell. Already set Anthropic up in OpenCode or Alma? magpie’s import from those apps brings it in as the Anthropic provider. This page is about an API key. A Claude Pro or Max subscription is signed in to separately; see Subscriptions in any agent."],["endpoints","Endpoints","API Address Used for Messages https://api.anthropic.com/v1/messages every agent’s requests: Claude Code’s as sent, Codex’s, Gemini CLI’s and OpenCode’s translated Models https://api.anthropic.com/v1/models the model list magpie’s Anthropic provider has no Chat Completions or Responses address, so an agent that speaks either, or Google’s Gemini API, is translated to Messages and the reply translated back, streaming and tool calls included."],["models","Model list","magpie fetches the list from Anthropic, at https://api.anthropic.com/v1/models, every page of it, so agents see the models your key can use. Names, context windows and prices come from models.dev’s anthropic catalog. Pick the models agents see in the provider’s model list, or from the terminal: magpie provider models anthropic +claude-opus-5-5 +claude-sonnet-5-5 +claude-haiku-5-5 magpie provider refresh-every anthropic 1d Claude Opus 5.5, Sonnet 5.5 and Haiku 5.5 take 1M tokens. On a window that long, Codex compacts a conversation at 272K rather than send ever more of it on every turn; magpie model compact off lets it run to the whole window. In Claude Code a Claude model runs to its own window, as Anthropic runs it: 200K unless a [1m] one is picked."],["agents","In each agent","magpie claude anthropic/claude-opus-5-5 magpie codex anthropic/claude-opus-5-5 magpie gemini model anthropic/claude-sonnet-5-5 magpie opencode anthropic/claude-sonnet-5-5 Claude Code speaks Anthropic Messages, so its requests go to Anthropic as Claude Code sent them, its own cache marks, thinking and betas included, with the fixes below. Models in Claude Code. Codex speaks OpenAI Responses, which Anthropic doesn’t serve. magpie translates each request to Messages and the reply back, marks the prompt for Anthropic’s cache, and keeps Claude’s signed thinking across a tool loop. Models in Codex. Gemini CLI speaks Google’s Gemini API. magpie translates each request to Messages and the reply back. Models in Gemini CLI. OpenCode speaks Chat Completions to magpie, so its requests are translated to Messages too. Models in OpenCode."],["shaping","What magpie does for Anthropic","A request magpie translates is built the way Anthropic’s Messages API wants it, and a few things Anthropic would refuse are fixed on Claude Code’s requests too: Prompt caching. Anthropic caches a prompt only up to a block marked with cache_control, and a request from another API has no marks. magpie marks the system prompt (or the last tool, when there is no system prompt) and the conversation’s last block, two marks at most, so the next turn reads what came before from the cache. A request that brings cache_control of its own keeps its marks, and magpie adds none. An hour’s cache for Codex. Codex’s turns are often more than five minutes apart, so the marks magpie adds to its requests last an hour, unless Codex asks prompt_cache_retention in_memory. An upstream that turns the hour’s ttl away is asked again with five-minute marks, and magpie remembers it. Signed thinking. Claude signs its thinking and wants it back on a tool loop’s next turn. Codex gets each thinking block, signature included, in its reasoning item’s encrypted_content, and magpie sends it back to Anthropic as it was; redacted thinking goes back sealed. Thinking with no signature is left out, and so is thinking another vendor signed, such as DeepSeek’s earlier in a routing group, which Claude refuses. Tool calls. A call an interrupted turn left unanswered gets a result saying it is unavailable, and a result for a call Anthropic never saw becomes text, where Anthropic would refuse the request. A history with calls but no tools declared declares them, with tool_choice none. A required tool goes as any, a named one as tool, and parallel calls turned off as disable_parallel_tool_use. Sampling. Opus 4.7 and later, Sonnet 5 and 5.5, Haiku 5.5 and Fable 5 refuse temperature, top_p and top_k, which Claude Code’s auto mode classifier sends. magpie leaves them out for those models. Betas. The betas an agent asks in anthropic-beta go on to Anthropic, save Claude Code’s own sign-in beta (oauth-…), which names a credential that never leaves magpie. Structured output. A request for JSON in a schema goes to Anthropic as output_config.format."],["reasoning","Reasoning","Effort. Claude models from 4.6 on think adaptively. A translated request’s effort goes as output_config.effort, with thinking adaptive and its summary shown (display: summarized), since Opus 4.7 and later leave the thinking text out unless asked. Opus and Sonnet 4.6 have no xhigh, so xhigh is asked as max. Budgets. Older Claude models get a thinking budget: 4,096 tokens at low, 10,000 at medium, 24,000 at high, 32,000 at xhigh and max, fitted under the request’s max_tokens. A budget to a newer model. A request with a thinking budget to a model from 4.6 on, which Claude Opus 5.5 refuses (“requires adaptive thinking”), goes as adaptive thinking, the budget asked as the nearest effort. Reasoning off. Codex’s or a Chat client’s effort none turns thinking off, not down to a low budget. Each model takes off its own way: Sonnet 5.5 is sent between_tools, an effort above high asked as high; Opus 5.5 and Fable 5 always think, so thinking is left out; Opus 5 and Haiku 5.5 are asked high in place of xhigh or max; older Claudes take it as sent. Claude Code’s requests with thinking off are fitted the same way."],["search","Web search","Anthropic searches the web itself. Claude Code’s WebSearch goes to Anthropic as it is. When Codex, Gemini CLI or a Chat client asks to search, magpie offers Claude Anthropic’s own web_search_20250305 tool, up to five searches a request, rather than magpie’s searcher."],["cost","Cost and usage","Cache tokens. The Usage tab counts cache reads, five-minute cache writes and hour-long cache writes apart from the rest of the prompt, as Anthropic reports them. Cost. The Usage tab prices each call with Anthropic’s prices from models.dev. An hour-long write is priced at twice the input price where the catalog gives none, as Anthropic bills it. magpie reads no balance from Anthropic; type it in with key-balance, and the Usage page shows it less what magpie has priced the key’s calls at since. Keeping the cache. With several keys, a conversation stays on its key while its cache is worth keeping, 1,024 tokens or more, and still warm: read within the last five minutes, or within the hour when it was written for an hour."],["keys","Several keys and failover","One Anthropic provider can hold several keys: press Add another key under it, or paste several at once. Requests go to the first key that’s on, and when it runs out or is rate limited the next one takes over. Spend caps. spend-cap stops a key at a dollar amount a day, a month or in all, as the Usage tab prices its calls; routing then goes on to the other keys and the fallbacks. Fallbacks. fallback names where requests go when Anthropic is out of quota or down: another provider’s model or a routing group. Workspaces. A key that reaches several workspaces names the one each request is for with the anthropic-workspace-id header. Add the provider again under an id of its own, with the header set in its Headers field or from the terminal; its models then read anthropic-ws2/…. magpie provider spend-cap anthropic 20 month magpie provider key-balance anthropic 25 magpie provider fallback anthropic deepseek/deepseek-v4-pro magpie provider add anthropic id=anthropic-ws2 name=\"Anthropic WS2\" header.anthropic-workspace-id=wrkspc_…"],["trouble","Troubleshooting","“requires adaptive thinking”. A thinking budget sent to a model from 4.6 on. magpie sends it as adaptive thinking with the nearest effort; see Reasoning. 400 when thinking is turned off. Sonnet 5.5, Opus 5.5 and Fable 5 each refuse disabled, and Opus 5 and Haiku 5.5 refuse it at xhigh and max. magpie sends each model off the way it takes it. “temperature is deprecated for this model”. magpie leaves temperature, top_p and top_k out for the models that refuse them. “tool_use ids were found without tool_result blocks”. An interrupted turn left a call unanswered. In a request magpie translates, the call gets a result saying it is unavailable. “Invalid signature in thinking block”. The conversation ran on another vendor first. magpie leaves thinking another vendor signed, or left unsigned, out of what goes to Claude. A 400 about cache_control and ttl. The upstream doesn’t take the hour-long marks magpie adds for Codex. magpie asks again with five-minute marks and keeps to them for that provider. “this is an Anthropic API key, not a setup-token”. The key went to the Claude subscription’s sign-in. Add it as the Anthropic provider instead. Checking a key. magpie provider test anthropic sends a tiny request through each endpoint, or to each model you name. Add --as codex or --as claude-code to send it the way that agent would. Claude on AWS: Amazon Bedrock in Claude Code, Codex and other agents."],["faq","FAQ","How do I use an Anthropic API key in Claude Code? Add your Anthropic API key in magpie (Providers, Add provider, Anthropic), then pick a Claude model such as claude-opus-5-5 on Claude Code’s row, or run magpie claude anthropic/claude-opus-5-5. Claude Code speaks Anthropic Messages, so its requests go to https://api.anthropic.com as it sent them, with what the model would refuse fixed on the way. Can Codex use Claude models? Yes. Codex speaks OpenAI Responses, which Anthropic doesn’t serve, so magpie translates each request to the Messages API and the reply back. It marks the prompt for Anthropic’s cache with marks that last an hour, and keeps Claude’s signed thinking across a tool loop in Codex’s encrypted_content. Run magpie codex anthropic/claude-opus-5-5. How do I use Claude in OpenCode through magpie? Pick the model in magpie, or run magpie opencode anthropic/claude-sonnet-5-5. OpenCode speaks Chat Completions to magpie, so magpie translates its requests to Anthropic’s Messages API, marks the prompt for the cache and fits the reasoning effort to the model. Can Gemini CLI use Claude? Yes. Gemini CLI speaks Google’s Gemini API, so magpie translates its requests to Anthropic’s Messages API and the replies back, streaming and tool calls included. Run magpie gemini model anthropic/claude-sonnet-5-5. Does magpie keep Anthropic’s prompt cache for agents it translates? Yes. A request from Codex, Gemini CLI or OpenCode has no cache marks of its own, so magpie marks the system prompt and the conversation’s last block, two marks at most, and the next turn reads what came before from the cache. A request that brings its own cache_control keeps its marks. Codex’s marks last an hour, the rest five minutes. Why does Claude answer 400 when thinking is turned off? Newer Claude models don’t all take thinking disabled. magpie sends Sonnet 5.5 between_tools, leaves thinking out for Opus 5.5 and Fable 5, which always think, and asks Opus 5 and Haiku 5.5 at high in place of xhigh or max. Older Claudes get it as sent. By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Volcengine Ark · Tencent Cloud · Baidu Qianfan · SiliconFlow · ModelScope · Huawei Cloud MaaS · Xiaomi MiMo · StepFun · LongCat · Qwen · MiniMax · OpenAI · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. Ask on Discord if you get stuck."]]],["/docs/antigravity","Antigravity",[["","","Antigravity, Google’s agent app, can send its requests to a gateway of yours instead of Google, through its Enterprise Gateway setting. magpie is such a gateway, so Antigravity and its CLI, agy, can run on any model you have in magpie: DeepSeek, GLM, Qwen, an OpenAI or Anthropic key, or a ChatGPT or Copilot subscription. Antigravity 2.15 and later reads a gateway block from its settings file: ~/.antigravity/settings.json up to 2.29, ~/.gemini/config/config.json from 2.30. magpie writes that block, turned on, with its gateway’s address, a key that names the app and the openai wire protocol, and sets models.defaultModelId to the model you pick. The app then lists the gateway’s models in its picker and sends its chats to magpie, which translates each one for the model’s provider. Your own gateway, default model, model list and catalog are kept aside and put back when magpie steps out."],["on","Connect the app","Add providers in magpie In the Providers tab, add an API key or sign in to a subscription. Pick a model on Antigravity’s row In the Agents tab, choose a model under magpie. Restart Antigravity It reads its gateway at start-up. magpie’s models are then in its model picker. magpie antigravity deepseek/deepseek-v4-pro # the app on DeepSeek magpie agy deepseek/deepseek-v4-pro # agy on DeepSeek"],["models","Its models","The picker lists the gateway’s models, the ones the app’s key is shown, under the names magpie’s catalog gives them. On its own the app gives every model it doesn’t know a 200K window. magpie points its models.listSource at the gateway’s catalog, which gives each model its real context window, so long sessions compact when they should."],["effort","Effort","The catalog lists a model at each of its reasoning levels, so the app’s own picker offers them, and the level picked there goes with the request. The effort on magpie’s row is the level the app starts on, and what a model with no levels in the picker is asked for. Left on the default, requests go as the app sends them."],["google","Your Google sign-in","On a gateway, Antigravity uses no Google sign-in and its backend asks Google for nothing. What Google turns on for your account, its experiments and commands such as /boost, /teamwork, /plugin and /generative_ui, is gone while it is on magpie. Taking the row off magpie gives it back. The models your own sign-in gave the app leave its picker too. To have them back on magpie, sign the same Google account in under magpie’s Antigravity subscription in the Providers tab: its models are then in the app’s list, served on that account’s quota, beside any other Google account you add there."],["agy","The agy CLI","agy follows the app’s gateway unless it is connected on its own row. Connected there, it runs on magpie through the Gemini API: magpie keeps its models in magpie-settings.json, beside agy’s own ~/.gemini/antigravity-cli/settings.json, and starts agy with that file, GOOGLE_GEMINI_BASE_URL, GEMINI_API_KEY and --model for that session. So that typing agy just works, magpie adds a function named agy to each shell’s profile while agy is on one of its models. A terminal opened before takes the command from the row. Your settings.json stays yours, so agy remote-control still runs on your Google sign-in."],["first","Settings that come first","An admin_settings.json your organisation installs, and the AGY_LLM_GATEWAY_* variables, win over the settings file field by field. If either sets a gateway of its own, Antigravity doesn’t reach magpie, and the row says so."],["off","Switch back","Pick one of your own models on the row, or take the row off magpie. magpie puts back your own gateway, default model, model list and catalog. For agy, it removes the shell function too. Restart Antigravity."],["faq","FAQ","Can Antigravity run on models other than Gemini? Yes. Any model you have in magpie is in its picker: DeepSeek, GLM, Qwen, GPT, Claude and more. Do I still need to sign in with Google? No. On a gateway Antigravity uses no Google sign-in. What Google turns on for your account, such as /boost and /teamwork, is off while it is on magpie. Why does every model show a 200K context? That is the app’s default for models it doesn’t know. magpie points its catalog at the gateway, which gives each model its real window. Restart Antigravity after connecting. Does the agy CLI work too? Yes. agy follows the app’s gateway, or runs on its own row through the Gemini API, with an agy shell function so the command just works. More agents on the same models: Models in OpenCode, Models in Gemini CLI, Cursor Private Inference on any model and Snow CLI on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/aside","Aside",[["","","Aside (the aside command) keeps settings, a model list and sign-in for each account. magpie adds a provider named magpie to the account's models.json and has Aside itself make it the default, so Aside runs on any model in magpie: DeepSeek, GLM, Kimi, Qwen, Claude or a ChatGPT subscription, and draws with magpie's image models too."],["on","Set up Aside","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Pick a model for Aside on the Agents page Pick a default model via magpie, and a thinking level, categories and an image model if you want. Carry on in Aside magpie has Aside change its own settings, then reads them back to check they took. magpie aside deepseek/deepseek-v4-pro"],["models","models.json","Each Aside account has a folder, ~/.aside/u/, with settings.json, models.json and its sign-in. magpie writes providers.magpie in models.json in Pi's format: the gateway's /v1 as baseUrl, magpie's own key for Aside, and magpie's models. // ~/.aside/u//models.json { \"providers\": { \"magpie\": { \"baseUrl\": \"http://127.0.0.1:3425/v1\", \"api\": \"…\", \"apiKey\": \"\", \"models\": [ { \"id\": \"deepseek/deepseek-v4-pro\", … } ] } } } magpie changes only its own entry. When the magpie entry there has no key or another key, magpie won't write over it; one pointing at another gateway changes only when you reconnect on purpose."],["settings","Aside's own settings","magpie doesn't edit settings.json for the default model and the like. It has Aside set them, through aside repl --account --host local, then reads them back. When the value read back differs, magpie says so instead of calling it done. The default model is a provider and a modelId, and magpie's are the ones whose provider is magpie. The thinking level goes with the default model, offering only the levels that model takes."],["roles","Categories and the image model","Aside's modelCategories are fast, standard, deep and visual, and each can take its own model; unset, they follow the default. imageGenerationModel is the model Aside draws with, and can be one of magpie's image models. One unticked in its provider's editor isn't offered, but one already picked keeps drawing."],["accounts","More than one account","currentAccountId in ~/.aside/accounts.json is the account Aside is on. magpie sets up the account picked in magpie, else the one Aside has active, else u0 when neither can be read. Each account's settings, and what magpie remembers of them, stay with that account. Picking another account changes only which one magpie sets up; nothing in Aside changes. magpie aside account u1"],["off","Switching back","Before each setting it changes, magpie saves what was there. Switching back restores only the settings magpie changed; the rest are left as they are. magpie aside default"],["faq","FAQ","Can Aside run on DeepSeek, GLM or a ChatGPT subscription? Yes. Pick a via-magpie default model for Aside on magpie's Agents page; magpie has Aside apply it. Can fast, standard, deep and visual each have their own model? Yes. Each category can take its own magpie model, and follows the default when unset. Which account does magpie set up when Aside has several? The one Aside is on, unless you pick one in magpie, for example magpie aside account u1. Does switching back restore my settings? Yes. magpie restores only the settings it changed, from the values it saved before. More agents on the same models: Ante on any model, omp on any model, Pi on any model and fx on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/astrbot","AstrBot",[["","","AstrBot (AstrBotDevs/AstrBot) is a chatbot framework that puts a model on QQ, Telegram, Discord, Lark and other platforms. It keeps every setting in one file, data/cmd_config.json. magpie adds an OpenAI-compatible magpie source there, an entry for each of magpie's models, and makes the one you pick AstrBot's default chat model. So your bot runs on any model you have in magpie: DeepSeek, GLM, Kimi, Qwen, an OpenAI or Anthropic key, or a ChatGPT or Copilot subscription, with no key typed into AstrBot's WebUI."],["on","Set up AstrBot","Start AstrBot once Its first start writes data/cmd_config.json. It needs 4.10 or later (a config with provider_sources). Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Pick a model on AstrBot's row On the Agents page, pick a magpie model for AstrBot. Restart AstrBot AstrBot reads its config at start-up only; after a restart the bot is on the new model. magpie astrbot deepseek/deepseek-v4-pro # then restart AstrBot magpie finds AstrBot's root in this order: ASTRBOT_ROOT; the desktop app's ~/.astrbot; a folder where astrbot init was run, either your home, ~/astrbot or ~/AstrBot (where its README and a clone of its source put it). For AstrBot run anywhere else, start magpie with ASTRBOT_ROOT set to that folder."],["config","What goes in cmd_config.json","Since 4.10 AstrBot splits a chat provider into two lists: provider_sources holds endpoints and keys, and each entry of provider is one model of a source. magpie adds a source with id magpie (OpenAI Compatible, at the gateway's /v1, with a key naming AstrBot, so its requests count as AstrBot's in magpie's usage), an entry magpie// for each model, and sets agent_runner.config.model.provider_id to the one you pick (provider_settings.default_provider_id in a file from before agent_runner). // /data/cmd_config.json { \"provider_sources\": [ …, {\"id\": \"magpie\", \"provider\": \"openai\", \"type\": \"openai_chat_completion\", \"provider_type\": \"chat_completion\", \"enable\": true, \"key\": [\"…\"], \"api_base\": \"http://127.0.0.1:3425/v1\", …} ], \"provider\": [ …, {\"id\": \"magpie/deepseek/deepseek-v4-pro\", \"provider_source_id\": \"magpie\", \"model\": \"deepseek/deepseek-v4-pro\", \"modalities\": [\"text\", \"tool_use\"], \"max_context_tokens\": …} ], \"agent_runner\": {\"runner_type\": \"local\", \"config\": {\"model\": {\"provider_id\": \"magpie/deepseek/deepseek-v4-pro\"}}} } Every model is marked tool_use: without it AstrBot drops the model's tools, and the gateway passes a tool call on whatever the model. Images are marked as magpie knows the model sees them. A context window magpie doesn't know is 0, and AstrBot looks it up itself."],["restart","Why it needs a restart","AstrBot reads the whole file into memory at start, and its WebUI writes the whole of it back on every save. So magpie's change needs AstrBot restarted, and a WebUI save made before that restart writes over it. magpie's check notices that its source is gone and asks you to connect again. When agent_runner.runner_type isn't local (an outside agent runner), AstrBot doesn't ask its chat model, and magpie's check says so."],["own","Your own settings","Before it first writes the file, magpie copies it to cmd_config.json.before-magpie. Your own sources and models stay byte for byte, and so do changes you make to magpie's entries in the WebUI (a source's timeout or proxy, a model switched off, its extra body). A model picked for one chat with /provider lives in AstrBot's own database; it is yours and stands. AstrBot writes the file with a UTF-8 BOM, which magpie keeps."],["docker","AstrBot in Docker","AstrBot in Docker isn't one magpie wires: its data folder is a volume magpie can't know, and the gateway on this machine's loopback isn't the container's."],["off","Switching back","Set the row back to default in magpie: magpie takes its source and models out and puts the default chat model back to the one AstrBot was on, unless you have picked another in AstrBot since, which stands. Or pick a model of your own; magpie's models stay in the list beside it until you disconnect. Restart AstrBot after either. magpie astrbot default # then restart AstrBot"],["faq","FAQ","Can AstrBot use DeepSeek, GLM, Kimi or Qwen? Yes. magpie adds an OpenAI-compatible magpie source to cmd_config.json, an entry for each of magpie's models, and sets the one you pick as the default chat model. Restart AstrBot to use it. Why is my bot still on the old model? AstrBot reads cmd_config.json at start-up only, so restart it. Don't save anything in the WebUI before that, or it writes over magpie's change. magpie's source is gone. What now? A WebUI save most likely wrote the whole file back. Connect AstrBot again in magpie, then restart AstrBot. Does it work for AstrBot in Docker? Not on its own: magpie can't know the container's data volume, and this machine's loopback isn't the container's. More agents on the same models: nanobot on any model, QwenPaw on any model, OpenClaw on any model and Every model in Cherry Studio, through magpie. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/atomcode","AtomCode",[["","","AtomCode is a Rust terminal coding agent on AtomGit (atomgit.com/atomgit_atomcode/atomcode). Its models live in config.toml: a [models.\"…\"] table names a [provider_accounts.…] table, the shape AtomCode's own CodingPlan sign-in writes since 5.0.7. magpie writes the same shape, a magpie account and one table per model, so AtomCode can use any model you have in magpie: DeepSeek, GLM, Kimi, Qwen, GPT or a ChatGPT subscription."],["on","Set up AtomCode","Open magpie's Agents page Find the AtomCode row. Its list has the models you set up in AtomCode yourself, and the ones via magpie. Pick a magpie model magpie writes the account and model tables and points default_provider and default_model at your pick; with both set, AtomCode goes by default_model. Restart atomcode AtomCode reads its settings at start-up, so reopen any running session. magpie atomcode deepseek/deepseek-v4-pro magpie atomcode effort high"],["files","What magpie writes","AtomCode's folder is ATOMCODE_HOME (an absolute path), else ~/.atomcode. An AtomCode in WSL uses Linux's ~/.atomcode, with the gateway as the distro reaches it. magpie writes: # ~/.atomcode/config.toml default_provider = \"magpie/deepseek/deepseek-v4-pro\" default_model = \"magpie/deepseek/deepseek-v4-pro\" [provider_accounts.\"magpie\"] provider = \"openai-compatible\" base_url = \"http://127.0.0.1:3425/v1\" api_key = \"…\" [models.\"magpie/deepseek/deepseek-v4-pro\"] account = \"magpie\" model = \"deepseek/deepseek-v4-pro\" context_window = … max_tokens = … supports_vision = false reasoning_effort_levels = [\"…\"] The account uses openai-compatible, AtomCode's documented preset for a custom endpoint, at magpie's gateway /v1, with a key magpie issues to AtomCode alone. A model table's key is magpie//, and its model goes to the gateway as written. Each carries the context window (AtomCode compacts as it nears it; 128000 when magpie doesn't know it), the output limit (never above the window), image support and the effort levels on offer. When magpie's models change, magpie rewrites its own tables; your own model tables and legacy providers.* entries are left alone. Requests are Chat Completions with Bearer auth and a User-Agent of atomcode/; the key is AtomCode's own, so magpie knows a request is AtomCode's even when the header is changed."],["effort","Effort","Effort is the current model table's reasoning_effort, sent with every request to it and kept per model. magpie picks none for you, so the vendor's default stands until you do. Only the levels that model supports (some of low, medium, high, xhigh, max) are offered."],["restart","When it takes effect","AtomCode reads its settings at start-up. While atomcode is running, magpie tells you to restart open atomcode sessions."],["off","Switching back","Switching back removes magpie's account and model tables and puts back the default_provider and default_model you had before, where AtomCode still has that model (otherwise they go). Picking one of your own AtomCode models in magpie also removes magpie's tables. magpie atomcode default"],["faq","FAQ","How do I use DeepSeek, GLM or a ChatGPT subscription in AtomCode? On magpie's Agents page, pick a via-magpie model for AtomCode. magpie adds [provider_accounts.\"magpie\"] and one [models.\"magpie/…\"] table per model to ~/.atomcode/config.toml and points the defaults at your pick. What context window does AtomCode get? magpie writes each model's context_window, or 128000 when it doesn't know it. AtomCode compacts as it nears the window. I changed it and AtomCode didn't notice. Why? AtomCode reads its settings at start-up. Restart the open atomcode sessions. Do my own defaults come back when I switch back? Yes. magpie stashes default_provider and default_model when it steps in and puts them back when it steps out, where AtomCode still has that model. More agents on the same models: Reasonix Studio on any model, jcode on any model, Crush on any model and Shelley on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/avibe","Avibe",[["","","Avibe (avibe-bot/avibe, MIT, the avibe-os package and its vibe CLI) is a local agent OS. Its own agent, Vibey, and the Claude Code, Codex and OpenCode it runs all take their models from its Model Hub, a gateway of Avibe's own (CLIProxyAPI) in front of the model sources added on its Models page. magpie is added as one such source, so every agent in Avibe runs on any model in magpie: DeepSeek, GLM, Kimi, Qwen, Claude or a ChatGPT subscription."],["on","Set up Avibe","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Start Avibe Avibe adds and removes model sources only while it runs, so start it with vibe start first. Pick magpie for Avibe on the Agents page magpie shows up as a model source on Avibe's Models page, for Vibey and the agents it runs. vibe start magpie avibe magpie"],["source","magpie as a model source","Avibe's home is $AVIBE_HOME, else ~/.avibe (~/.vibe_remote before 3.0), and its sources are model_hub.sources in config/config.json there. A source can't be written into config.json by hand: each is checked whole, its key lives in the Model Hub's store, and Avibe adds it to its agents' route chains as it is added. So magpie adds and removes it as Avibe's Models page does, through Avibe's internal API: the socket state/dispatch.sock in its home on macOS and Linux, or on Windows the loopback port and bearer token runtime/control-ipc/endpoint.json gives. What magpie sends: POST /internal/model-hub { \"operation\": \"create_source\", \"payload\": { \"source\": { \"kind\": \"api_key\", \"vendor\": \"custom\", \"display_name\": \"magpie\", \"base_url\": \"http://127.0.0.1:3425/v1\", \"key\": \"\", \"protocol\": \"openai_chat\", \"supply_channel\": \"hub\", \"billing\": \"metered\", \"save_unverified\": true } } } magpie keeps the source's id, so one you rename in Avibe is still magpie's. A custom source at the gateway that you added by hand on the Models page counts as magpie's too. When the gateway moves to another port, a sync removes the old source and adds it again at the new address, since the key is sealed with the address; one pointed at another machine, a local proxy's path or the way a WSL distro reaches Windows stays where it is."],["chat","Why chat completions","The source's protocol is openai_chat, not Responses. For a Responses source the Model Hub runs Codex's executor, which names itself codex-tui and would be taken for Codex itself; for chat it passes each backend's own headers on. A hub source serves every backend, the Model Hub translating Claude's and Codex's requests. It is saved without Avibe's protocol probe, which can't tell the gateway's protocols apart, as it serves them all."],["models","The model list","Avibe lists its models from the gateway's /v1/models itself, so what it offers is the models you picked for Avibe on magpie's Agents page. Avibe lists them again on its own only once the listing is half an hour old, so magpie has it refresh the source when you add or drop one."],["off","Removing it","Switching back has magpie delete the source through the same internal API and forget its id. When removing it would take a hop out of a route or interrupt work in progress, Avibe asks for that to be confirmed, as its Models page does; you asked for it in magpie, so magpie asks again with what Avibe listed. magpie avibe default"],["faq","FAQ","Do Claude Code and Codex inside Avibe get magpie's models too? Yes. magpie is a Model Hub source, and a hub source serves Vibey and every backend Avibe runs: Claude Code, Codex and OpenCode. Why does magpie say to start Avibe first? Avibe adds and removes model sources only through its internal API while it runs; config.json can't be edited for it. Run vibe start and try again. Which models does Avibe offer? The ones you picked for Avibe on magpie's Agents page. Avibe reads them from the gateway's /v1/models, and magpie has it refresh when the list changes. How do I remove magpie? Switch Avibe back to its default in magpie, or run magpie avibe default. magpie deletes the source it added. More agents on the same models: MothX on any model, PenguinHarness on any model, Paimon on any model and StepCode on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/azure","Azure OpenAI",[["","","Azure OpenAI serves OpenAI's models, and other makers' such as Kimi, DeepSeek and Grok, at your own Azure resource. magpie's azure preset brings that resource to Codex, Claude Code, OpenCode and other agents: the endpoint and key are your resource's, and the model ids are your deployments' names."],["add","Add it","Find the endpoint and key. Open the resource's Keys and Endpoint in the Azure portal, and copy the endpoint and a key. Add it. Pick Azure OpenAI in the app and paste the address into Endpoint, or from the CLI: magpie provider add azure url=https://my-resource.openai.azure.com magpie provider test azure Paste the address any way: https://.openai.azure.com, …/openai, …/openai/v1, a classic deployment's URL with its api-version, or only the resource's name. magpie asks every one at the resource's v1 API (/openai/v1, generally available since August 2025), where chat completions, Responses and the model list sit at OpenAI's paths and no api-version is wanted. Hosts ending .openai.azure.com, .cognitiveservices.azure.com and .services.ai.azure.com are all known. The key goes in api-key, never as a Bearer: a Bearer on Azure is an Entra ID token."],["models","Deployments are the models","Once added, magpie asks the resource for its deployments with the key, and their names are the model ids. Where the data plane won't list them, it takes the models the v1 API lists, which match only when each deployment is named after its model. When neither answers, the error says to type your deployments' names in: magpie provider models azure my-gpt-5-5 my-gpt-6-sol Azure hosts other makers' models too, which models.dev lists under it with no reasoning levels, so magpie doesn't take its list as a maker's word on theirs."],["agents","Use it in an agent","Codex speaks Responses; Claude Code and other Anthropic agents are translated by magpie to Azure's API: magpie codex azure/my-gpt-5-5 magpie claude azure/my-gpt-5-5"],["apim","API Management and headers","When an API Management gateway (or any address that isn't a resource's host) sits in front of the resource, magpie keeps the URLs you gave and doesn't move them to the v1 API. Add headers in the editor's Headers; ${sessionId}, ${threadId} and ${subagentId} in a value become the conversation's ids, so a gateway can keep one conversation on one account: magpie provider set azure 'header.X-Session=${sessionId}'"],["notes","Notes","An Azure provider imported from another app becomes the azure preset's too, on the resource's v1 API. Azure's content_filter is read as the vendor's safety filter, not a broken request: another account or model in a routing group may still answer. Reasoning items Codex hands back are left out of a request relayed as is to Azure, unless store is true: Azure, like OpenAI, looks the id up among stored items and answers 400 \"Item with id 'rs_…' not found\". OpenAI's Decisions API (/v1/decisions) goes to Azure too, at /openai/v1/decisions, with your deployment's name as the model."],["faq","FAQ","Does magpie support Azure OpenAI? Yes, with the azure preset. Give the resource's endpoint and key; magpie asks its v1 API under /openai/v1 with the key in the api-key header, and lists the resource's deployments as models. What goes in as the model id? Your deployment's name, not the model's. magpie asks the resource for its deployments; when it can't, type them in with magpie provider models azure . Do I need an api-version? No. magpie uses Azure's v1 API, and a classic /openai/deployments/…?api-version= address is moved onto it. What if an API Management gateway is in front of the resource? Give the gateway's address; magpie leaves it as it is. Add the headers it needs under Headers, where ${sessionId} and the like become the conversation's ids. Related: OpenAI in Claude Code, Codex, Gemini CLI and OpenCode, Amazon Bedrock in Claude Code, Codex and other agents. If something fails, see Fixing common errors: 401, 429, 502, 504 and more or ask on Discord."]]],["/docs/baidu-qianfan","Baidu Qianfan",[["","","Baidu Qianfan (百度千帆) has two Token Plans, personal and enterprise, and pay as you go, each with endpoints and keys of its own. Add Baidu Qianfan in magpie with each key's plan, and Claude Code, Codex, Gemini CLI, OpenCode and other tools use Qianfan's DeepSeek and GLM through magpie's local gateway on 127.0.0.1:3425."],["add","Add Baidu Qianfan","Add the provider and pick the plan On Providers, click + Add provider, pick Baidu Qianfan, set the key's plan to Token Plan Personal, Token Plan Enterprise, Pay as you go, paste the key and save. Pick it for a tool On Agents, pick a model such as qianfan-code-latest or deepseek-v4-pro on a tool's row. magpie claude baidu-qianfan/qianfan-code-latest magpie codex baidu-qianfan/deepseek-v4-pro magpie opencode baidu-qianfan/glm-5.3"],["plans","Plans and endpoints","Plan Chat Completions and Responses Anthropic Messages Token Plan personal https://qianfan.baidubce.com/v2/tokenplan/personal https://qianfan.baidubce.com/anthropic/tokenplan/personal Token Plan enterprise https://qianfan.baidubce.com/v2/tokenplan/team https://qianfan.baidubce.com/anthropic/tokenplan/team Pay as you go https://qianfan.baidubce.com/v2 https://qianfan.baidubce.com/anthropic Each plan's key works at its own endpoints. Each key in the provider names its plan, so personal, enterprise and pay-as-you-go keys can share one provider, and each key's requests go to its own plan's endpoint."],["models","The plans' models","The plans' /models answers 404, so magpie gives the models from both plans' docs: qianfan-code-latest, deepseek-v4.1-flash, deepseek-v4-pro, deepseek-v4-pro-0813, deepseek-v4-flash-0731, glm-5.3, glm-5.3-flash, glm-5.2, glm-5.1, among others. deepseek-v4-flash, deepseek-v3.2 and glm-5 are the enterprise plan's alone. qianfan-code-latest is whichever model the console has picked. A pay-as-you-go key reads Qianfan's /v2/models."],["agents","In each agent","Claude Code speaks Anthropic Messages. Qianfan's plans and pay as you go have Anthropic endpoints, so requests go as they are. See Claude Code with other models. Codex speaks only OpenAI Responses. Qianfan's plan endpoints serve Responses too, so Codex's requests go as they are. The models show in Codex's /model. See Codex with other models. Gemini CLI speaks Gemini's API; magpie points it at the local gateway and translates. See Gemini CLI with other models. OpenCode : magpie writes the models into opencode.json. See OpenCode with other models."],["faq","FAQ","How do I use the Baidu Qianfan Token Plan in Claude Code? Add Baidu Qianfan in magpie with the key's plan set to Token Plan Personal or Enterprise, then pick qianfan-code-latest on Claude Code's row, or run magpie claude baidu-qianfan/qianfan-code-latest. Requests go to the plan's Anthropic endpoint, such as https://qianfan.baidubce.com/anthropic/tokenplan/personal. Which model is qianfan-code-latest? The one you picked for the plan in Qianfan's console. Change it there; the name in magpie and your tools stays the same. Do the personal and enterprise plans have the same models? Mostly. deepseek-v4-flash, deepseek-v3.2 and glm-5 are the enterprise plan's alone; deepseek-v4-pro, glm-5.3 and the others are in both. Does Baidu Qianfan work in Codex? Yes. Qianfan's plan endpoints serve OpenAI Responses, so magpie passes Codex's requests through. Run magpie codex baidu-qianfan/deepseek-v4-pro, or pick it on Codex's row. The same for other providers: Volcengine Ark, Tencent Cloud, GLM Coding Plan, Kimi, DeepSeek, Qwen. Hit an error? See troubleshooting, or ask on Discord."]]],["/docs/bedrock","Amazon Bedrock",[["","","magpie has two Amazon Bedrock presets: bedrock, the Bedrock runtime, and bedrock-mantle, Bedrock's Mantle endpoint. Both take the same Bedrock API key, with no AWS access keys and no SigV4 signing. Once added, Claude Code, Codex, OpenCode and other agents can use Claude, OpenAI's GPT models, and gpt-oss, Qwen, DeepSeek, Kimi, GLM and MiniMax on Bedrock, billed to your AWS account."],["add","Add it","Get a key. Create a Bedrock API key on the Bedrock page of the AWS console. Add it and pick a region. The default region is us-east-1. Change it in the app's editor under Region, or from the CLI: magpie provider add bedrock magpie provider set bedrock region=eu-west-1 magpie provider test bedrock The runtime preset's regions are us-east-1, us-east-2, us-west-2, eu-central-1, eu-west-1, eu-west-3, ap-northeast-1, ap-southeast-1, ap-southeast-2, ap-south-1. Each has its own Claude (Anthropic Messages), Chat Completions and Responses address, and a change of region moves all three."],["models","Models","The Bedrock runtime has no model list to ask, so magpie gives it one: Claude: global.anthropic.claude-opus-5-5, global.anthropic.claude-sonnet-5-5, global.anthropic.claude-haiku-4-5-20251001-v1:0 and more, as global. inference profiles, which every commercial region routes. OpenAI GPT: global.openai.gpt-6-astra, global.openai.gpt-6-sol, global.openai.gpt-6-luna, global. profiles too. Other makers: in-region ids such as openai.gpt-oss-120b-1:0, qwen.qwen3-coder-480b-a35b-v1:0, deepseek.v3.2, moonshotai.kimi-k2.5, zai.glm-5, minimax.minimax-m2.5, which not every region serves (gpt-oss isn't in ap-southeast-1). A profile kept in one geography (us., eu., apac., jp., au.) isn't in the list; type it in, as any model of your own is."],["agents","Use it in an agent","magpie picks Bedrock's API per model: Claude on Anthropic Messages alone, OpenAI's GPT models (not gpt-oss) on Responses first, the rest on Chat Completions. Whatever API an agent speaks, magpie translates, so Codex can use Claude on Bedrock and Claude Code can use GPT there: magpie claude bedrock/global.anthropic.claude-sonnet-5-5 magpie codex bedrock/global.openai.gpt-6-sol"],["mantle","Bedrock Mantle","Mantle is Bedrock's other endpoint (bedrock-mantle..api.aws), with the same key: magpie provider add bedrock-mantle region=us-west-2 magpie provider test bedrock-mantle Unlike the runtime, Mantle lists its models, so the list is your account's own, models only Mantle serves among them. Model ids are in-region ones alone, such as anthropic.claude-sonnet-5 and openai.gpt-oss-120b; there are no global. or us. profiles. Mantle serves its OpenAI APIs under two prefixes: OpenAI's closed GPT models and xAI's Grok at /openai/v1, the rest at /v1. magpie picks per model; when a maker it doesn't know yet is refused, it asks once more at the other prefix and remembers the one that worked. Mantle has 17 regions; the runtime's eu-west-3 has no Mantle."],["claude-switch","Claude Code's CLAUDE_CODE_USE_BEDROCK","With CLAUDE_CODE_USE_BEDROCK (or _VERTEX, _MANTLE and the like) on, Claude Code goes to that cloud's own endpoint and never reaches magpie. When magpie wires Claude Code in, it takes such a switch out of the settings it writes, keeps its value, and puts it back as written when it steps out, unless you set it again since. The cloud's own variables (AWS_*) stay. When the switch is somewhere magpie doesn't write (the managed settings, ~/.claude.json's env, or the login shell's environment), the Agents page's check names the variable and where it is."],["notes","Notes","When Claude Code sends an anthropic-beta Bedrock doesn't take, Bedrock answers 400 \"Unexpected value(s) … for the anthropic-beta header\". magpie asks again at once without those betas, and leaves them out for that provider from then on. The key goes in x-api-key alone on Claude's API, as Bedrock asks. A custom provider added at a runtime or Mantle address is recognised too, and gets the same rules."],["faq","FAQ","Does magpie need AWS access keys for Bedrock? No. One Bedrock API key is enough, and magpie does no SigV4 signing. Create it on the Bedrock page of the AWS console. Can Claude Code use Claude on Bedrock through magpie? Yes. Pick a model such as bedrock/global.anthropic.claude-sonnet-5-5. Leave CLAUDE_CODE_USE_BEDROCK off, or Claude Code goes around magpie; magpie takes it out of the settings it writes. Why can't I use some models in my region? The global. Claude and GPT profiles are routed in every commercial region; other makers' in-region ids aren't in every region. Pick another region, or type in an id your region serves. Bedrock or Bedrock Mantle? Both take the same key. The runtime has global. profiles and a given model list; Mantle lists your account's own models, Mantle-only ones included, under in-region ids alone. Related: Anthropic in Claude Code, Codex, Gemini CLI and OpenCode, Google Vertex AI in Claude Code, Codex and other agents. If something fails, see Fixing common errors: 401, 429, 502, 504 and more or ask on Discord."]]],["/docs/cherry-studio","Cherry Studio",[["","","Cherry Studio is a desktop chat client that takes any OpenAI-compatible provider. magpie adds itself there as one provider, named magpie, so every model you have in magpie shows up in Cherry Studio: providers with an API key and the Claude, ChatGPT or Copilot subscriptions you signed in to. magpie runs a gateway on your computer at http://127.0.0.1:3425. It speaks the OpenAI Chat Completions API and translates each request for the provider behind the model, Anthropic’s, Google’s or a subscription’s, with streaming, tool calls and reasoning. Cherry Studio sees one OpenAI-compatible provider at http://127.0.0.1:3425/v1. Cherry Studio keeps its providers in its own database, and magpie never writes to it. It adds itself through Cherry Studio’s add-provider link instead, and you confirm it in Cherry Studio. This works in Cherry Studio 1.x and 2.x."],["add","Add magpie to Cherry Studio","Add providers in magpie In the Providers tab, add an API key (DeepSeek, Kimi, GLM, Qwen, OpenRouter…) or sign in to a subscription. Open the Agents tab magpie lists Cherry Studio once it has run on this computer, including a data folder you moved elsewhere. Click Add magpie On Cherry Studio’s row, press Add magpie. Cherry Studio opens its model provider settings with magpie filled in: name magpie, type OpenAI, the gateway’s address and a key. Confirm it in Cherry Studio Nothing is added until you do. If nothing opens, no app on this computer handles Cherry Studio’s links yet: open Cherry Studio once, or install it again, then click Add magpie again."],["models","Pick the models","Cherry Studio lists a provider’s models from /v1/models, so the magpie provider offers every model magpie has, named provider/model (for example deepseek/deepseek-v4-pro). Add the ones you want to the magpie provider in Cherry Studio, and choose them in a chat like any other model. The list has magpie’s image and video models too. Cherry Studio knows most of them by name (gpt-image-2, Gemini’s image models, Imagen, Seedream, Grok Imagine…) and offers them on its Paintings page, not in a chat. For one it doesn’t know, open the model’s settings in the magpie provider and tick image generation. A provider you add in magpie later shows up the next time Cherry Studio fetches the list; there is nothing to change in Cherry Studio. Several accounts behind one model, rest periods after a 429 and failover work as they do for every agent."],["cli","From a terminal","magpie cherrystudio add # opens Cherry Studio to add magpie, confirm it there cherry-studio works as the name too."],["status","How magpie knows it was added","Once Cherry Studio has a provider at the gateway’s address, the row shows magpie instead of the button. magpie reads Cherry Studio 2.x’s database for this, read-only. Cherry Studio 1.x keeps providers where magpie doesn’t read them, so there the button stays."],["usage","Usage and keys","On a gateway that isn’t shared, the key in the link is Cherry Studio’s own, so its requests are counted as Cherry Studio’s in magpie’s Usage, apart from your coding agents. When the gateway is shared on your network with gateway keys, the link carries a key that works there."],["faq","FAQ","Do I need an API key to use Claude or ChatGPT in Cherry Studio? No. Sign in to a Claude, ChatGPT or Copilot subscription in magpie, and its models appear in the magpie provider in Cherry Studio. Does magpie change Cherry Studio’s settings? No. magpie opens Cherry Studio’s own add-provider dialog, and you confirm it. It only reads Cherry Studio’s database to show whether magpie was added. What address and type does the magpie provider use? Type OpenAI, at http://127.0.0.1:3425/v1, or the gateway address you set in magpie. Why don’t I see a new model in Cherry Studio? Cherry Studio shows models you added to the provider. Fetch the magpie provider’s model list again and add the new one. Cherry Studio isn’t in magpie’s Agents tab. magpie lists it once Cherry Studio has run on this computer. Open Cherry Studio once, then look again. Another desktop app on the same models: AionUi on any model. Using a coding agent too? See Subscriptions in any agent and Get started. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/cindy","Cindy",[["","","Cindy is a desktop app that runs Claude Code, Codex and Pi. It keeps its providers in its own database, their keys encrypted, and takes a new one only through its own import link, which you confirm in Cindy. So magpie writes nothing into Cindy: it gives Cindy an import link with magpie as one custom provider, an endpoint for each runtime. Claude Code, Codex and Pi in Cindy then run on any model in magpie: DeepSeek, GLM, Kimi, Qwen, an OpenAI or Anthropic key, and the ChatGPT or Copilot subscription you signed in to."],["add","Add magpie to Cindy","Open Cindy once Once Cindy has run, its data folder is there (~/Library/Application Support/Cindy on a Mac, CindyGlobal for its global build) and magpie's Agents page lists it. Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Click Add magpie On Cindy's row, click Add magpie; magpie hands the import link to Cindy. Confirm it in Cindy Nothing is added until you do. Then pick a model from the Magpie provider for Claude Code, Codex or Pi in Cindy. If nothing happens, nothing on this computer opens Cindy's links (cindy://), or the program that registered them was moved. magpie checks for that first and says why instead of doing nothing: open Cindy once or install it again, then click again."],["link","What the link holds","The link's data is base64url-encoded JSON. Decoded, it is: cindy://provider/import?v=1&data= { \"kind\": \"custom\", \"name\": \"Magpie\", \"id\": \"magpie\", \"auth\": {\"method\": \"apiKey\", \"apiKey\": \"…\"}, \"endpoints\": [ {\"protocol\": \"anthropic-messages\", \"baseUrl\": \"http://127.0.0.1:3425\", \"targets\": [\"claude-code\"], \"modelsUrl\": \"http://127.0.0.1:3425/v1/models\"}, {\"protocol\": \"openai-responses\", \"baseUrl\": \"http://127.0.0.1:3425/v1\", \"targets\": [\"codex\"], \"modelsUrl\": \"http://127.0.0.1:3425/v1/models\"}, {\"protocol\": \"openai-chat\", \"baseUrl\": \"http://127.0.0.1:3425/v1\", \"targets\": [\"pi\"], \"modelsUrl\": \"http://127.0.0.1:3425/v1/models\"} ] } Claude Code speaks Anthropic Messages at the gateway itself; Codex speaks OpenAI Responses and Pi OpenAI Chat, both at the gateway's /v1. Each endpoint lists its models from the gateway's /v1/models, so a provider you add to magpie later shows up when Cindy fetches models again."],["cli","From the command line","magpie cindy add # opens Cindy to add magpie; confirm it there The command prints the link it opened. When nothing here can open it, it says why rather than reporting success."],["status","How magpie knows it was added","magpie reads Cindy's databases read-only: one per account (cindy-.db) once you sign in, cindy-local-v1.db before. When any of them has a custom provider with the id or name magpie, or the gateway's address in its endpoints, the row says it's added. It can read them while Cindy runs, and never writes them. When a database can't be read, magpie says it doesn't know, not that it isn't added."],["usage","Usage and keys","The key in the link is Cindy's own, so its requests are counted as Cindy's in magpie's usage, apart from other agents."],["faq","FAQ","Can Claude Code in Cindy use DeepSeek or GLM? Yes. Once magpie is added to Cindy, Claude Code uses any model in magpie, DeepSeek and GLM included, through the Magpie provider's Anthropic endpoint. Does magpie change Cindy's settings? No. Cindy takes a new provider only through its own import link, which you confirm in Cindy. magpie only reads Cindy's databases to show whether magpie was added. Add magpie does nothing. What now? Nothing on this computer opens cindy:// links, or the program that registered them is gone. Open Cindy once or install it again, then click again; magpie says which it is. Cindy isn't on magpie's Agents page. magpie lists Cindy once it has run on this computer and made its data folder. Open Cindy once, then look again. More desktop apps on the same models: AionUi on any model, Every model in Cherry Studio, through magpie, Shelley on any model and Lody on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/claude-code-chatgpt","ChatGPT in Claude Code",[["","","Claude Code can run on the GPT models of your ChatGPT Plus or Pro plan. Sign in to ChatGPT in magpie, pick a codex/… model for Claude Code, and keep working as before. No OpenAI API key. Claude Code speaks Anthropic’s Messages API. magpie runs a gateway on your computer, at 127.0.0.1:3425, that translates each of Claude Code’s requests for the GPT model and each reply back, streaming and tool calls included. magpie writes the gateway’s address and key into Claude Code’s settings.json, and your ChatGPT sign-in stays in magpie."],["signin","Sign in to ChatGPT","Open Add provider In magpie’s Providers tab, press + Add provider. Click the ChatGPT tile magpie opens OpenAI’s own sign-in page in your browser. The account shows up as soon as you finish. Or from a terminal: magpie accounts add codex # sign in to a ChatGPT account The account’s models are codex/…."],["pick","Pick a GPT model for Claude Code","In the Agents tab, click the model on Claude Code’s row and choose a codex/… model. From a terminal: magpie models # every model, as provider/model magpie claude codex/gpt-5.5 Inside Claude Code, /model lists magpie’s models too, marked “via magpie”, so you can switch there. Only some sessions on GPT? Leave Claude Code unconnected in magpie and run claude-magpie when you want it on a GPT model. It starts the same claude with magpie’s settings for that session only, and settings.json is not rewritten."],["tiers","How Opus, Sonnet and Haiku map","Claude Code asks for models by tier: opus, sonnet, haiku and fable. Its own small jobs, such as a session’s title and Explore subagents, go to the haiku tier. With a GPT model as the main model: Tier Variable in env By default opus ANTHROPIC_DEFAULT_OPUS_MODEL The GPT model you picked sonnet ANTHROPIC_DEFAULT_SONNET_MODEL The GPT model you picked haiku ANTHROPIC_DEFAULT_HAIKU_MODEL, ANTHROPIC_SMALL_FAST_MODEL The GPT model you picked fable ANTHROPIC_DEFAULT_FABLE_MODEL Left unset To give a tier a model of its own, say a smaller one for haiku, set it on Claude Code’s row in magpie, or from a terminal: magpie claude haiku codex/… # one tier on its own model magpie claude haiku \"\" # back to the main model"],["effort","Reasoning effort","The effort Claude Code asks for goes to the GPT model as its reasoning effort, on requests where Claude Code has thinking on. magpie also tells Claude Code which effort levels each model has. To hold one effort whatever Claude Code asks, set effort on Claude Code’s row. opus effort, sonnet effort, haiku effort, fable effort and subagent effort set it per tier. Each starts at the effort Claude Code asks for. An open Claude Code session keeps the effort it started with, so restart it to use a new one."],["limits","Limits and usage","Requests are served on your ChatGPT account, so they count toward your plan’s usage limits, as Codex’s own requests do. See what’s used. Turn on status line on Claude Code’s row: it shows the 5h and 7d use of the accounts magpie serves, under Claude Code’s prompt. magpie accounts lists each account and how much of its allowance is used. The Usage tab has the history. When an account runs out. magpie sets it aside until the reset OpenAI’s refusal names, else until its full window renews, else for 5 hours, and sends requests to your next account or the provider’s Fallback. The account comes back on its own once its window renews."],["accounts","Several accounts and failover","Add another account. Click the ChatGPT tile again, or run magpie accounts add codex again. Each account is listed under the provider. Spread requests over them. Open the provider’s row and tick every account to use. Smart routing, the default, sends requests to the account with quota to spare whose allowance renews soonest. Fall back to another model. The provider’s Fallback lists models to use when every account is out, rate limited or down, a model from another subscription or an API key included. The routing modes are in Get started."],["back","Switch back","Pick one of Claude Code’s own models on its row, or run: magpie claude default That takes magpie’s wiring out of Claude Code and puts back what it had. Disconnect on Claude Code’s row does the same. Your claude.ai sign-in. On a magpie model, Claude Code’s sign-in setting is magpie’s key by default: claude.ai is signed out for it, so /usage plan limits, connectors, voice and /teleport are off. Set it to claude.ai to keep them."],["reverse","The other way round: Claude in Codex","A Claude Pro or Max subscription works in Codex the same way. Sign in to Claude in magpie and pick a claude/… model for Codex. Requests on a Claude subscription run through the Claude Code installed on your computer, so keep it installed. magpie accounts add claude magpie codex claude/claude-opus-5-5 See Models in Codex and Subscriptions in any agent."],["faq","FAQ","Can I use my ChatGPT Plus or Pro subscription in Claude Code? Yes. Sign in to ChatGPT in magpie and pick a codex/… model on Claude Code’s row, or run magpie claude codex/gpt-5.5. magpie translates Claude Code’s requests for the GPT model and the replies back, tool calls included. Do I need an OpenAI API key? No. magpie signs in on OpenAI’s own page, and Claude Code gets the gateway’s key. Your sign-in stays in magpie. Does it use my ChatGPT plan’s limits? Yes. Requests are served on your ChatGPT account and count toward its usage limits. magpie’s status line shows each account’s 5h and 7d use under Claude Code’s prompt. Which model do Claude Code’s Haiku requests use? The GPT model you picked, unless you give the haiku tier a model of its own with magpie claude haiku . How do I go back to Claude’s own models? Run magpie claude default, or pick one of Claude Code’s own models on its row in magpie. Do my requests go through a magpie server? No. The gateway runs on your computer. Requests go from it to OpenAI; magpie has no server of its own in that path. Using an API key instead? See Models in Claude Code. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/claude-code-models","Models in Claude Code",[["","","Claude Code speaks one API, Anthropic Messages. magpie puts a gateway on your computer that speaks it for every provider you add, and points Claude Code at it. You pick the model in magpie or in Claude Code’s /model. The gateway runs at 127.0.0.1:3425. It speaks the Anthropic, OpenAI and Gemini APIs. When a provider speaks Anthropic Messages itself, as DeepSeek, Kimi, Zhipu GLM, MiniMax and Qwen do, Claude Code’s request is passed on as it is. When it doesn’t, as with a GPT model from your ChatGPT plan, magpie translates the request and the reply, streaming and tool calls included. Chinese models DeepSeek, Kimi and Kimi Code, Zhipu GLM (pay as you go or Coding Plan), Z.ai, MiniMax and Qwen, each with its China endpoint where it has one. Subscriptions The models of a ChatGPT, Copilot or Antigravity account you sign in to in magpie. Anything else Any OpenAI- or Anthropic-compatible URL and key, Ollama and LM Studio."],["setup","Set it up","Add the provider In magpie’s Providers tab, press + Add provider, pick DeepSeek, Kimi, Zhipu GLM, MiniMax or Qwen, paste your API key and save. magpie asks the vendor which models it serves. Pick the model for Claude Code In the Agents tab, click the model on the Claude Code row and choose one, such as deepseek/deepseek-v4-pro. magpie writes it into ~/.claude/settings.json. Start a new session Claude Code reads its settings when it starts. A session already open keeps the model it started with. The same from a terminal: magpie provider add deepseek sk-… magpie models # every model, as provider/model magpie claude deepseek/deepseek-v4-pro Model ids are magpie’s, provider/model. Inside Claude Code, /model lists magpie’s models too, marked “via magpie”, so you can switch there. Zhipu GLM Coding Plan. When you add Zhipu GLM or Z.ai, pick the plan your key is for. A Coding Plan key has its own endpoints, and sent to the pay-as-you-go one it is told it has no balance. Keep claude on your own account. Leave Claude Code unconnected in magpie and run claude-magpie when you want it on another model. It starts the same claude with magpie’s settings for that session only, and settings.json is not rewritten. See Get started."],["tiers","How Opus, Sonnet and Haiku map","Claude Code asks for models by tier: opus, sonnet, haiku and fable. Its own small jobs, such as a session’s title and Explore subagents, go to the haiku tier. magpie writes a model into each tier’s variable: Tier Variable in env By default opus ANTHROPIC_DEFAULT_OPUS_MODEL The main model sonnet ANTHROPIC_DEFAULT_SONNET_MODEL The main model haiku ANTHROPIC_DEFAULT_HAIKU_MODEL, ANTHROPIC_SMALL_FAST_MODEL The main model; on a Claude model, the Haiku its provider serves fable ANTHROPIC_DEFAULT_FABLE_MODEL Left unset unless the main model is a Fable model So with DeepSeek as the main model, every tier runs on DeepSeek. To give a tier a model of its own, say a cheaper one for haiku, set it on the Claude Code row in magpie, or from a terminal: magpie claude haiku deepseek/deepseek-v4-flash # one tier on its own model magpie claude haiku \"\" # back to the main model A tier takes a model through magpie, and only once the main model is one."],["settings","What changes in settings.json","Claude Code reads its endpoint from the env block of ~/.claude/settings.json. magpie changes only the keys it needs there. Comments and your other settings stay. Key Set to env.ANTHROPIC_BASE_URL The gateway’s address env.ANTHROPIC_AUTH_TOKEN The gateway’s key (not your vendor key; that stays in magpie) model The main model env.ANTHROPIC_DEFAULT_*_MODEL, env.ANTHROPIC_SMALL_FAST_MODEL The tiers, as above env.CLAUDE_CODE_MAX_OUTPUT_TOKENS The longest reply the model can write. Claude Code asks a model it doesn’t know for 32000 at most env.CLAUDE_CODE_MAX_CONTEXT_TOKENS, env.CLAUDE_CODE_AUTO_COMPACT_WINDOW Where needed, the model’s window and where to compact. Claude Code takes a model it doesn’t know for 200K. A 1M model is marked [1m] modelPicker magpie’s models, for /model. A picker you wrote yourself is left alone A value you set yourself, such as your own output limit, stays yours. ANTHROPIC_MODEL is taken out, because it would outrank a pick in /model. A cloud switch in that file, such as CLAUDE_CODE_USE_BEDROCK, is set aside while Claude Code runs through magpie and put back afterwards. Going back to Claude’s own models Pick one of Claude Code’s own models on its row, or run magpie claude default. magpie takes out what it wrote and puts back what it replaced the first time: your own base URL, token and tier models. You don’t edit the file by hand."],["subscriptions","GPT models from a ChatGPT or Copilot subscription","Sign in to the subscription in magpie: + Add provider, then the ChatGPT or Copilot tile. magpie opens the vendor’s own sign-in page. The account’s models then show in Claude Code’s picker as codex/… or copilot/…. magpie accounts add codex # sign in to a ChatGPT account magpie claude codex/gpt-5.5 Claude Code still speaks Anthropic Messages. magpie translates each request for the GPT model and the reply back, tool calls included. Antigravity accounts work the same way, as antigravity/…. For a ChatGPT plan in full, tiers, effort and limits included, see ChatGPT in Claude Code."],["routing","Routing over several keys","With several keys or accounts, magpie can spread Claude Code’s requests over them and move on when one runs out. Several keys for one vendor. Add them all to the provider and tick each one. Routing on the provider says how requests spread, and Fallback lists models to use when it is out of quota or down. One model from several providers. When two of your providers serve the same model, such as DeepSeek from its own API and from a relay, magpie makes the group auto/ by itself. Pick it for Claude Code. Your own group. New group in the Routing tab puts any models behind one name, group/. The routing modes are in Get started. By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Volcengine Ark · Tencent Cloud · Baidu Qianfan · SiliconFlow · ModelScope · Huawei Cloud MaaS · Xiaomi MiMo · StepFun · LongCat · Qwen · MiniMax · Anthropic · OpenAI · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama"],["faq","FAQ","Do I set ANTHROPIC_BASE_URL myself? No. magpie writes it into Claude Code’s settings.json. If CLAUDE_CODE_USE_BEDROCK, CLAUDE_CODE_USE_VERTEX or another cloud switch is set in your shell’s environment, Claude Code sends its requests to that cloud and not to magpie; magpie tells you so, and you take it out of your shell profile. Can I switch models inside Claude Code? Yes. While Claude Code runs through magpie, /model lists magpie’s models and routing groups, and a pick there persists. Which Chinese models can Claude Code use? Any that a provider you add serves. magpie has presets for DeepSeek, Kimi, Kimi Code, Zhipu GLM, Z.ai, MiniMax and Qwen, with China endpoints for Kimi, Kimi Code, MiniMax and Qwen. Others can be added as a custom URL. Does magpie have to be running? Yes, while Claude Code is on a model through magpie: the gateway runs with the app. magpie daemon install keeps it running as a service with no window. Can I keep my claude.ai sign-in? The Claude Code row has a sign-in setting. With magpie’s key, the default, Claude Code is signed out of claude.ai while it runs through magpie, so the plan limits in /usage, connectors, voice and /teleport are off. With claude.ai it keeps its sign-in, which magpie never passes on. Remote Control and ultrareview stay off either way. Can I use my Claude subscription and DeepSeek side by side? Yes. Sign in to Claude in magpie and its models are claude/… in the same picker. Requests on a Claude subscription run through the Claude Code installed on your computer. How do I undo it? Pick one of Claude Code’s own models in magpie, or run magpie claude default. What magpie wrote comes out, and what it replaced comes back. Using Codex too? See Use any model in Codex. On Claude Desktop? See Claude Desktop on any model. Stuck? Ask on Discord."]]],["/docs/claude-desktop","Claude Desktop",[["","","Claude Desktop has a third-party gateway mode: no Anthropic sign-in, and its Code and Cowork tabs work on any plan. magpie sets Desktop up in that mode with magpie’s gateway, so Desktop runs on any model you have in magpie: DeepSeek, Kimi, GLM, Qwen, an OpenAI key, or a ChatGPT or Copilot subscription. In its gateway mode Claude Desktop sends every request to one address instead of Anthropic. magpie writes that mode and a profile named magpie, pointing at its gateway, http://127.0.0.1:3425, into Desktop’s configuration folders. The gateway speaks Anthropic’s Messages API and translates each request for the model you picked, streaming, tool calls and reasoning included. It works on macOS, Windows (the Store package too) and Linux."],["on","Turn it on","Add providers in magpie In the Providers tab, add an API key or sign in to a subscription. Choose magpie on Claude Desktop’s row In the Agents tab, Claude Desktop’s row offers magpie: Desktop’s third-party gateway, Code and Cowork on magpie’s models, no Anthropic sign-in. Quit and reopen Claude Desktop Desktop reads this only as it starts. magpie claude-desktop magpie # Desktop on magpie's gateway magpie claude-desktop default # back to the Anthropic sign-in"],["models","Pick a model","Desktop lists the gateway’s models when it starts, so its model picker shows the models you have in magpie. A model with a 1M context window is listed once, as its 1M entry. After you add a provider in magpie, quit and reopen Desktop to see its models."],["tiers","The Code tab’s tiers","The Code tab runs Claude Code, which asks for models by tier: opus, sonnet, haiku. Left unset, a tier runs on the chat’s model. Pick a model for a tier on Claude Desktop’s row, or from a terminal, and restart Desktop after a change: magpie claude-desktop sonnet deepseek/deepseek-v4-pro magpie claude-desktop haiku deepseek/deepseek-v4-flash A picked model runs with the prompt of the Claude model of its tier. The row also has a subagent model, which takes effect without a restart."],["chats","Your chats and projects","Desktop keeps its gateway mode in a profile of its own, so chats and projects from your Anthropic sign-in don’t show while it runs on magpie. Nothing is deleted, and switching back brings them back. To go on with them on magpie, use Settings → Import in Desktop, which copies in your Claude.ai chats and projects and leaves the originals as they are."],["separate","A separate Claude Magpie app (Mac)","On a Mac, magpie can run Desktop’s gateway mode in a folder of its own, started by ~/Applications/Claude Magpie.app. Your own Claude Desktop stays signed in with Anthropic, and both run side by side. It is off by default. magpie claude-desktop launcher add # make Claude Magpie.app magpie claude-desktop launcher remove"],["off","Switch back","Take Claude Desktop’s row off magpie, or run magpie claude-desktop default, then quit and reopen Desktop. magpie puts Desktop’s files back as they were, and your chats from before are there again."],["faq","FAQ","Do I need a Claude subscription for Cowork and the Code tab? No. In gateway mode, Desktop’s Code and Cowork tabs work without an Anthropic sign-in, on whatever model magpie serves. Can I use my ChatGPT subscription in Claude Desktop? Yes. Sign in to ChatGPT in magpie, and its GPT models appear in Desktop’s model picker after a restart. Why doesn’t Claude Desktop show a new model? Desktop reads the model list as it starts. Quit and reopen it. Why is Claude Desktop in English on magpie? Desktop’s gateway-mode window has no translation of its own. Switching back brings your language back. Are my old chats gone? No. They stay in Desktop’s own profile and come back when you switch back, or you can import them with Settings → Import. The same models in the terminal: Models in Claude Code and ChatGPT in Claude Code. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/claude-science","Claude Science",[["","","Claude Science is Anthropic's research app: a daemon, claude-science, serves its UI on localhost, and a window (a Swift launcher on the Mac, Electron on Windows, a browser on Linux) attaches to the daemon running, or starts one. The daemon asks Anthropic's Messages API at the address its environment's ANTHROPIC_BASE_URL names, and the app has no setting for it. So magpie starts the daemon with ANTHROPIC_BASE_URL set to the gateway, and Claude Science runs on any model in magpie: DeepSeek, GLM, Kimi, Qwen or a ChatGPT subscription."],["on","Set up Claude Science","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Set Claude Science's provider to magpie on the Agents page magpie restarts its daemon; a session running in it is cut off. Open Claude Science again Reload its window if it is open, then pick one of magpie's models in its model menu."],["daemon","The daemon","magpie does one thing: stop, then serve --detached --no-browser on the port it was on, with ANTHROPIC_BASE_URL set. It sets no variable for you and writes none of Claude Science's files. Started by hand in a terminal, the same is: claude-science stop; ANTHROPIC_BASE_URL=http://127.0.0.1:3425 claude-science serve --detached Claude Science takes an https address, or http on a loopback address, so the local gateway's http://127.0.0.1 works as it is. magpie finds claude-science in the Mac app's bundle, Windows' per-user Programs folder, the ~/.local/bin its installers link it into (the only place on Linux), or on PATH."],["signin","The Claude sign-in","Claude Science still needs you signed in with your Claude account; API keys are not supported, and with no sign-in it sends nothing. Signed in, it sends that sign-in as its request's bearer, which magpie's gateway never passes on to any provider. The gateway knows its requests by the X-Anthropic-Surface: operon header it sends on every one."],["models","The model menu","Claude Science's model menu lists only ids that start with claude-, so magpie lists each model to it by an alias, claude-magpie-, named as the Agents page names it. Where no pick of yours is in play (its default before you pick, the haiku for its small tasks) it asks for Claude's own ids; one magpie doesn't serve goes to the model its last turn was on."],["keep","Staying connected","The daemon runs until it is stopped or the computer restarts. While it is connected magpie starts it again when it isn't running. Claude Science's window starts its own, without the variable, when none runs, and the app may offer to run its own after an update. magpie puts its daemon back once no session runs in the other, but never in place of one a service manager such as launchd or systemd keeps, which would come back at once; the Agents page says so meanwhile. One you keep putting back within an hour is left running."],["wsl","WSL","With Claude Science in a WSL distro, magpie on Windows starts its daemon there through wsl.exe with ANTHROPIC_BASE_URL set, and keeps it connected while the distro runs; it never starts a stopped distro. In mirrored networking the distro's 127.0.0.1 is Windows', and the daemon is given the gateway's address. Under NAT magpie starts a socat relay in the distro on 127.0.0.1 at the gateway's port, leading to Windows' address on the WSL network."],["off","Switching back","Turn magpie off for Claude Science on the Agents page, and magpie restarts its daemon, when it runs, without the variable, back on Anthropic's API."],["faq","FAQ","Can Claude Science run on DeepSeek, GLM or a ChatGPT subscription? Yes. Set Claude Science's provider to magpie on magpie's Agents page, then pick one of magpie's models in its model menu. Does magpie change Claude Science's files or my environment? No. magpie only restarts its daemon with ANTHROPIC_BASE_URL set; it writes no file and sets no variable for you. Do I still sign in with a Claude account? Yes. Claude Science doesn't take API keys and needs a Claude sign-in, which magpie never passes on to any provider. Why do its models read claude-magpie? Claude Science lists only ids that start with claude-, so magpie lists each model as claude-magpie-, named as its Agents page names it. More agents on the same models: Claude Desktop on any model, mu on any model, Mister Morph on any model and VS Code on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/cline","Cline",[["","","Cline runs on the provider and model in its settings. magpie sets Cline’s built-in OpenAI-compatible provider to magpie’s gateway, so Cline’s CLI, VS Code extension and desktop app can run on any model you have in magpie: DeepSeek, Kimi, GLM, Qwen, an OpenAI key, or a ChatGPT or Copilot subscription, with no key pasted into Cline. Cline keeps its providers in ~/.cline/data/settings/providers.json (or under $CLINE_DIR). magpie sets Cline’s own openai-compatible provider to the gateway’s address with a key of Cline’s own, makes it the provider in use, and lists magpie’s models for it in models.json, in place of the one model that provider lists by itself. What was there, and the provider you used, are kept aside and put back when you switch back. The gateway translates each request for the model’s provider, tool calls and reasoning included."],["on","Connect Cline","Add providers in magpie In the Providers tab, add an API key or sign in to a subscription. Pick a model on Cline’s row In the Agents tab, choose a model on Cline’s row. Start a new Cline session Cline reads its provider as a session starts: open sessions keep the model they have, new ones use this. magpie cline deepseek/deepseek-v4-pro # Cline on DeepSeek magpie cline # what Cline runs on now"],["models","Model and reasoning effort","The row also sets the reasoning effort Cline asks for: none, low, medium, high or xhigh. None turns thinking off, as Cline’s own picker does. magpie cline effort high magpie cline effort default # back to Cline's own"],["vscode","The VS Code extension","Cline’s VS Code extension uses the same folder but reads the provider, model, address and key from its own state first: the Act and Plan modes’ provider and model, and the OpenAI-compatible key. magpie sets those too, keeping what they were. The extension reads them once, as it starts, so after a change run Developer: Reload Window in VS Code."],["desktop","The desktop app","Cline’s desktop app keeps the model and effort you pick in its own composer and doesn’t read them from these files. magpie’s models are in its picker, under magpie: pick one there. magpie’s row sets the CLI and the VS Code extension."],["off","Switch back","Take Cline’s row off magpie, or run magpie cline default. magpie puts back the provider you used, the model list, and the extension’s settings as they were."],["faq","FAQ","Can Cline use my ChatGPT subscription? Yes. Sign in to ChatGPT in magpie and pick a GPT model on Cline’s row. Cline sends its requests to magpie, which uses the subscription. I changed the model but Cline still uses the old one. A session keeps the model it started with. Start a new one; for the VS Code extension, reload the window. Why doesn’t magpie add its own provider to Cline? Cline refuses a provider it doesn’t know when a session starts, so magpie uses Cline’s built-in OpenAI-compatible provider instead. Does this work in Cline’s desktop app? Its picker lists magpie’s models under magpie; pick the model there, since the app doesn’t read it from Cline’s files. More agents on the same models: Models in OpenCode, Models in Claude Code, Hermes Agent on any model, Goose on any model and Zoo Code on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/codebuddy","CodeBuddy",[["","","CodeBuddy is Tencent's AI coding tool: the CodeBuddy Code CLI (codebuddy, cbc) and the CodeBuddy IDE. Both the international edition (codebuddy.ai) and the China one (codebuddy.cn) take custom models. magpie writes your magpie models into that list, so CodeBuddy runs on DeepSeek, GLM, Kimi, Qwen, an OpenAI or Anthropic key, or a ChatGPT or Copilot subscription, and those models need no CodeBuddy sign-in. CodeBuddy Code is one npm package, @tencent-ai/codebuddy-code, for both editions; the China one is told apart by CODEBUDDY_INTERNET_ENVIRONMENT=internal. Both read custom models from ~/.codebuddy/models.json (or $CODEBUDDY_CONFIG_DIR), and the CodeBuddy IDE reads the same file. So magpie has one row, CodeBuddy, for the CLI and the IDE."],["on","Set up CodeBuddy","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Pick a model on CodeBuddy's row On the Agents page, pick a model under magpie. magpie writes every model into models.json and the one you picked into settings.json's model. Start a new session CodeBuddy Code reads its model when a session starts: restart codebuddy, or run /clear in an open session. magpie codebuddy deepseek/deepseek-v4-pro magpie codebuddy # show what it is set to"],["file","models.json","Each model magpie writes points at the magpie gateway on this computer and is asked under a Bearer key magpie gives CodeBuddy. CodeBuddy calls that address itself, not through Tencent's servers, with no CodeBuddy sign-in. {\"models\": [{ \"id\": \"deepseek/deepseek-v4-pro\", \"name\": \"DeepSeek V4 Pro\", \"vendor\": \"magpie\", \"apiKey\": \"…\", \"url\": \"http://127.0.0.1:3425/v1/chat/completions\", \"maxInputTokens\": …, \"maxOutputTokens\": …, \"supportsToolCall\": true, \"supportsImages\": …, \"reasoning\": {…} }, …]} maxInputTokens and maxOutputTokens come from magpie's catalog; without maxOutputTokens CodeBuddy caps every reply at its own default. A model that thinks carries its levels (supportedEfforts, defaultEffort) and canDisableThinking when thinking can be turned off; a model with a window over 200K offers two sizes in contextWindow. CodeBuddy picks up a change to the file without a restart."],["cli","CodeBuddy Code","In the CLI, the model a session starts on is settings.json's model: one of magpie's ids from models.json, or one of CodeBuddy's own. magpie tells CodeBuddy's requests apart by their key, so Usage counts them under CodeBuddy."],["ide","CodeBuddy IDE","CodeBuddy.app (codebuddy.ai) and CodeBuddy CN.app (codebuddy.cn) read the same ~/.codebuddy/models.json. They watch the file, sync their model list when it changes, and list magpie's models in the IDE's own model picker. The IDE needs no CLI; with only the IDE installed, magpie still shows the CodeBuddy row. Two differences: the IDE always reads .codebuddy in your home folder, whatever CODEBUDDY_CONFIG_DIR says, and it doesn't read settings.json's model, so the model is picked in the IDE."],["own","Your own models","Models you added to models.json yourself stay as they are; magpie updates only its own, in the place they were. A magpie model you turned off in CodeBuddy stays off, and a default thinking level you set on one stays while the model still offers it. When the file has availableModels (the models to show), magpie's are added to it and the rest you listed stay."],["wsl","WSL","On Windows, a WSL distro with CodeBuddy Code installed has its own row. It writes the distro's ~/.codebuddy/models.json, naming the gateway as the distro reaches it, with the key it takes from there. CODEBUDDY_CONFIG_DIR isn't read there."],["off","Switching back","Pick one of CodeBuddy's own models on the row: magpie takes its models out of models.json and sets settings.json's model to yours. Or from a terminal: magpie codebuddy default"],["faq","FAQ","Can CodeBuddy use DeepSeek, GLM, Kimi or Qwen? Yes. magpie writes them as custom models into ~/.codebuddy/models.json, and they show in both CodeBuddy Code's and the CodeBuddy IDE's model list. Do magpie's models need a CodeBuddy sign-in? No. They call the magpie gateway on this computer under the key magpie gives CodeBuddy, not through a CodeBuddy account. Does the China edition and CodeBuddy CN work? Yes. Both CLI editions are one npm package, and CodeBuddy.app and CodeBuddy CN.app read the same models.json, so one row covers them all. I changed the model and nothing happened. CodeBuddy Code reads its model when a session starts. Restart codebuddy or run /clear. In the IDE, pick the model in its model picker. More agents on the same models: Models in Claude Code, Kimi Code on any model, Qwen Code on any model and T3 Code on any model. Tencent Cloud's models: Tencent Cloud. Notes on the same models: Obsidian on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/codex-models","Models in Codex",[["","","Codex speaks one API, OpenAI Responses. magpie puts a gateway on your computer that speaks it for every provider you add, and writes Codex’s config.toml for you. The models then show in Codex’s /model, with their reasoning efforts. The gateway runs at 127.0.0.1:3425. When a provider serves the Responses API itself, as DeepSeek and the Zhipu GLM Coding Plan do, Codex’s request is passed on as it is. When it serves only Chat Completions or Anthropic Messages, as Kimi, MiniMax and Qwen do, or a Claude subscription, magpie translates the request and the reply, streaming and tool calls included. Chinese models DeepSeek, Kimi and Kimi Code, Zhipu GLM (pay as you go or Coding Plan), Z.ai, MiniMax and Qwen, each with its China endpoint where it has one. Claude Your Claude subscription’s models, or an Anthropic key’s. Anything else Any OpenAI- or Anthropic-compatible URL and key, Copilot and Antigravity accounts, Ollama and LM Studio."],["setup","Set it up","Add the provider In magpie’s Providers tab, press + Add provider, pick DeepSeek, Kimi, Zhipu GLM, MiniMax or Qwen, paste your API key and save. magpie asks the vendor which models it serves. Pick the model for Codex In the Agents tab, click the model on the Codex row and choose one, such as deepseek/deepseek-v4-pro. The effort slider under the list sets its reasoning effort. magpie writes both into ~/.codex/config.toml. Restart Codex Codex builds its model list when it starts. Restart the Codex app, and open new codex sessions, after a switch. The same from a terminal: magpie provider add deepseek sk-… magpie models # every model, as provider/model magpie codex deepseek/deepseek-v4-pro magpie codex effort high Zhipu GLM Coding Plan. When you add Zhipu GLM or Z.ai, pick the plan your key is for. A Coding Plan key has its own endpoints, and sent to the pay-as-you-go one it is told it has no balance."],["model-list","The models in Codex’s /model","magpie’s models are listed in Codex’s /model beside its own, so you can switch there too. Each one carries what Codex needs to run it: its reasoning efforts and default effort, its context window and the base instructions Codex sends with it. How they get there depends on how Codex is signed in: Signed in to ChatGPT. Codex keeps its own OpenAI provider and your sign-in. magpie points it at the gateway with openai_base_url; Codex’s own models still go to OpenAI on your account, and magpie’s models join them in /model. Not signed in, or signed in with an API key. magpie becomes Codex’s provider, and the list comes from a catalog file magpie writes, magpie-models.json beside config.toml."],["config","What changes in config.toml","magpie changes only the keys it needs in ~/.codex/config.toml. Comments, ordering and your other settings stay. Key Set to model The model you picked model_reasoning_effort The effort, when you set one openai_base_url The gateway’s address. A base URL of your own stays model_provider \"magpie\", when magpie is the provider model_catalog_json The path of the catalog file, magpie-models.json, when magpie is the provider [model_providers.magpie] name, base_url (the gateway’s /v1), wire_api = \"responses\", and the gateway’s key. Your vendor keys stay in magpie model = \"deepseek/deepseek-v4-pro\" model_provider = \"magpie\" model_catalog_json = \"/Users/you/.codex/magpie-models.json\" [model_providers.magpie] name = \"magpie\" base_url = \"http://127.0.0.1:3425/v1\" wire_api = \"responses\" That is the shape when magpie is the provider; the table also carries the gateway’s key and a header. Signed in to ChatGPT, only openai_base_url and model are set at the top. The [model_providers.magpie] table stays once written. A Codex thread keeps the provider it was started on, and a thread started on magpie can’t be opened again without it. Going back to OpenAI’s models Pick one of Codex’s own models on its row, or run magpie codex default. magpie takes model_provider, model_catalog_json and the base URL back out and puts back the provider and model you had. A provider of your own at the top stays. Threads started on magpie are moved back to the provider Codex is on, so Codex lists them, and a copy is kept in magpie’s trash."],["claude","Claude in Codex","Sign in to your Claude subscription in magpie: + Add provider, then the Claude tile. Its models are claude/… in Codex’s picker. magpie translates Codex’s Responses requests into Anthropic Messages and the replies back. magpie accounts add claude # sign in to a Claude account magpie models | grep '^claude/' magpie codex claude/… Requests on a Claude subscription run through the Claude Code installed on your computer, so keep it installed. An Anthropic API key works too: add Anthropic as a vendor and pick an anthropic/… model."],["routing","Routing over several keys","Several keys for one vendor. Add them all to the provider and tick each one. Routing on the provider says how requests spread, and Fallback lists models to use when it is out of quota or down. One model from several providers. When two of your providers serve the same model, magpie makes the group auto/ by itself. Pick it for Codex. Your own group. New group in the Routing tab puts any models behind one name, group/. The routing modes are in Get started. By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Volcengine Ark · Tencent Cloud · Baidu Qianfan · SiliconFlow · ModelScope · Huawei Cloud MaaS · Xiaomi MiMo · StepFun · LongCat · Qwen · MiniMax · Anthropic · OpenAI · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama"],["faq","FAQ","Do I write [model_providers] myself? No. magpie writes Codex’s config.toml when you pick a model. You don’t export OPENAI_BASE_URL either. Does my ChatGPT sign-in still work? Yes. Signed in to ChatGPT, Codex keeps its own provider and sign-in. Its own models go to OpenAI on your account, and magpie’s are added beside them. I picked a model, but Codex’s /model doesn’t show it. Codex reads its model list when it starts. Restart the Codex app and open a new codex session. Can I set the reasoning effort? Yes, on the Codex row’s effort slider, with magpie codex effort high, or in Codex’s /model, which lists each model’s efforts. Which Chinese models can Codex use? Any that a provider you add serves. magpie has presets for DeepSeek, Kimi, Kimi Code, Zhipu GLM, Z.ai, MiniMax and Qwen. Others can be added as a custom URL. Does magpie have to be running? Yes, while Codex is on a model through magpie: the gateway runs with the app. magpie daemon install keeps it running as a service with no window. How do I undo it? Pick one of Codex’s own models in magpie, or run magpie codex default. magpie’s keys come out, and your provider and model come back. Using Claude Code too? See Use any model in Claude Code. Stuck? Ask on Discord."]]],["/docs/coding-plans","OpenCode Go and ClinePass",[["","","OpenCode Go and ClinePass are monthly plans for open coding models: OpenCode Go at $10 a month, ClinePass at $9.99. magpie's opencode-go and clinepass presets bring them to Claude Code, Codex, OpenCode and other agents, not only their own clients."],["add","Add it","Get a key. OpenCode Go's at opencode.ai/auth, ClinePass's at app.cline.bot. Add it. Pick OpenCode Go or ClinePass in the app and paste the key into API key, or from the CLI: magpie provider add opencode-go magpie provider add clinepass magpie models The presets have the addresses set. An OpenCode Go or ClinePass provider set up in OpenCode becomes its preset when imported."],["agents","Use it in an agent","Model ids are provider/model; ClinePass's own ids start with cline-pass/. magpie claude opencode-go/ magpie codex clinepass/cline-pass/glm-5.3 When Claude Code, Codex or Gemini CLI speaks another protocol than the plan's, magpie translates."],["go","OpenCode Go","OpenCode Go serves each model on one protocol of three and turns it away on the other two (\"Model does not support this protocol\"). magpie sends each as OpenCode does: GPT, Grok and Muse Spark on Responses, Claude, MiniMax and some Qwen on Anthropic Messages, Gemini on Gemini's API, the rest on Chat Completions. Chat and Responses are at https://opencode.ai/inference/go/openai/v1, Messages at https://opencode.ai/inference/go/anthropic and Gemini at https://opencode.ai/inference/go/google/v1beta, as Go's docs give them. An OpenCode Go provider saved with the old addresses is moved to these. Quota shows the plan's three windows, 5 hours, 7 days and Month: how much is used and when each resets."],["clinepass","ClinePass","Chat Completions is at https://api.cline.bot/api/v1. Cline's API lists only its paid models, not the plan's, so magpie takes the models from the list Cline's own clients use: the plan's, plus Cline's free models; paid models are left out. Cline's free models (ids starting cline-free/) cost nothing and are apart from ClinePass's quota. They answer Cline's own clients alone, so magpie sends the headers Cline's desktop app sends. When that list can't be had, magpie asks the API's own list, with the free models as Cline's desktop app last listed them."],["notes","Notes","When a plan is limited or used up, put it in a routing group with other providers and the group's next member answers. See Round robin and failover across accounts, keys and providers. Prices, quotas and models are as OpenCode's and Cline's own pages say, and change."],["faq","FAQ","Can Claude Code use OpenCode Go? Yes. Add it with magpie provider add opencode-go and your key, and ask for opencode-go/. magpie sends each model on the protocol Go serves it on, translating when needed. OpenCode Go says Model does not support this protocol. What now? The model went to the wrong protocol. magpie picks each model's protocol as OpenCode does: add it with the opencode-go preset, and a provider saved with the old addresses is moved to the new ones. Can I use ClinePass outside Cline? Yes. Add it with magpie provider add clinepass and a Cline key; the plan's models and Cline's free ones are in every agent's picker. Where do I see what is left of OpenCode Go? magpie's Quota page shows OpenCode Go's 5-hour, 7-day and monthly windows, with what is used and when each resets. Related: Use DeepSeek, Kimi, GLM or your Claude and ChatGPT subscription in OpenCode, Cline on any model, Quota left on every subscription and key. If something fails, see Fixing common errors: 401, 429, 502, 504 and more or ask on Discord."]]],["/docs/copilot-cli","Copilot CLI",[["","","GitHub Copilot CLI can run on model providers of your own (bring your own key), which needs no GitHub sign-in. magpie adds itself to Copilot CLI as one, so copilot can run on any model you have in magpie: DeepSeek, Kimi, GLM, Qwen, an OpenAI key, or a ChatGPT subscription, with no key pasted into Copilot. Copilot CLI keeps its folder in ~/.copilot (or $COPILOT_HOME). Its own providers are in providers.json there (or $COPILOT_PROVIDERS_CONFIG). magpie adds a provider named magpie to that file, OpenAI-compatible, with the gateway’s address and a key of Copilot’s own, and adds magpie’s models beside it, each with its name, context window and output limit. Then it sets model in settings.json to magpie/. The gateway translates each request for the model’s provider, tool calls and reasoning included."],["on","Connect Copilot CLI","Add providers in magpie In the Providers tab, add an API key or sign in to a subscription. Pick a model on Copilot CLI’s row In the Agents tab, choose a model under magpie. Start copilot It runs on that model. Copilot’s own /model lists magpie’s models too. magpie copilot deepseek/deepseek-v4-pro # settings.json: magpie/deepseek/deepseek-v4-pro magpie copilot # what Copilot CLI runs on now The row also lists Copilot’s own models and auto, Copilot’s own choice, for when you want GitHub’s models back."],["effort","Effort","The row sets effortLevel, which Copilot saves beside the model: the model’s own levels, or low, medium, high and xhigh when Copilot’s list doesn’t name them. Copilot clears it when its own /model changes the model. magpie copilot effort high magpie copilot effort default"],["file","Your providers.json","magpie owns only the provider named magpie and the models that name it. Your other providers, their models and any other key in the file stay where they are, and so does a key you add to magpie’s provider yourself. A providers.json that isn’t valid JSON is left alone, never written over. When magpie’s models change, magpie brings its entries up to date, and writes the file only when they would change."],["off","Switch back","Pick one of Copilot’s own models on the row, or run magpie copilot default. That removes model from settings.json and takes magpie’s provider and models out of providers.json, leaving the rest."],["faq","FAQ","Do I need a GitHub Copilot subscription? No. Copilot CLI’s own providers need no GitHub sign-in, so magpie’s models work without a Copilot plan. Can Copilot CLI use my ChatGPT subscription? Yes. Sign in to ChatGPT in magpie and pick a GPT model under magpie on Copilot CLI’s row. Copilot sends its requests to magpie, which uses the subscription. Why does settings.json say magpie/deepseek/…? Copilot names a model of one of its providers as provider/model, and magpie’s provider is called magpie. On the command line you can leave the magpie/ out. Can I keep my own BYOK providers? Yes. magpie only touches its own provider and models in providers.json; yours stay as they are. More agents on the same models: Models in OpenCode, Models in Claude Code, Raycast on any model and Qwen Code on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/copilot-jetbrains","JetBrains Copilot",[["","","The GitHub Copilot plugin in JetBrains IDEs (IntelliJ IDEA, PyCharm, GoLand and the rest) and Android Studio takes other vendors' models through Bring Your Own Key: Manage Models… in Copilot Chat's model picker, then Add Custom Endpoint Provider. magpie writes that custom endpoint for you, named magpie, so every model in magpie (DeepSeek, GLM, Kimi, Qwen, Claude, a ChatGPT subscription and the rest) is in Copilot Chat's picker. To use a Copilot subscription in other agents instead, see GitHub Copilot in Claude Code, Codex, Gemini CLI and OpenCode."],["on","Set up JetBrains Copilot","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Set Copilot (JetBrains)'s provider to magpie on the Agents page magpie writes its endpoint into Copilot's byok.json. Restart the IDE The IDE lists the endpoints when Copilot signs in, so magpie's models show after a restart. Pick a model in Copilot Chat's model picker magpie's models are listed under magpie. The IDE keeps the one you pick in its project files. magpie lists Copilot (JetBrains) on the Agents page when a JetBrains IDE or Android Studio has the github-copilot-intellij plugin in its plugins folder, or when byok.json already has magpie's endpoint."],["plan","Which Copilot plan","Bring Your Own Key needs Copilot signed in to GitHub. The personal plans, Copilot Free, Pro and Pro+, have it; Business and Enterprise have it when the organisation's policy allows it. Its requests say GithubCopilot/, as every client of the Copilot language server does, so magpie tells them apart by their key."],["file","byok.json","The JetBrains plugin keeps none of this itself. It asks the Copilot language server it bundles (copilot-language-server), which keeps every custom endpoint in one JSON file and reads it again each time it is used: With $XDG_CONFIG_HOME set (and absolute): $XDG_CONFIG_HOME/github-copilot/byok.json Windows: %USERPROFILE%\\AppData\\Local\\github-copilot\\byok.json macOS and Linux: ~/.config/github-copilot/byok.json A custom endpoint is three keys there. magpie writes them as the language server itself saves them: // ~/.config/github-copilot/byok.json { \"magpie-provider-config\": { \"groupName\": \"magpie\", \"apiType\": \"chatCompletions\" }, \"magpie-api-key\": \"\", \"magpie-models-config\": { \"…\": { \"deploymentUrl\": \"http://127.0.0.1:3425/v1/chat/completions\", \"isRegistered\": true, \"isCustomModel\": true, \"modelCapabilities\": { \"name\": \"…\", \"maxInputTokens\": …, \"maxOutputTokens\": …, \"toolCalling\": true, \"vision\": … } } }, … } Each model points at the gateway's /v1/chat/completions, with the key sent as a Bearer token. The key is in this file in plain text, not in the IDE's password safe. Xcode's and Eclipse's Copilot run the same language server and read the same file, so they list magpie's models too."],["agent","Agent mode and context","Tool calling is on for every model, as Copilot's agent mode lists only models that call tools. maxInputTokens is the window the server fills: the context length from magpie's catalog, or the server's own 128K default for a custom endpoint when that isn't known. maxOutputTokens stays within that window."],["yours","What stays yours","Your other endpoints and keys in byok.json stay as they are. A magpie model you hid in the IDE's Manage Models stays hidden after a sync. When nothing changed, magpie doesn't write the file, so it stays as the language server last wrote it."],["off","Switching back","When you switch Copilot (JetBrains) off in magpie, magpie deletes its three keys from byok.json. Your own endpoints are left alone."],["faq","FAQ","Can Copilot in JetBrains use DeepSeek or GLM? Yes. magpie writes a custom endpoint into Copilot's byok.json; restart the IDE and pick a model under magpie in Copilot Chat's picker. Does Copilot Business work? Bring Your Own Key works on Business and Enterprise when the organisation's policy allows it, and on Free, Pro and Pro+. Can agent mode use magpie's models? Yes. magpie turns tool calling on for every model, and Copilot's agent mode lists only models that call tools. Do Xcode's and Eclipse's Copilot get them too? Yes. They run the same Copilot language server and read the same byok.json. More agents on the same models: VS Code on any model, Copilot CLI on any model, OpenMausBot on any model and Kiro Crew on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/copilot","GitHub Copilot in Claude Code, Codex, Gemini CLI and OpenCode",[["","","A Copilot seat comes with Claude, GPT and Gemini models, among others. Sign in to Copilot once in magpie, and Claude Code, Codex, Gemini CLI, OpenCode and every other agent you connect can use the models your plan gets, through magpie’s gateway at 127.0.0.1:3425. No API key."],["add","Sign in to Copilot","Open Add provider In magpie’s Providers tab, press + Add provider and click the Copilot tile. Enter the code on GitHub magpie shows a code and opens GitHub’s device page, github.com/login/device. Enter the code and approve. magpie then asks GitHub whose account it is and which plan it has, and the account shows under Copilot. Pick a model for an agent In the Agents tab, click the model on the agent’s row and choose a copilot/… model. magpie accounts add copilot # github.com magpie accounts add copilot --host acme.ghe.com # GitHub Enterprise on GHE.com magpie accounts copilot # each account and what it has used magpie serves a Copilot sign-in from three places: Copilot’s editor plugins. The sign-in they keep in ~/.config/github-copilot (apps.json or hosts.json). The Copilot CLI. Its sign-in in ~/.copilot/config.json, with the token in the system keychain or in that file. magpie on Windows also reads the Copilot CLI sign-in of a running WSL distro, from config.json only. magpie’s own. Each account you sign in with a code in magpie. Its token is kept in magpie’s own logins.json. The editors’ and the CLI’s sign-ins are only read; magpie never writes them. When both are there, the editors’ github.com sign-in comes first, then the CLI’s, then an editor’s GHE.com sign-in. If GitHub turns away the editors’ token, magpie uses the CLI’s sign-in of the same account instead, never another account’s. GitHub Enterprise on GHE.com. An enterprise with data residency signs in at its own .ghe.com, so add the account with --host (or answer the GHE.com question in the sign-in sheet). magpie accepts github.com or a .ghe.com address and nothing else, so a GitHub token is never sent to a host of your choosing. The account is served at its enterprise’s copilot-api..ghe.com. One login on github.com and on GHE.com is two accounts: you and you@acme.ghe.com."],["models","The models your seat gets","magpie asks Copilot’s /models for each account and lists what comes back, so the list follows your plan rather than a fixed table. The models are named copilot/ and Copilot’s own id: copilot/claude-opus-5.5, copilot/gpt-5.4, copilot/gpt-5.3-codex. magpie models prints them all. Chat models only. Copilot’s internal models and the ones no model picker offers are left out, and so is a model the account isn’t allowed to turn on. Terms to accept. A model whose terms are still waiting is listed anyway. The first request for it accepts them, as turning it on in Copilot’s editor would. Reasoning efforts come from what Copilot lists for each model, and show in each agent’s picker. Auto is always on the list; see Copilot Auto. Image models such as GPT Image 2.5 Flare are listed for drawing (Settings → Models → Images), and are never offered as a chat model. Older models. A model for which Copilot names no API, such as GPT-4.1 and GPT-4o on a Student plan, is asked on Chat Completions only. Claude Code reads a Claude version written with a dot as an older model, so magpie gives it Copilot’s Claude models with dashes (claude-opus-5-5) and turns the name back before the request reaches Copilot. Other agents see Copilot’s own spelling."],["agents","In each agent","Pick the model on an agent’s row in the Agents tab, or from a terminal. Each guide says what magpie writes in that agent’s config and how to switch back. magpie claude copilot/claude-opus-5.5 magpie codex copilot/gpt-5.4 magpie gemini model copilot/gpt-5.4-mini magpie opencode copilot/claude-opus-5.5 Claude Code speaks Anthropic Messages. Copilot serves its Claude models on Messages too, so Claude Code’s requests go to them as they are; a GPT or Gemini model gets them translated. Models in Claude Code. Codex speaks only OpenAI Responses, and magpie asks Copilot’s OpenAI models on Responses, so they pass through. Codex’s web search runs on Copilot’s side for those models, and Codex’s native compaction works with them too, but not with Copilot’s Claude models. Models in Codex. Gemini CLI speaks Gemini’s API. magpie points it at its gateway and translates. Models in Gemini CLI. OpenCode gets the model in opencode.json, with its reasoning variants. Models in OpenCode. The Copilot CLI is one of the agents magpie connects, too. Its row offers auto (Copilot picks) and Copilot’s own models, plus every other model you have added to magpie, which reach it through the Copilot CLI’s providers.json."],["apis","How requests reach Copilot","Copilot doesn’t serve every model on every API. Its newest OpenAI models answer only on Responses; its Claude models on Chat Completions and Anthropic Messages; its Gemini models and the older ones on Chat Completions only. magpie sends each request on an API the model is served on, and translates between that API and the agent’s when they differ, streaming and tool calls included. Wrong API. When Copilot answers that a model isn’t served on the API it was asked on, magpie rebuilds the request for the next one and remembers which one worked. Pin one yourself. magpie model api copilot/ chat (or responses, anthropic) asks the model on that API only; auto hands the choice back to magpie. Tool schemas for Gemini. Copilot turned some of Codex’s tool schemas away for its Gemini models with 400 “invalid request body”. magpie rewrites the ones it can prove safe to rewrite, so those tools reach the model."],["auto","Copilot Auto","copilot/auto is the model Copilot chooses for your account. It isn’t in Copilot’s /models, so magpie always adds it. On a Student plan it is the only model you may choose. magpie asks Copilot for a pick with the turn’s prompt, at Copilot Chat’s default setting, and keeps a pick for at most an hour. If Copilot has no Auto for the account, or picks a model the account was refused, a model the account may pick by hand stands in for 10 minutes: Copilot’s base model, its default, gpt-4.1, a model that isn’t premium, then the rest. If Copilot then refuses the model Auto picked, magpie picks another and sends the request again. The model Auto chose is noted on the request’s route, so you can see what answered."],["usage","Premium requests, usage and cost","Each Copilot account has a card with three allowances, as GitHub reports them: Premium requests, Chat requests and Completions, each as used / allowance. magpie accounts copilot prints the same. Monthly. The allowances renew each month, on the date GitHub gives. Unlimited shows as Unlimited. A window GitHub gives no figure for is left off the card, never shown as unlimited. One request a turn. A turn you type is billed as one request; the tool replies that carry it on are not. Business and Enterprise. A seat that uses up its allowance is paused, so magpie counts the account as used up and moves on to the next one. An organization’s pooled premium allowance shows as used up once the pool is spent. Other plans. When your plan lets you pay past the premium allowance, using it up doesn’t stop the account. Completions are counted too, but no request through magpie uses them. No allowance. Copilot’s base model, gpt-4.1, is billed to no allowance on any plan. The Usage tab counts tokens, cache hits and cost for each agent and model that went through magpie. Cost on a subscription is an estimate at the model maker’s list price, or at the price you set for the model. One difference from Anthropic’s own pricing: Copilot bills a cache write at one price however long it is kept, so magpie prices a 1-hour write at the 5-minute rate. For claude-opus-5.5 that is $5 per million tokens, where Anthropic’s 2× input would be $8."],["accounts","Several accounts and failover","Add another. Click the Copilot tile again, or run magpie accounts add copilot again. The one in use is listed first, then the rest in the order you added them. Choose which goes first. magpie accounts switch copilot ; magpie accounts forget copilot removes one. With the same login on github.com and GHE.com, name it in full (you@acme.ghe.com) or add --host. Spread requests. Tick the accounts to use on Copilot’s row. Routing sets how requests spread over them, Smart by default; the provider’s Fallback lists models to use when every account is out, rate limited or down. See Subscriptions in any agent. One model from two subscriptions. Claude Opus from your Claude subscription and from Copilot become one group by themselves, auto/. To set the order yourself: magpie group add \"Opus anywhere\" models=claude/claude-opus-5-5,copilot/claude-opus-5.5 routing=order. A stale editor sign-in. When GitHub refuses the token Copilot’s editors keep, an account you signed in to magpie with the same login is kept and used."],["trouble","Troubleshooting","What you see What it means GitHub refused this Copilot sign-in; sign in again GitHub turned the account’s token away. Sign in again from its row: the account is signed in again in place, and its settings stay. A network error or a 5xx from GitHub never marks an account, and the mark goes when a request is served. the GitHub token Copilot’s editors keep in … was refused The editors’ sign-in has lapsed. Sign in to Copilot again in your editor or in magpie, or move that file aside. has no Copilot subscription The GitHub account you approved has no Copilot plan. Sign in with the account that has the seat. Copilot doesn’t serve this model on Anthropic’s Messages API; it isn’t about your plan Copilot serves that model on other APIs only. magpie model api copilot/ chat sends it on Chat Completions. The requested model is not supported. Copilot won’t serve that model to this account now. magpie leaves it out of the account’s models and the agents’ pickers for 6 hours, then tries it again. Under Auto, another model is picked and the request is sent again. Copilot doesn’t offer Auto to this account … Copilot made no pick and the account lists no model it may pick by hand. Check the plan at github.com/settings/copilot. the code expired; start again · the sign-in was declined on GitHub The device code ran out before it was entered, or the request was declined on GitHub’s page. Start the sign-in again. Copilot signs in on github.com or an enterprise’s .ghe.com, not … The --host given isn’t github.com or a GHE.com address. subscription accounts are off in magpie Settings → Privacy → Subscription accounts is off (or magpie accounts discovery off was run), so magpie reads no sign-in and serves no subscription, Copilot included. Turn it on, or run magpie accounts discovery on."],["faq","FAQ","How do I use GitHub Copilot in Claude Code? Sign in to Copilot in magpie (Providers, Add provider, Copilot; GitHub gives you a code to enter), then pick a copilot/… model such as copilot/claude-opus-5.5 on Claude Code’s row, or run magpie claude copilot/claude-opus-5.5. magpie writes Claude Code’s settings.json. Copilot’s Claude models get Claude Code’s Anthropic requests as they are; its GPT and Gemini models get them translated. Can Codex use Copilot’s models? Yes. Codex speaks OpenAI Responses, and magpie asks Copilot’s OpenAI models on Responses too, so they pass through, web search included. Copilot’s Claude and Gemini models are translated. Pick one on Codex’s row or run magpie codex copilot/gpt-5.4; it shows in Codex’s /model list. Can I use Copilot in Gemini CLI and OpenCode? Yes. Run magpie gemini model copilot/gpt-5.4-mini or magpie opencode copilot/claude-opus-5.5, or pick the model on the agent’s row. magpie translates Gemini CLI’s requests, and writes the model into OpenCode’s opencode.json. Do I need VS Code or another editor signed in to Copilot? No. magpie signs in to GitHub itself with a device code. If Copilot’s editor plugins or the Copilot CLI are already signed in on this computer, magpie reads that sign-in too, and never changes it. Does it spend my premium requests? Requests go to Copilot on your account, so they count against your plan as Copilot counts them. A turn you type is billed as one request; the tool replies that carry it on are not. magpie shows each account’s Premium requests, Chat requests and Completions as used out of the allowance. Does it work with Copilot Business, Enterprise and GHE.com? Yes. magpie reads the plan from GitHub: Free, Pro, Pro+, Max, Education, Business or Enterprise. An enterprise on GHE.com signs in with magpie accounts add copilot --host .ghe.com. A Business or Enterprise seat that uses up its allowance is paused, and magpie counts the account as used up until it renews. Why is a Copilot model missing from my list? magpie lists what Copilot’s /models gives the account: chat models only, without the ones no model picker offers or the account can’t turn on. A model Copilot answered with “The requested model is not supported.” is left out for 6 hours, then tried again in case your plan changed. By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Qwen · MiniMax · Anthropic · OpenAI · Gemini · Grok · Mistral · OpenRouter · Ollama Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode, Copilot CLI on any model. Ask on Discord if you get stuck."]]],["/docs/craft-agents","Craft Agents",[["","","Craft Agents (lukilabs/craft-agents-oss) is an Electron app that runs Claude and Pi sessions. Its models come from connections, and a custom endpoint is one. magpie adds a connection named magpie and makes it the one new sessions start on, so Craft Agents runs on any model you have in magpie: DeepSeek, GLM, Kimi, Qwen, an OpenAI or Anthropic key, or a ChatGPT or Copilot subscription."],["on","Set up Craft Agents","Open Craft Agents once Craft Agents won't load a config.json without its workspaces, so magpie never makes one. It is there once Craft Agents has run. Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Pick a model on Craft Agents' row On the Agents page, pick a magpie model for Craft Agents. Craft Agents watches config.json, so a running app takes it at once, from its next new session. magpie craft-agents deepseek/deepseek-v4-pro"],["conn","The magpie connection","Connections are in config.json in Craft Agents' config folder (CRAFT_CONFIG_DIR when set, else ~/.craft-agent). magpie's is a pi_compat connection on OpenAI-compatible Chat Completions; its models are the models picked for Craft Agents in magpie, and defaultModel is the one you chose. \"llmConnections\": [ …, {\"slug\": \"magpie\", \"name\": \"magpie\", \"providerType\": \"pi_compat\", \"authType\": \"none\", \"baseUrl\": \"http://127.0.0.1:3425/agent/craft-agents/v1\", \"customEndpoint\": {\"api\": \"openai-completions\"}, \"models\": [{\"id\": \"deepseek/deepseek-v4-pro\", \"name\": …}, …], \"defaultModel\": \"deepseek/deepseek-v4-pro\"} ], \"defaultLlmConnection\": \"magpie\" Craft Agents resets a defaultModel that isn't in models to the first one there, so magpie always puts the model you picked in the list. A name or other field you give the connection in Craft Agents is kept when magpie syncs it."],["key","No key to enter","Craft Agents keeps keys apart from config.json, sealed in credentials.enc, which magpie doesn't open. magpie's connection has authType: none, which is what Craft Agents itself saves for an endpoint on this computer with no key (\"Local Model\"); its Pi server then sends a placeholder key, which the gateway takes from this computer. Craft Agents sends no User-Agent of its own, so /agent/craft-agents in the address tells the gateway which agent is asking."],["sessions","New and open sessions","New sessions start on the connection defaultLlmConnection names; a workspace's own default goes over it. A session keeps the connection it started on, so start a new one after switching to magpie. magpie says so while Craft Agents is running."],["own","Your own connections","Your connections and every other key in config.json stay as written. Before taking over the default, magpie stashes the one you had and puts it back when it steps out, where that connection is still there (else Craft Agents picks its first). If you delete the magpie connection in Craft Agents, magpie's check says it no longer reaches magpie."],["off","Switching back","Set the row back to default in magpie: magpie takes its connection out and puts your default back. Or pick a model of one of your own connections, and magpie makes it that connection's default model. magpie craft-agents default"],["faq","FAQ","Can Craft Agents use DeepSeek, GLM, Kimi or Qwen? Yes. magpie adds a magpie connection to Craft Agents' config.json and makes it the default for new sessions; every model you picked in magpie is in it. Do I enter an API key in Craft Agents? No. magpie's connection has authType none, as Craft Agents saves an endpoint on this computer with no key, and the gateway takes requests from this computer. Why is a session still on my old model? A session keeps the connection it started on. Start a new session; a workspace's own default connection goes over the global one. magpie says to open Craft Agents first? Craft Agents won't load a config.json without its workspaces, so magpie never makes one. Run Craft Agents once, then set it up. More agents on the same models: Models in Claude Code, T3 Code on any model and CodeBuddy on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/crush","Crush",[["","","Crush, Charm’s coding agent for the terminal, runs on the providers in its config. magpie adds itself to Crush as a provider, so Crush can run on any model you have in magpie: DeepSeek, Kimi, GLM, Qwen, an OpenAI key, or a ChatGPT or Copilot subscription, with no key pasted into Crush. Crush’s config is ~/.config/crush/crush.json (under $XDG_CONFIG_HOME if set; %LOCALAPPDATA%\\crush on Windows). magpie adds providers.magpie there, with the gateway’s address, a key of Crush’s own and magpie’s models, and sets the models Crush runs on. The gateway translates each request for the model’s provider, tool calls and reasoning included. A Crush in WSL is set up the same way, reaching the gateway as the distro sees it."],["on","Connect Crush","Add providers in magpie In the Providers tab, add an API key or sign in to a subscription. Pick a model on Crush’s row In the Agents tab, choose Crush’s large model, and its small one if you like. Start crush magpie’s models are in Crush’s own model picker too, under magpie. magpie crush deepseek/deepseek-v4-pro # Crush's large model on DeepSeek magpie crush small deepseek/deepseek-v4-flash magpie crush # what Crush runs on now"],["models","Large, small and effort","Crush has two model slots: large for the work and small for lighter tasks. Each can be any model, magpie’s or one of your own providers’. The row also sets the large model’s reasoning_effort: low, medium or high. magpie crush effort high magpie crush effort default # back to Crush's own"],["files","The two files","Crush saves the models its own picker chooses to a data file, ~/.local/share/crush/crush.json (under $XDG_DATA_HOME if set), which wins over the config. So magpie writes the picks there too, where Crush writes them, and its provider stays in the config. When magpie picks a model, settings Crush’s picker saved for the previous model, such as its max_tokens, are dropped, so a limit meant for one model doesn’t reach another. Keys you added to magpie’s provider yourself stay when magpie rewrites the models."],["off","Switch back","Pick one of your own providers’ models for both slots, take the row off magpie, or run magpie crush default. Once neither slot uses a model of magpie’s, magpie removes its provider from crush.json."],["faq","FAQ","Can Crush use my ChatGPT subscription? Yes. Sign in to ChatGPT in magpie and pick a GPT model on Crush’s row. Crush sends its requests to magpie, which uses the subscription. Which wins, a pick in magpie or one in Crush? The latest. Both are saved to Crush’s data file, so the last model picked, on Crush’s row or in Crush’s own picker, is the one Crush uses. What is Crush’s small model for? Lighter tasks next to the main work. Set it on Crush’s row as small, to any model. Does it work with Crush in WSL? Yes. magpie sets up a Crush in a WSL distro too, with the gateway’s address as the distro reaches it. More agents on the same models: Models in OpenCode, Models in Claude Code, Zed on any model, Raycast on any model and jcode on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/cursor-private-inference","Cursor Private Inference",[["","","Cursor Private Inference is a build of Cursor whose agent runs on your own machine and asks a model endpoint of yours instead of Cursor’s backend. magpie is such an endpoint, so its agent can run on any model you have in magpie: DeepSeek, GLM, Qwen, an OpenAI or Anthropic key, or a ChatGPT or Copilot subscription. The build takes its endpoint from CURSOR_LOCAL_AGENT_BASE_URL and CURSOR_LOCAL_AGENT_API_KEY. magpie sets the two for your user, to the gateway’s /v1 and a key of its own: through launchctl on the Mac, the registry’s Environment on Windows and environment.d on Linux. So the app has them when you open it from the Dock or the Start menu. magpie writes none of Cursor’s files, since regular Cursor shares them, and only this build reads the two variables. magpie finds the build by its product.json, in your apps folders, and on Linux as its AppImage where you downloaded it."],["on","Connect it","Add providers in magpie In the Providers tab, add an API key or sign in to a subscription. Pick magpie on its row In the Agents tab, set Cursor Private Inference’s provider to magpie. Quit it and open it again Quit the app, not only its window, then open it. magpie’s models are in its model picker. To start it from a shell instead, the row gives the command that starts it with both variables set."],["models","Its models","Its model picker lists the gateway’s models, the ones its key is shown. The row’s Models button picks which. For each model the gateway also says which APIs it is served on and its limits, so the build asks Claude on Anthropic Messages, GPT on Responses and the rest on Chat, with the right context."],["effort","Effort","Neither the build’s environment nor, for most models, its app says how hard a model should reason. Pick the effort on the row instead, among the levels its models have, and the gateway asks each request for it. Left on the default, requests go as the app sends them."],["reload","When it takes effect","The build keeps the model list it was first given until it quits, so quit it and open it again after a change. On the Mac, launchctl’s variables are gone after a restart: magpie sets them again when it starts, with the gateway’s address then, and the app takes them the next time it opens."],["first","Settings that come first","A base URL or API key set in the build’s Open configuration dialog, or in a model’s own settings, comes before the variables. Leave both empty, or set them to the gateway’s /v1 address and the key the row shows."],["off","Switch back","Take the row off magpie. magpie clears both variables for your user. Quit the app and open it again."],["faq","FAQ","Can Cursor’s agent run on DeepSeek or GLM? Yes, in Cursor Private Inference. Any model you have in magpie can be in its model picker: DeepSeek, GLM, Qwen, GPT, Claude and more. Does it change my regular Cursor? No. magpie writes none of Cursor’s settings. It sets two variables that only the Private Inference build reads. Why don’t the new models show? The build keeps its first model list until it quits. Quit the app itself, not only its window, and open it again. Check that no base URL or key is set in its Open configuration. Does it work on Windows and Linux? Yes. magpie sets the variables in the registry’s Environment on Windows and in environment.d on Linux, and finds the Linux AppImage where you downloaded it. More agents on the same models: Models in OpenCode, Models in Claude Code, Pi on any model and Antigravity on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/deepseek","DeepSeek in Claude Code, Codex, Gemini CLI and OpenCode",[["","","DeepSeek serves an OpenAI-compatible API and an Anthropic-compatible one. Add your key to magpie once, and Claude Code, Codex, Gemini CLI, OpenCode and every other agent you connect can use DeepSeek’s models through magpie’s gateway at 127.0.0.1:3425."],["add","Add DeepSeek","Get an API key Create one at platform.deepseek.com/api_keys. Add the provider In magpie’s Providers tab, press + Add provider, pick DeepSeek, paste the key and save. magpie asks DeepSeek which models it serves, such as deepseek-v4-pro and deepseek-v4-flash. Pick it for an agent In the Agents tab, click the model on the agent’s row and choose a DeepSeek model. magpie provider add deepseek sk-… magpie models # every model, as provider/model Model ids in magpie are provider/model, so DeepSeek’s are deepseek/…. Adding the preset again adds a second DeepSeek provider for another key; to spread requests over several keys, add them all to the one provider instead."],["endpoints","Endpoints","DeepSeek has one plan, pay as you go, and magpie uses these endpoints for it: API Base URL OpenAI Chat Completions and Responses https://api.deepseek.com/v1 Anthropic Messages https://api.deepseek.com/anthropic"],["agents","In each agent","Pick the model on an agent’s row in the Agents tab, or from a terminal. Each guide says what magpie writes in that agent’s config and how to switch back. magpie claude deepseek/deepseek-v4-pro magpie codex deepseek/deepseek-v4-pro magpie gemini model deepseek/deepseek-v4-flash magpie opencode deepseek/deepseek-v4-pro Claude Code speaks Anthropic Messages, and so does DeepSeek’s Anthropic endpoint, so its requests are passed on as they are. Every tier (opus, sonnet, haiku) runs on the model you pick unless you give one its own. Models in Claude Code. Codex speaks only OpenAI Responses. DeepSeek serves the Responses API itself, so Codex’s requests are passed on as they are. The model shows in Codex’s /model with its reasoning efforts. Models in Codex. Gemini CLI speaks Gemini’s API. magpie points it at its gateway and translates. Models in Gemini CLI. OpenCode gets the model in opencode.json, with its reasoning variants and cost. Models in OpenCode."],["thinking","Thinking, effort and the prompt cache","Thinking on tool turns. DeepSeek’s Anthropic endpoint wants a thinking block on every assistant turn that calls a tool, and on turns that only answer tool results. When an agent’s history has none, magpie adds one, and turns a Claude redacted_thinking block into one. So a routing group can fall back from Claude to DeepSeek in the middle of a conversation. Effort. DeepSeek thinks at three levels, low, high and max, set in output_config.effort, and ignores budget_tokens. A token budget an agent sends is fitted to one of the three. Prompt cache. With several keys, magpie keeps a conversation on the same DeepSeek key for an hour after its last turn, so the next turn reads its prompt from DeepSeek’s cache instead of sending it uncached to another key. Images. magpie uploads each image an agent sends to DeepSeek’s API once and names it by its file id on later turns. magpie provider set deepseek image-files=off sends images inline on every turn instead."],["usage","Balance and usage","The DeepSeek row shows your balance, read from DeepSeek: the total, what was granted and what you topped up. The Usage tab counts tokens, cache hits and cost for each agent and model that went through magpie. DeepSeek's API doesn't search the web by itself; through magpie, Claude Code's WebSearch and Codex's web_search still work. See Web search for any model."],["faq","FAQ","How do I use DeepSeek in Claude Code? Add your DeepSeek API key in magpie (Providers, Add provider, DeepSeek), then pick a DeepSeek model such as deepseek-v4-pro on Claude Code’s row, or run magpie claude deepseek/deepseek-v4-pro. magpie writes Claude Code’s settings.json and passes its requests to DeepSeek’s Anthropic endpoint, https://api.deepseek.com/anthropic. Can Codex use DeepSeek? Yes. DeepSeek serves the OpenAI Responses API that Codex speaks, so magpie passes Codex’s requests on as they are. Pick the model on Codex’s row or run magpie codex deepseek/deepseek-v4-pro; it shows in Codex’s /model list. Do I need to set ANTHROPIC_BASE_URL to DeepSeek myself? No. magpie points Claude Code at its own gateway at 127.0.0.1:3425 and keeps your DeepSeek key itself. Picking one of Claude Code’s own models again puts back what you had. Can I switch between Claude and DeepSeek in one conversation? Yes. DeepSeek’s Anthropic endpoint wants a thinking block on tool-calling turns, and a conversation that started on Claude doesn’t have one it can read. magpie adds it, so a routing group can fall back from Claude to DeepSeek mid-conversation. Which reasoning effort does DeepSeek take? DeepSeek thinks at three levels, low, high and max, set in output_config.effort, and ignores budget_tokens. magpie fits the level or token budget an agent asks for to one of those three. Can I use several DeepSeek keys? Yes. Add them all to the DeepSeek provider and tick each one. magpie spreads requests over them, keeps a conversation on one key so its prompt cache is reused, and moves on when a key runs out of balance. Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. Ask on Discord if you get stuck."]]],["/docs/docker","Docker",[["","","Run magpie on a server or a NAS that has no desktop: its gateway serves your models to agents on other computers, and you add providers and sign in to subscriptions from a page in your browser. Image ghcr.io/yetone/magpie, for linux/amd64 and linux/arm64 Tags latest (the newest release), daily (the desktop app's Daily channel: once a day at 20:00 UTC, the newest release whose CI run passed, or an urgent one at once), stable (the desktop app's Stable channel: a release a week, out three days first, or an urgent one at once), 0.1.1150 (one release), 0.1, edge (every change on main) Ports 3425 the gateway agents call; 3430 the browser UI, when the container runs magpie web; it answers the gateway’s /v1 routes too, so a reverse proxy needs only this port Volume /config: providers, keys, sign-ins, plugins and usage User nonroot (uid 65532) The image holds magpie’s terminal-only build on Debian 12 slim, with bash for a terminal in the container and curl for the installers of the CLIs some subscriptions sign in with (Cursor, Devin, Grok Build). It runs magpie serve (the gateway alone) unless given another command. The container finds no agents to wire, so magpie in it is a gateway: the agents that use it run elsewhere."],["run","Run it","Run it with the browser UI, a key for that page you keep across restarts, and both ports on the host’s loopback only: docker run -d --name magpie --restart unless-stopped \\ -p 127.0.0.1:3425:3425 -p 127.0.0.1:3430:3430 \\ -e MAGPIE_WEB_KEY=$(openssl rand -hex 16) \\ -v magpie-config:/config \\ ghcr.io/yetone/magpie:latest web --addr 0.0.0.0:3430 --no-open docker logs magpie The log names the page with its key: ● magpie web on http://127.0.0.1:3430/?k=0f3c9a1e… on the network http://172.17.0.2:3430/?k=0f3c9a1e… these are the container's own addresses: other machines use the host's, and MAGPIE_PUBLIC_URL=http://: puts it here other containers on this host http://172.17.0.1:3425 ! anyone with the link can change magpie and see its keys, and the network carries it unencrypted the link carries MAGPIE_WEB_KEY · gateway http://127.0.0.1:3425 · Ctrl-C to stop Agents outside the container need a gateway key. In the container any key works. A request from the host or another machine is answered only with an enabled gateway key, and gets 401 without one: make one as in Gateway keys. 127.0.0.1: in -p keeps a port on the host; leave it out, or name the host’s LAN or VPN address, for other machines to reach it. Without web --addr 0.0.0.0:3430 --no-open the container runs the gateway alone, which you then set up from a terminal in it (docker exec -it magpie magpie provider add …). A folder bind-mounted at /config works in place of the named volume, if uid 65532 can write it: sudo chown -R 65532:65532 /volume1/docker/magpie/config."],["web","The browser UI","Open the link from the log. The key in it is traded for a cookie and taken out of the address; a page opened without it is turned away (401). With MAGPIE_WEB_KEY set (16 or more letters, digits or - . _ ~; openssl rand -hex 16 makes one) the key stays the same across restarts and the browser stays signed in for 400 days. Without it, every start makes a new key and the cookie lasts the browser session. The page is in gateway mode: Providers, Gateway, Routing, Usage, Sessions, Plugins and Settings, with no Agents, since there are no agents in the container. Library has its MCP servers alone, with the MCP router: other computers’ apps connect at the router’s address with a gateway key. Sessions lists only the sessions of agents on other computers that came through this gateway, never this machine’s agents’ files. Settings → General → Gateway mode turns it off. On a NAS or a server you reach over SSH, open the page through a tunnel rather than publishing 3430: ssh -L 3430:127.0.0.1:3430 you@nas, then the log’s link on your own computer. Anyone with the link can change magpie and see its keys. Keep 3430 on loopback or a VPN. Across the network, serve it over HTTPS: give magpie a certificate with MAGPIE_TLS_CERT and MAGPIE_TLS_KEY, or put it behind a reverse proxy with TLS, such as Caddy."],["signin","Sign in to subscriptions","Add API keys on Providers as on the desktop. A subscription’s sign-in (ChatGPT, Claude…) opens the vendor’s page in your browser, and when you are done the vendor sends that browser back to localhost, for ChatGPT http://localhost:1455/auth/callback?code=…. That is your own computer, not the container, so the page doesn’t load. Copy its whole address from the address bar and paste it into the sign-in’s Callback URL field. The same from a terminal: docker exec -it magpie magpie accounts add codex Open the link it prints, sign in, then paste the address the browser ended on. The browser UI can also import sign-ins from a file. A Claude subscription is signed in to and answered through Claude Code, which the image doesn’t have. Have magpie download Anthropic’s own build first: it says the version, where it comes from and where it goes, asks, and checks the download’s SHA-256 against Anthropic’s manifest. It is kept in /config/cache, on the volume, so a new image keeps it, and magpie keeps it at Claude Code’s newest release by itself: it looks a minute after it starts and every six hours, and downloads a newer one the same way. Nothing needs installing again after an update. To hold a version, set -e DISABLE_AUTOUPDATER=1. magpie accounts add claude offers it too when Claude Code is missing. docker exec -it magpie magpie claude-code install A Grok (SuperGrok) subscription signs in through xAI’s Grok Build CLI, which the image doesn’t have either. Its sign-in, in the browser UI or with magpie plugin login grok, installs it first, as xAI’s installer does: the stable version from x.ai/cli, kept in /config/home/.grok. To use a Grok Build binary you put on the volume yourself, set GROK_BIN_DIR to the folder holding it."],["mcp","MCP servers","The Library’s MCP servers run in the container, and the image has what they start with: npx, node and npm (Node 24), and uvx, uv, python and python3. A server started with uvx or python downloads its Python into the volume the first time, which takes a few seconds. A server started with docker doesn’t run: the container has no Docker of its own. The image has no browser. Chrome DevTools’ and Playwright’s MCP servers start a Chrome of their own, so in the container their row in the Library says no Chrome here. Use Magpie Browser instead, which acts in your own browser, or point the server at a Chrome it can reach: --browserUrl http://host:9222 for Chrome DevTools, --cdp-endpoint for Playwright."],["browser","Your own browser","Magpie Browser lets agents act in your own browser, through its extension. The extension can’t be loaded from the container’s folders, so in the browser UI open Library → Magpie Browser and click Download the extension. The zip is pointed at the page’s own address, with a gateway key named Magpie Browser of its own. Unzip it, open chrome://extensions, turn on Developer mode and click Load unpacked on the unzipped folder. An extension already loaded takes the address (http://localhost:3430, or the gateway’s published port) and a gateway key in its popup. The Magpie Browser key connects the extension and nothing else: it can’t use models, MCP servers or stats, so a copy of the zip left in Downloads spends nothing. The host’s browser reaches the container from Docker’s bridge, not from the container’s own computer, so it is that key’s alone and the container’s agents don’t use it yet (#5529). To use it from an agent on the host, give that agent a gateway key of its own with full access, connect the extension with the same key in its popup, and call /mcp/magpie/browser with it. A browser given another key is that key’s alone, and it is let go once its key is turned off, removed or rotated."],["volume","What is kept","Everything magpie writes is under /config, so a restart, or a new container on the same volume, keeps your providers, keys, sign-ins and plugins. Path Holds /config/magpie magpie’s own files: settings.json, providers, gateway keys, routing groups /config/home the container’s HOME: sign-ins kept where their agent keeps them (~/.codex, ~/.claude…) /config/cache the model catalog, Bun, which plugins run on (downloaded the first time one is used), and the Claude Code magpie claude-code install downloaded /config/data, /config/state the rest of what magpie keeps A volume made by an older image keeps working: magpie adds the folders it lacks when it starts. Only sign-ins made with that older image, which lived outside the volume, have to be made again."],["env","Environment","Variable What it does MAGPIE_ADDR where the gateway listens. The image sets 0.0.0.0:3425, so the published port reaches it. MAGPIE_PUBLIC_URL the address other machines reach the gateway at, such as http://192.168.1.20:3425 (the host’s or the NAS’s, on the published port), or a reverse proxy’s base URL. In the container magpie sees only Docker’s own 172.17.x address; with this set, the address it shows and prints is the one to use. MAGPIE_WEB_KEY the browser UI’s key, kept across restarts (16+ characters) MAGPIE_NAME what this magpie is called: the browser tab’s title reads · magpie, to tell several deployments apart. A name set on the page, in Settings → Network and sharing → Advanced → Name, comes first. MAGPIE_TLS_CERT, MAGPIE_TLS_KEY a PEM certificate (its chain after it) and its key, mounted into the container: other machines then reach the gateway and the browser UI over https:// only, and plain HTTP from them gets 400. The files are read again when they change, so a renewal needs no restart. One without the other, or files that don’t load, stop magpie from starting. Use https:// in MAGPIE_PUBLIC_URL too. MAGPIE_ALLOW_IPS the only addresses other machines may reach the gateway and the browser UI from, as IPs and CIDR ranges: 203.0.113.7,10.0.0.0/8,2001:db8::/32. Any other address gets 403, even with a gateway key. Unset lets every address in, each with a key. See Allowed addresses. HOME, XDG_CONFIG_HOME, XDG_CACHE_HOME, XDG_DATA_HOME, XDG_STATE_HOME set by the image to the folders under /config above; leave them"],["share","Gateway keys and other machines","Make a key for each client Gateway → Gateway keys, or in a terminal docker exec magpie magpie gateway-key add \"Laptop\", which prints the new sk-magpie-key-…. Every request from outside the container, the host’s own included, must carry an enabled gateway key, and one without gets 401. A key can have its own daily, weekly, monthly, every-N-days or every-N-hours limit and its own list of models (magpie gateway-key limit, magpie gateway-key models). Publish the port Recreate the container with -p 3425:3425, or bound to the NAS’s LAN or VPN address (-p 192.168.1.20:3425:3425), and with -e MAGPIE_PUBLIC_URL=http://192.168.1.20:3425. On each other computer, point the agent at the gateway with one of those keys as its API key: http://192.168.1.20:3425/v1 for an OpenAI client, http://192.168.1.20:3425 for an Anthropic or Gemini one. Model ids are provider/model, or a routing group’s; GET /v1/models lists them. If that computer runs magpie itself, add the container as a Remote magpie instead, and magpie wires its agents for you. Other containers on the same host. Another container on the NAS reaches magpie at the host, through the Docker bridge’s gateway and the published port: http://172.17.0.1:3425 on Docker’s default bridge. The container’s own 172.17.x address is no use to it, and the host’s LAN address may not be either, as a NAS’s firewall can keep containers from it. host.docker.internal is the same address on Docker Desktop, and on Linux only in a container given extra_hosts: [\"host.docker.internal:host-gateway\"]. A container on magpie’s own compose network, or one you made, can use its name, http://magpie:3425. Either way it sends a gateway key. The log and the browser UI list this address as Other containers on this host, after the host’s address the page was opened at. Settings → Network and sharing → Share on local network isn’t needed in the container: turning it on also makes a gateway key named Magpie, and the gateway asks for a key from outside the container either way. Upgrading from an earlier image. An agent outside the container that sends magpie, or any other key that isn’t an enabled gateway key, now gets 401 (“the API key sent is not an enabled magpie gateway key”). Make it a key as above and put that in the agent’s settings. Agents that already send a gateway key, and a Remote magpie set up with one, keep working. Allowed addresses. On a public host, set -e MAGPIE_ALLOW_IPS=203.0.113.7,10.0.0.0/8 to the addresses your clients come from. A request from any other address is refused 403 before its key is looked at, so a key that leaks is no use from elsewhere; the refusal names the address it came from, as does the container’s log. magpie judges the address of the connection itself, never an X-Forwarded-For header, and a mistyped entry lets nothing in rather than everything. Docker’s default bridge network passes a client’s own address into the container, but a request from the host itself arrives from the bridge’s gateway (172.17.0.1), and Docker Desktop and rootless Docker show every client as one address of their own: add that, or check what the 403 says. Behind a reverse proxy or tunnel, every request comes from the proxy’s address, so limit who reaches magpie at the proxy. On the desktop app the same list is Settings → Network and sharing → Allowed addresses. Over the internet, prefer a VPN such as Tailscale or WireGuard to opening 3425. A reverse proxy or tunnel in front of the container is the network too: its clients need a gateway key like any other machine’s. Claude Code’s status line, with Claude Code outside the container. The status line square can’t reach another machine’s ~/.claude/settings.json, and the command it writes names a binary in the container. The gateway answers the same line itself: on the machine Claude Code runs on, set statusLine in ~/.claude/settings.json to {\"type\": \"command\", \"command\": \"curl -fsS -m 1 -H 'Authorization: Bearer sk-magpie-key-…' --data-binary @- http://:3425/v1/magpie/statusline || true\"}, with the host or address that reaches the container and a gateway key (a read-only key is enough). A key held to a budget, models or accounts gets the line once its owner turns on Quotas for it, with only the accounts it may use. Add ?format=json for the same as JSON (the line, the model, and each account’s windows with used and resetsAt), for a status line that draws its own. Claude Code runs it on every message and passes its session on stdin, which adds the model the session went to. The same command is shown in the browser UI under Settings → About."],["compose","Docker Compose on a NAS","services: magpie: image: ghcr.io/yetone/magpie:latest restart: unless-stopped ports: # 127.0.0.1: the host alone; every caller outside the container needs a gateway key - \"127.0.0.1:3425:3425\" - \"127.0.0.1:3430:3430\" environment: MAGPIE_PUBLIC_URL: http://:3425 MAGPIE_WEB_KEY: volumes: - ./config:/config command: [web, --addr, 0.0.0.0:3430, --no-open] Then: sudo chown -R 65532:65532 ./config, docker compose up -d, open http://127.0.0.1:3430/?k= through an SSH tunnel, add your providers and make a gateway key for each machine. For other machines to reach the gateway, change its line to \"3425:3425\" (or the NAS’s LAN or VPN address) and run docker compose up -d again."],["ops","Health, terminal, updates","Health. The image has a HEALTHCHECK: magpie healthcheck exits 0 while the gateway answers, under serve and web alike, so docker ps shows the container as healthy and Compose can wait for it with depends_on: condition: service_healthy. Terminal. docker exec -it magpie bash, or a NAS panel’s terminal, opens a shell with magpie on its PATH: magpie providers, magpie models, magpie usage, magpie quota and the rest of the CLI. Updates. Pull the new image and recreate the container on the same volume: docker pull ghcr.io/yetone/magpie:latest, then docker rm -f magpie and the same docker run, or docker compose pull && docker compose up -d. magpie releases several times a day; for one update a day with Renovate or Watchtower, follow daily (with Renovate, pin its digest), or stable for one a week. Build it yourself. docker build -t magpie . in a checkout of the repository makes the same image. Questions or a setup worth sharing? Ask on Discord. The reference has the details."]]],["/docs/droid","Droid",[["","","Droid, Factory’s coding agent, can run on custom models of your own. magpie adds the models you have in magpie to Droid as custom models, so droid can run on DeepSeek, Kimi, GLM, Qwen, an OpenAI key, or a ChatGPT or Copilot subscription, with no key pasted into Droid. Droid keeps its settings in ~/.factory/settings.json (under $FACTORY_HOME_OVERRIDE when set). magpie adds one entry to its customModels per model in magpie, with the gateway’s address and a key of Droid’s own, and sets sessionDefaultSettings.model, the model sessions start on. Each model goes on the API its provider speaks, Anthropic Messages, OpenAI Responses or Chat Completions, so the gateway relays it as it is. A droid in WSL is set up the same way, reaching the gateway as the distro sees it."],["on","Connect Droid","Add providers in magpie In the Providers tab, add an API key or sign in to a subscription. Pick a model on Droid’s row In the Agents tab, choose a model on Droid’s row. Restart droid Droid reads its settings as it starts: open sessions keep what they have, so start droid again. magpie droid deepseek/deepseek-v4-pro # Droid on DeepSeek magpie droid # what Droid runs on now"],["models","Models and thinking levels","magpie’s models are in droid’s /model picker too, under Custom models, so you can switch inside a session. A model that reasons is given a starting effort, so the picker offers its levels (off, low, medium and high); one that is a model Droid has built in takes Droid’s own levels and default. A model whose name Droid reads as OpenAI’s or Claude’s is written on the API Droid expects for it, so Droid doesn’t warn at each session start."],["own","Your own models","Custom models you added yourself stay as they were, ahead of magpie’s, so their ids don’t move. If you change a field of one of magpie’s entries in settings.json, such as its name or effort, magpie keeps your value; only the address and key are put back at each sync. The older ~/.factory/config.json is left alone."],["off","Switch back","Take Droid’s row off magpie, or run magpie droid default. magpie removes its custom models and puts back the default model you had."],["faq","FAQ","Can Droid use my ChatGPT subscription? Yes. Sign in to ChatGPT in magpie and pick a GPT model on Droid’s row. droid sends its requests to magpie, which uses the subscription. I changed the model but droid still uses the old one. Droid reads its settings as it starts. Restart droid, or switch with /model inside the session. Why does /model show no thinking levels for a model? That model doesn’t reason. For one that does, magpie gives it a starting effort, and droid then offers its levels. Will magpie touch my own BYOK models? No. Your custom models stay as they were and in front of magpie’s. More agents on the same models: Models in OpenCode, Models in Claude Code, Goose on any model and Zed on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/ds-bot","DS Bot",[["","","DS Bot (once DeepSeek Bot) is an Electron desktop app built on DSH. It ships its own DSH and runs the profile ds-bot on a data folder of its own, and its models are that DSH's llm-pi-ai routes. magpie adds a route of its own there, so DS Bot runs on any model in magpie: GLM, Kimi, Qwen, Claude, GPT or a ChatGPT subscription, and DeepSeek too."],["on","Set up DS Bot","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Pick a model for DS Bot on the Agents page Pick a model via magpie; magpie writes its route and key into DS Bot's data folder. Make a new Bot in DS Bot New Bots start on that model, as below. magpie ds-bot deepseek/deepseek-v4-pro This is the DS Bot desktop app. DS Bot is also a DSH plugin: in DSH Desktop or dsh web it runs on ~/.dsh, and its model follows magpie's DSH row."],["where","Where the data folder is","magpie looks for the data folder in DS Bot's own order: DS_BOT_HOME When it is set, as for a throwaway folder. dataDir in locations.json In Electron's userData: DS_BOT_SHELL_DATA, else /DS Bot. The older /DeepSeek Bot is used when it exists and DS Bot's folder has no locations.json. ~/.ds-bot When there is no locations.json, the first run's default. When locations.json can't be read, or has no dataDir, magpie counts the folder as unknown and touches none."],["files","What gets written","/ .env ← magpie's key for DS Bot profiles/ds-bot/cordis.patch.yml ← magpie's llm-pi-ai route (DSH's key store) ← the same key agent-default-model ← the model you picked As for DSH: magpie puts its route in the profile's patch list, profiles/ds-bot/cordis.patch.yml, the key in .env and DSH's key store, and sets agent-default-model. Your own routes stay as they are."],["bots","New Bots and older ones","New Bots in DS Bot start on DSH's agent-default-model, so a Bot you make now is on the model you picked in magpie, unless a default model for Bots is set in DS Bot. A Bot made before keeps its own model until you pick another for it. magpie says so on the Agents page."],["search","Web search","DS Bot's web search goes through magpie too. When magpie has nothing to search with yet, it asks you to set up a provider that searches by itself (DeepSeek, Claude, Codex, …) or a search API under Settings › Web search."],["unopened","Before DS Bot is opened","You can set it up before DS Bot is ever opened; magpie says it starts on this the first time it opens. DS Bot's first open writes the profile's files only where they are missing, so the patch list magpie made is kept."],["off","Switching back","Switching back takes magpie's route out. For a DS Bot that was never opened, magpie removes the files it made. magpie ds-bot default"],["faq","FAQ","Can DS Bot use models other than DeepSeek? Yes. Pick a via-magpie model for DS Bot on magpie's Agents page. magpie adds a route to the DSH that DS Bot ships, so GLM, Kimi, Qwen, Claude, GPT or a ChatGPT subscription all work. Why are my existing Bots still on the old model? A Bot made before keeps its own model. New Bots start on the default magpie sets; pick another model for an older Bot in DS Bot. I moved DS Bot's data folder. Does magpie find it? Yes. magpie reads dataDir from DS Bot's locations.json. When it can't be read, magpie changes no folder. What about the DS Bot plugin in DSH Desktop? The plugin runs on ~/.dsh, so its model follows magpie's DSH row: pick a model for DSH on the Agents page. More desktop apps on the same models: Tuanjie Cowork on any model, OpenBot on any model, miniQ on any model and OpenHanako on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/empryo","Empryo",[["","","Empryo keeps its settings in ~/.empryo/config.json (a project's .empryo/config.json goes over it). Its providers are a providers array of OpenAI-compatible endpoints that it lists models from and sends /chat/completions to. magpie adds a provider of its own there and sets the model sessions start on to one of magpie's. Empryo then runs on any model in magpie: DeepSeek, GLM, Kimi, Qwen, GPT or a ChatGPT subscription."],["on","Set up Empryo","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Pick a model for Empryo on the Agents page Empryo's row lists your current Empryo model and the models via magpie. Pick one of the latter. Restart empryo Empryo reads its settings at start-up, so reopen sessions that are already open. magpie empryo deepseek/deepseek-v4-pro On Windows, Empryo in a WSL distro is found too and set up the same way, at a gateway address that distro can reach."],["files","What gets written","{ \"providers\": [ …your own providers, left as they are…, {\"id\": \"magpie\", \"name\": \"Magpie\", \"baseURL\": \"http://127.0.0.1:3425/v1\", \"modelsAPI\": \"http://127.0.0.1:3425/v1/models\"} ], \"defaultModel\": \"magpie/deepseek/deepseek-v4-pro\" } defaultModel is /, split at the first /, so magpie/deepseek/deepseek-v4-pro is deepseek/deepseek-v4-pro under the magpie provider. Your own providers and other settings stay as they are. magpie checks the wiring: when config.json's magpie provider is gone, or its baseURL isn't the gateway's address any more, Empryo's row says so."],["key","Why there is no envVar","An Empryo provider can name an envVar to read its key from; with none, Empryo sends no key of yours. magpie's provider has none, so you put no key in your environment. With no envVar, Empryo lists a provider only when its baseURL answers (2xx, 401 or 403), which the gateway's GET /v1 does."],["restart","When it takes effect","Empryo reads its settings only at start-up. While empryo is running, magpie reminds you to restart open empryo sessions."],["off","Switching back","Switching back puts defaultModel back to what it was and removes the magpie provider. If magpie made config.json and nothing is left in it, the file goes too. You can also pick your own Empryo model again. magpie empryo default"],["faq","FAQ","How do I use DeepSeek, GLM or a ChatGPT subscription in Empryo? Pick a via-magpie model for Empryo on magpie's Agents page. magpie adds a provider with id magpie to ~/.empryo/config.json and sets defaultModel to magpie/provider/model. Restart empryo to use it. Do I need an API key environment variable? No. magpie's provider has no envVar, so Empryo sends no key of yours; the magpie gateway forwards requests to the providers you added in magpie. Does a project's .empryo/config.json matter? Yes. A project's .empryo/config.json goes over ~/.empryo/config.json; if it sets its own defaultModel, that one wins in that project. Is my old model still there after switching back? Yes. magpie kept the defaultModel you had and puts it back; your own providers were never changed. More agents on the same models: Lody on any model, AtomCode on any model, Crush on any model and miniQ on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/fireworks","Fireworks",[["","","Fireworks hosts open models, paid as you go; Fireworks Nexus is an account and plan of its own at nexus.fireworks.ai, where Nexus Auto picks the model. magpie has a preset for each: fireworks and fireworks-nexus."],["fireworks","Fireworks, pay as you go","Get a key. Make one at app.fireworks.ai under Settings → Users → API Keys. Add it. Pick Fireworks in the app and paste the key into API key, or from the CLI: magpie provider add fireworks fw_… magpie provider test fireworks magpie claude fireworks/ The preset asks Chat Completions alone, at https://api.fireworks.ai/inference/v1, with models.dev's fireworks-ai for the list and prices. magpie translates Claude Code's Anthropic requests and Codex's Responses requests to Chat for Fireworks."],["nexus","Fireworks Nexus","A Nexus key is made at nexus.fireworks.ai, not on the Fireworks platform. Its /inference endpoints speak Chat Completions, Responses and Anthropic Messages alike, so Codex's and Claude Code's requests go on their own APIs. magpie provider add fireworks-nexus fw_… magpie codex fireworks-nexus/auto magpie claude fireworks-nexus/auto Pro and Team take only auto, Nexus Auto, and refuse an open model named directly with a 403, so auto is the preset's list. An Enterprise account's open models are typed in by id among the provider's models."],["headers","Claude and GPT in Nexus","Nexus Auto reaches Claude and GPT with your own keys, in the x-anthropic-api-key and x-openai-api-key headers, or with Provider Keys set up on the Nexus account. In magpie's provider editor, Headers offers both names to add, with the values yours to fill in; from the CLI: magpie provider set fireworks-nexus header.x-anthropic-api-key=sk-ant-… magpie provider set fireworks-nexus header.x-openai-api-key=sk-… A header of your own goes on every request. An empty value removes it."],["notes","Notes","Agents only reach magpie; they never hold the Fireworks key or its address. Fireworks can share a routing group with other providers of the same open models: when one fails, the group's next member answers. Nexus plans and limits are as Fireworks' own pages say; this page covers how magpie connects."],["faq","FAQ","Does magpie support Fireworks AI? Yes. The fireworks preset takes a Fireworks API key and asks Chat Completions at api.fireworks.ai/inference/v1; a model id is fireworks/. How is Fireworks Nexus different from Fireworks? Nexus is an account and plan of its own, with keys made at nexus.fireworks.ai. Its endpoints speak Chat, Responses and Messages, Nexus Auto picks the model, and Pro and Team take only auto. Why does Nexus list only auto? Pro and Team refuse an open model named directly with a 403 and take only auto. An Enterprise account types its open models in by id. How do I use Claude and GPT in Nexus? Put your own Anthropic and OpenAI keys in the x-anthropic-api-key and x-openai-api-key headers, or set up Provider Keys on the Nexus account. Related: Groq in Claude Code, Codex and other agents, API relays in Claude Code, Codex and other agents. If something fails, see Fixing common errors: 401, 429, 502, 504 and more or ask on Discord."]]],["/docs/free-models","Free models",[["","","Some providers serve models free, some with no key at all. magpie lists them in the same picker as every other model, an agent asks for provider/model, and free ones are marked."],["nokey","Free models with no key","OpenCode Zen. Its free models (ids ending in -free, and big-pickle) need no key. Zen serves its free tier to OpenCode alone, and magpie asks for them as OpenCode does. Kilo Gateway. Its free models (marked free, ids ending in :free) need no key. With none, a caller counts as anonymous, by IP, at 200 requests an hour. magpie provider add opencode-zen magpie provider add kilo magpie models Once added, the free models are in every agent's picker: magpie claude opencode-zen/big-pickle magpie codex kilo/:free For their paid models, add a key; the free ones keep working: magpie provider key opencode-zen magpie provider key kilo"],["badge","The free mark in pickers","A model a provider prices at 0 on all four counts (input, output, cache read, cache write) is marked free beside it in the pickers: OpenRouter's :free models, OpenCode Zen's -free ones, NVIDIA NIM's free models. It is that provider's price alone: the same model on another provider costs what it costs there. A model its maker gives away (Zhipu's glm-4.7-flash) isn't marked, since a provider reselling it may not. A plan's price list says what members pay per token, not what the model costs, so it doesn't count either. A price you set yourself wins: 0 is marked free, anything else isn't. magpie model price relay-a/some-model 0,0,0,0"],["group","Free models first, paid as fallback","Free models are often rate-limited. Put a free model and a paid one in a routing group, the free one first: when it is limited or fails, the group's next member answers. See Round robin and failover across accounts, keys and providers."],["notes","Notes","When a provider answers that a model is deprecated or retired (Zen's 410 \"Model exo-free has been deprecated.\"), the model leaves magpie models, /v1/models and every agent's list. It comes back once a request for it is answered, or after a week. Which models are free, and how far, is as each provider's own pages say, and changes."],["faq","FAQ","Are there free models I can use in Claude Code with no key? Yes. OpenCode Zen's free models (ending in -free, and big-pickle) and Kilo Gateway's free models (ending in :free) need no key: add them with magpie provider add opencode-zen or magpie provider add kilo. What is the limit on Kilo Gateway with no key? With no key, a caller counts as anonymous, by IP, at 200 requests an hour. A Kilo key reaches its paid models too. Where does the free mark in the pickers come from? A provider pricing a model at 0 on all four counts. It is that provider's price alone; a model its maker gives away, or a plan's $0 price list, doesn't count. What if a free model is rate-limited? Put it in a routing group with a paid model, the free one first. When it is limited or fails, the group's next member answers. Related: NVIDIA NIM in Claude Code, Codex and other agents, OpenRouter in Claude Code, Codex, Gemini CLI and OpenCode. If something fails, see Fixing common errors: 401, 429, 502, 504 and more or ask on Discord."]]],["/docs/fx","fx",[["","","fx (fx.sh, from Vercel Labs, not the JSON viewer of the same name) keeps its settings in ~/.fx/settings.json: provider is the provider it talks to (gateway, codex, grok or one of your own), models each provider's model, and providers the providers of your own. magpie adds itself there as the provider magpie, so fx runs on any model in magpie: DeepSeek, GLM, Kimi, Qwen, Claude or a ChatGPT subscription."],["on","Set up fx","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Pick a model for fx on the Agents page Pick one via magpie. magpie finds fx by its ~/.fx folder, not the fx command, as the name is a common one. Restart fx fx reads its settings at start-up. magpie fx deepseek/deepseek-v4-pro"],["settings","settings.json","With one of magpie's models picked, magpie sets provider to magpie and models.magpie to the model, such as deepseek/deepseek-v4-pro, and writes providers.magpie: the openai-chat-completions protocol, the gateway's /v1 as base_url, and auth none, so no key. In fx the model reads magpie/deepseek/deepseek-v4-pro. // ~/.fx/settings.json { \"provider\": \"magpie\", \"models\": { \"magpie\": \"deepseek/deepseek-v4-pro\" }, \"providers\": { \"magpie\": { \"protocol\": \"openai-chat-completions\", \"base_url\": \"http://127.0.0.1:3425/v1\", \"auth\": { \"type\": \"none\" }, \"tool_choice_mode\": \"send\", \"model_metadata\": { \"deepseek/deepseek-v4-pro\": { \"supports_tool_use\": true, \"supports_vision\": …, \"context_window\": …, \"max_output_tokens\": … } } } } } fx sends no effort to a provider of your own, so there is no effort to pick. An fx in WSL is set up the same way, its base_url the gateway as that distro reaches it."],["list","The model list","fx's model picker lists model_metadata: magpie's catalog, each model marked as taking tools, with whether it takes images, its context window and its output limit. fx refuses an output limit that isn't below the context window, so magpie leaves such a limit out. fx takes at most 256 models and refuses the whole settings file past that, so magpie writes at most 256, the model in use first so it is never the one cut. When the catalog changes, magpie brings the list up to date while fx is connected."],["kept","What you set yourself","A provider in fx can have a reviewer_model, the model its auto permission mode asks. magpie doesn't write one, and one you set stays. magpie writes tool_choice_mode send, and omit stays when you turn it to that. The protocol, address, auth and model_metadata are magpie's; auth is written whole, as fx refuses an env beside type none."],["restart","Restarting fx","fx reads its settings at start-up. When fx is running as the model changes, magpie says to restart open fx sessions."],["off","Switching back","Picking one of fx's own models removes providers.magpie and models.magpie, and provider when it is magpie, so fx is back on the provider it talks to without magpie: Vercel's AI Gateway when none was set. The model goes into that provider's models; default removes it, leaving fx on its own default. magpie fx default"],["faq","FAQ","Which fx is this? Vercel Labs' coding agent fx (fx.sh), with its settings in ~/.fx. The JSON viewer named fx is another program. Does fx need an API key for magpie? No. magpie's provider in fx has auth none and talks to the gateway on this computer. Why does fx list at most 256 of magpie's models? fx refuses the whole settings file when model_metadata holds more than 256, so magpie writes at most 256, the model in use first. Which provider does fx use after switching back? The one it talks to without magpie; Vercel's AI Gateway when none was set. More agents on the same models: Aside on any model, Ante on any model, omp on any model and Grok App on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/gemini-cli-models","Models in Gemini CLI",[["","","Gemini CLI speaks only Google’s Gemini API. magpie puts a gateway on your computer that serves the Gemini API for every provider you add, and points Gemini CLI at it. You pick the model on Gemini CLI’s row in magpie. The gateway runs at 127.0.0.1:3425. It serves the Gemini API’s generateContent, streamGenerateContent and countTokens calls and its model list, beside the OpenAI and Anthropic APIs. A request goes straight through when the provider speaks the Gemini API, and is translated when it doesn’t, as with DeepSeek, Kimi, Zhipu GLM or a Claude or ChatGPT subscription: the request and the reply, streaming, tool calls, images and reasoning included. Chinese models DeepSeek, Kimi and Kimi Code, Zhipu GLM (pay as you go or Coding Plan), Z.ai, MiniMax and Qwen. Subscriptions The models of a Claude, ChatGPT, Copilot or Antigravity account you sign in to in magpie. Anything else Any OpenAI- or Anthropic-compatible URL and key, Ollama and LM Studio."],["setup","Set it up","Add the provider In magpie’s Providers tab, press + Add provider, pick DeepSeek, Kimi, Zhipu GLM, MiniMax or Qwen, paste your API key and save. magpie asks the vendor which models it serves. Pick the model for Gemini CLI In the Agents tab, click the model on the Gemini CLI row and choose one, such as deepseek/deepseek-v4-pro. magpie writes it into ~/.gemini/settings.json and the gateway’s address into ~/.gemini/.env. Restart gemini Gemini CLI reads its settings when it starts. A session already open keeps what it started with. The same from a terminal: magpie provider add deepseek sk-… magpie models # every model, as provider/model magpie gemini model deepseek/deepseek-v4-pro Model ids are magpie’s, provider/model. The Gemini CLI row shows once the gemini command is on your PATH. Zhipu GLM Coding Plan. When you add Zhipu GLM or Z.ai, pick the plan your key is for. A Coding Plan key has its own endpoints, and sent to the pay-as-you-go one it is told it has no balance."],["files","What changes in ~/.gemini","Gemini CLI loads ~/.gemini/.env and reads ~/.gemini/settings.json. magpie changes four keys across the two: File Key Set to .env GOOGLE_GEMINI_BASE_URL The gateway’s address .env GEMINI_API_KEY The gateway’s key (not your vendor key; that stays in magpie) settings.json security.auth.selectedType gemini-api-key, so Gemini CLI sends that key and not a Google sign-in settings.json model.name The model, as provider/model The first time, magpie keeps what those keys held before: your own base URL, API key, sign-in choice and model. If the sign-in choice is changed to anything but the API key while the model is one of magpie’s, Gemini CLI asks Google directly, and magpie’s Gemini CLI row says so. Going back to Google Pick one of Gemini CLI’s own Gemini models on its row, or run magpie gemini default. magpie takes GOOGLE_GEMINI_BASE_URL and GEMINI_API_KEY out of .env and puts back the base URL, key, sign-in choice and model you had. You don’t edit either file by hand. The row’s auth setting chooses how Gemini CLI signs in on its own: Google (your Google account), API key or Vertex AI. With Google Gemini added as a provider in magpie, API key writes that key into .env for Gemini CLI. magpie gemini default # magpie’s wiring out, what you had back magpie gemini google # sign in with your Google account"],["subscriptions","Claude and GPT models from a subscription","Sign in to the subscription in magpie: + Add provider, then the Claude, ChatGPT or Copilot tile. magpie opens the vendor’s own sign-in page. The account’s models are then claude/…, codex/… or copilot/… on Gemini CLI’s row. magpie accounts add codex # sign in to a ChatGPT account magpie gemini model codex/gpt-5.5 Gemini CLI still speaks the Gemini API; magpie translates each request for the model and the reply back. Requests on a Claude subscription run through the Claude Code installed on your computer, so keep it installed. More in Use your subscription in any agent."],["routing","Routing over several keys","Several keys for one vendor. Add them all to the provider and tick each one. Routing on the provider says how requests spread, and Fallback lists models to use when it is out of quota or down. One model from several providers. When two of your providers serve the same model, magpie makes the group auto/ by itself. Pick it for Gemini CLI. A cheaper model for compaction. A routing group’s compacting rule matches Gemini CLI compacting its conversation, so a cheaper, faster model can write the summary. The routing modes and rules are in Get started. By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Volcengine Ark · Tencent Cloud · Baidu Qianfan · SiliconFlow · ModelScope · Huawei Cloud MaaS · Xiaomi MiMo · StepFun · LongCat · Qwen · MiniMax · Anthropic · OpenAI · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama"],["faq","FAQ","Can Gemini CLI use models that aren’t Gemini? Yes, through a gateway that serves the Gemini API. magpie runs one on your computer and points Gemini CLI at it, so any model of a provider you add works: DeepSeek, Kimi, GLM, Qwen, MiniMax, or a Claude, ChatGPT or Copilot subscription. Do I set GOOGLE_GEMINI_BASE_URL myself? No. magpie writes it and GEMINI_API_KEY into ~/.gemini/.env, and sets Gemini CLI to API-key auth in ~/.gemini/settings.json. What you had there before is kept and comes back when you switch away. Why does Gemini CLI still send requests to Google? Its sign-in choice is not the API key: with a Google sign-in or Vertex AI, Gemini CLI asks Google directly. Pick the model again in magpie, which sets it back to the API key; magpie’s Gemini CLI row tells you when this happens. Restart open gemini sessions after a change. Can I use my ChatGPT or Claude subscription in Gemini CLI? Yes. Sign in to it in magpie and pick a codex/… or claude/… model on Gemini CLI’s row. Requests on a Claude subscription run through the Claude Code installed on your computer. Why doesn’t magpie show Gemini CLI? magpie shows it when the gemini command is on your PATH. A ~/.gemini folder alone doesn’t count, because it stays after Gemini CLI is uninstalled and Antigravity keeps folders there too. Does it work for Gemini CLI in WSL? Yes. magpie sets up Gemini CLI inside a WSL distro the same way, writing the gateway’s address as that distro reaches it. How do I switch Gemini CLI back to Google? Pick one of Gemini CLI’s own models in magpie, or run magpie gemini default. What magpie wrote comes out, and your own key, sign-in choice and model come back. Using Claude Code or Codex too? See Models in Claude Code and Models in Codex. Stuck? Ask on Discord."]]],["/docs/gemini","Gemini in Claude Code, Codex, Gemini CLI and OpenCode",[["","","Google serves Gemini on the Gemini Developer API, the one an AI Studio key opens, and on Vertex AI in your own Google Cloud project. Add either to magpie once, and Claude Code, Codex, Gemini CLI, OpenCode and every other agent you connect can use Gemini 3 models such as gemini-3.1-pro-preview through magpie’s gateway at 127.0.0.1:3425, each agent on a model of its own."],["add","Add a Gemini API key","Get a key Make one on aistudio.google.com/apikey. Add the provider In magpie’s Providers tab, press + Add provider, pick Google Gemini, paste the key and save. magpie asks Google which models it serves. Pick it for an agent In the Agents tab, click the model on the agent’s row and choose a Gemini model such as gemini-3.1-pro-preview. magpie provider add google AIza… magpie provider test google Model ids in magpie are provider/model, so the Gemini API’s read google/gemini-3.1-pro-preview: the provider, then Google’s own id. The key is kept in magpie’s settings; magpie doesn’t take it from your shell."],["endpoints","Endpoints","API Base URL Used for Chat Completions (OpenAI-compatible) https://generativelanguage.googleapis.com/v1beta/openai the model list, and requests from Claude Code, Codex, OpenCode and other agents Gemini API https://generativelanguage.googleapis.com/v1beta Gemini CLI’s requests, Google Search, image models The preset fills in the Gemini API URL once. If you clear it, it stays empty. Every request that doesn’t come from a Gemini client goes to Chat Completions."],["models","Model list","Where it comes from. magpie asks the OpenAI-compatible endpoint for the list once. It is the Gemini API’s list too, so magpie doesn’t ask twice. Names, reasoning levels and prices come from the google catalog on models.dev. Image models. At Google, a Gemini image model draws on the Gemini API. Choose one in Settings → Models → Images."],["agents","In each agent","Pick the model on an agent’s row in the Agents tab, or from a terminal. Each guide says what magpie writes in that agent’s config and how to switch back. magpie claude google/gemini-3.1-pro-preview magpie codex google/gemini-3.1-pro-preview magpie gemini model google/gemini-3.8-flash magpie opencode google/gemini-3.1-pro-preview Claude Code speaks Anthropic Messages. magpie translates each request to Gemini’s Chat Completions and the reply back to Messages, streaming and tool calls included. Models in Claude Code. Codex speaks only OpenAI Responses. magpie translates it to Chat Completions the same way, and the reply comes back to Codex as Responses. Models in Codex. Gemini CLI speaks Gemini’s own API, so its requests go to the Gemini API as it sends them, and its Google Search runs there. Models in Gemini CLI. OpenCode speaks Chat Completions, so its requests go to Google as they are. Models in OpenCode."],["thinking","Thinking","Visible thoughts. Gemini’s OpenAI-compatible API gives the model’s thoughts only when asked in thinking_config. When an agent asks for visible reasoning, magpie asks for the thoughts with include_thoughts, so a long think shows as thinking instead of a first word that comes late. Levels and budgets. Gemini 3 and later are sent a thinking level. Gemini 2 models are sent a budget instead: 1024 tokens for minimal and low, 8192 for medium and 24576 for high. xhigh and max are sent as high, and an effort with no level is left to the model. Reasoning off. Gemini 3 can’t stop thinking. When an agent turns reasoning off, magpie asks for the model’s lowest level instead. A level the model doesn’t have. Not every Gemini 3 has every level: gemini-3.8-flash has no minimal. When Google turns a level away with a 400, magpie asks again at the nearest level the model has and remembers it until magpie restarts. thinking_config turned away. That is a different 400: a server in front of Gemini that refuses the field itself. magpie asks again with reasoning_effort alone and stops sending thinking_config there. Proxies. A Gemini model behind a proxy on this computer or your network, such as one on localhost or a private address, is handled the same way."],["signatures","Thought signatures and tools","Thought signatures. Gemini 3 signs the first function call of each step, and the next request fails with 400 “Function call is missing a thought_signature in functionCall parts” if the signature is gone. Agents don’t keep it. magpie carries it in the call id the agent gets, as a short reference to a file in magpie’s folder, and puts it back on the way to Gemini. Signatures are kept for 90 days. Calls Gemini didn’t sign. A call from another model earlier in the conversation, or one whose id an agent shortened, goes with Google’s documented skip_thought_signature_validator, so a conversation can move to Gemini halfway. One provider’s signature. A signature goes back only to the provider that gave it. In a routing group of Vertex AI and the Gemini API, the other provider gets the call as unsigned history instead of answering “Corrupted thought signature”. Tool schemas. magpie gives each untyped schema in an agent’s tools a type, which Vertex AI needs, and removes boolean schemas and x- keywords such as MCP’s x-mcp-header. Tools that need none of this go as they came. The end of a stream. Gemini’s OpenAI-compatible API sends a whole function call in one chunk and its finish_reason in the next. If that reason is lost after the usage arrived, magpie fills it in; without the usage, the reply is reported as cut off rather than passed on as complete."],["cost","Cache, cost and search","Prompt cache. Gemini keeps a prompt cached without saying so on that turn. magpie counts such a turn as a cache write and keeps the next turn on the same provider and key, and remembers which one answered across restarts. Cached and thinking tokens. magpie reads cached tokens and reasoning tokens from each reply, on Chat Completions and on the Gemini API alike, and the Usage tab counts them. Cost. The Usage tab prices each call from the google catalog on models.dev. Web search. Gemini runs Google Search on the Gemini API only for a request that declares no function tools. Claude Code’s and Codex’s requests declare tools, so their web search is magpie’s own, which the Google provider answers itself on your key: those searches spend your Gemini API credit."],["keys","Several keys and rate limits","One Google Gemini provider can hold several keys: press Add another key under it, or paste several at once. Requests go to the first key that’s on, and when it runs out or is rate limited the next one takes over. The provider’s routing can also rotate, weight or drain them instead. Per-minute 429s. Gemini’s 429 “You exceeded your current quota … Please retry in 33s” for a per-minute limit is read as a rate limit, not a used-up plan, and so is Vertex AI’s requests_per_minute_per_project. The key rests from a minute, doubling, up to rest-cap. Holding to a rate. rpm holds each key to a number of requests a minute: one request more waits for room, up to 2 minutes, then gets a 429. Out of quota. quota-rest sets how long a key rests once its quota is spent: 15 minutes by default, up to 8 days, or until a time of day. Spend caps and fallbacks. spend-cap stops a key at a dollar amount a day, a month or in all, and fallback names where requests go when Gemini is out of quota or down. magpie provider rpm google 10 magpie provider spend-cap google 20 month magpie provider fallback google google-vertex/gemini-3.1-pro-preview"],["vertex","Vertex AI","The Google Vertex AI preset asks Gemini in your Google Cloud project, with no API key. Give it the project’s id; the project in each request is the one billed. gcloud auth application-default login magpie provider add google-vertex project=my-project magpie claude google-vertex/gemini-3.1-pro-preview Credentials. magpie signs with gcloud’s Application Default Credentials, or with the file credentials= names by its full path: a user sign-in, a service account key or an impersonated service account. impersonate= takes a service account’s email, and needs roles/iam.serviceAccountTokenCreator on it. The metadata server, workload identity federation and Vertex AI’s express-mode API keys aren’t read. Location. location= is global (the default), us, eu or a region such as us-central1. Models. The preset has its own list, among them gemini-3.8-flash, gemini-3.1-pro-preview, gemini-2.5-pro, partner models such as zai-org/glm-5.2-maas, and Claude models such as claude-opus-5-5. Gemini goes to Vertex AI’s Gemini API, a partner model to its OpenAI-compatible chat completions, and Claude to Anthropic’s Messages API, all in your project. Thinking on Vertex AI. A Gemini 3 level is fitted to the levels that model has, and reasoning off asks for its lowest. Gemini 2.5 takes a budget: Pro from 128 to 32768 tokens (128 when off), Flash up to 24576 (0 when off), Flash-Lite from 512 to 24576 (0 when off)."],["signins","Google sign-ins","Two Google sign-ins give Gemini models without a key. They are subscriptions, set up as on Subscriptions in any agent. Gemini (Code Assist). Gemini CLI’s Google sign-in, as gemini/…: magpie accounts add gemini. Google answers it only for a Code Assist Standard or Enterprise account with a Google Cloud project of its own; magpie accounts project gemini names the project. Antigravity. As antigravity/…: magpie accounts add antigravity. Its sign-in gives Antigravity’s Claude and Gemini models."],["trouble","Troubleshooting","“Thinking level MINIMAL is not supported for this model”. The model has no minimal level. magpie asks again at the nearest level it has, so the agent gets its answer, and remembers the level until magpie restarts. Only when no level is left does the error reach the agent as Google sent it. “Function call is missing a thought_signature in functionCall parts”. A Gemini 3 call lost its signature. Through magpie the signature rides in the call id and is put back, and a call with none goes with skip_thought_signature_validator. “Corrupted thought signature”. The signature was cut short or came from another provider. magpie sends a signature only to the provider that gave it. 429 with “Please retry in 33s”. A per-minute limit, not a spent plan. The key rests for a short while, and rpm keeps requests under the limit from then on. Vertex AI: a schema “didn’t specify the schema type field”. magpie types every untyped tool schema it sends to Gemini, so this shouldn’t reach the agent. Vertex AI won’t save. “Google Vertex AI needs the id of your Google Cloud project”: add project=. A credentials file has to be given by its full path. Checking a key. magpie provider test google sends a tiny request through each endpoint, or to each model you name. Add --as codex or --as claude-code to send it the way that agent would. More on Vertex AI: Google Vertex AI in Claude Code, Codex and other agents."],["faq","FAQ","How do I use Gemini in Claude Code? Add a Gemini API key in magpie (Providers, Add provider, Google Gemini), then pick a model such as gemini-3.1-pro-preview on Claude Code’s row, or run magpie claude google/gemini-3.1-pro-preview. magpie writes Claude Code’s settings.json and translates each Messages request to Gemini’s Chat Completions, tool calls and streaming included. Can Codex use Gemini models? Yes. Codex speaks only the Responses API. magpie translates each Codex request to Gemini’s Chat Completions and the reply back to Responses. Run magpie codex google/gemini-3.1-pro-preview, or pick the model on Codex’s row. Does Gemini 3 Pro keep working across tool calls in Claude Code? Yes. Gemini 3 signs its function calls and refuses the next request without the signature. magpie carries each signature in the call id the agent gets and puts it back on the way to Gemini, so tool loops keep going, and a call from another model is sent as unsigned. Can Gemini CLI and OpenCode use my Gemini key through magpie? Yes. Gemini CLI’s requests go to the Gemini API as it sends them, Google Search included. OpenCode speaks Chat Completions, so its requests go to Gemini’s OpenAI-compatible API as they are. Why does Gemini answer 429 with “Please retry in 33s”? That is a per-minute limit, not a spent quota. magpie reads it as a rate limit and rests the key briefly. Run magpie provider rpm google 10, with your own limit, and magpie holds requests to that rate. Can I use Gemini through Vertex AI instead of an API key? Yes. Add the Google Vertex AI preset with your project’s id, for example magpie provider add google-vertex project=my-project. magpie signs with gcloud’s Application Default Credentials or a credentials file, and your project is billed. Can I use my Gemini Code Assist or Antigravity sign-in instead? Yes. Both are subscriptions: magpie accounts add gemini or magpie accounts add antigravity, then pick a gemini/… or antigravity/… model. Code Assist needs a Standard or Enterprise account with a Google Cloud project of its own. By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Volcengine Ark · Tencent Cloud · Baidu Qianfan · SiliconFlow · ModelScope · Huawei Cloud MaaS · Xiaomi MiMo · StepFun · LongCat · Qwen · MiniMax · Anthropic · OpenAI · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. To run Google’s Antigravity app on other models, see Antigravity on any model. Ask on Discord if you get stuck."]]],["/docs/glm","GLM Coding Plan in Claude Code, Codex, Gemini CLI and OpenCode",[["","","Zhipu’s GLM models come from two places, Zhipu GLM at open.bigmodel.cn and Z.ai at api.z.ai, and each has two plans: pay as you go and the GLM Coding Plan. Add a key to magpie with its plan, and Claude Code, Codex, Gemini CLI, OpenCode and your other agents can use GLM through magpie’s gateway at 127.0.0.1:3425."],["add","Add GLM","Get a key From open.bigmodel.cn for Zhipu GLM, or z.ai for Z.ai. Add the provider and pick the plan In Providers, press + Add provider, pick Zhipu GLM or Z.ai, choose the plan your key is for (Pay as you go or Coding Plan), paste the key and save. Pick it for an agent In the Agents tab, choose a GLM model such as glm-5.3 on the agent’s row. magpie provider add zhipu sk-… plan=coding # GLM Coding Plan (open.bigmodel.cn) magpie provider add zai sk-… plan=coding # GLM Coding Plan (z.ai) magpie provider add zhipu sk-… plan=api # pay as you go Pick the plan your key is for. A Coding Plan key has its own endpoints. Sent to the pay-as-you-go one, it is told it has no balance (429, code 1113). If that happens, magpie tries the Coding Plan endpoint, and when the key is served there it moves the provider to the plan’s endpoints. When both refuse, the error says what each said and what to change."],["endpoints","Plans and endpoints","Preset Plan OpenAI Chat Completions OpenAI Responses Anthropic Messages Zhipu GLM Pay as you go https://open.bigmodel.cn/api/paas/v4 — https://open.bigmodel.cn/api/anthropic Zhipu GLM Coding Plan https://open.bigmodel.cn/api/coding/paas/v4 https://open.bigmodel.cn/api/v1 https://open.bigmodel.cn/api/anthropic Z.ai Pay as you go https://api.z.ai/api/paas/v4 — https://api.z.ai/api/anthropic Z.ai Coding Plan https://api.z.ai/api/coding/paas/v4 https://api.z.ai/api/v1 https://api.z.ai/api/anthropic Both plans share the Anthropic endpoint, which bills the Coding Plan when the account has one. Each key on the provider says which plan it is for, so one provider can hold a pay-as-you-go key and a Coding Plan key, and each key’s requests, model list and windows are its own plan’s."],["agents","In each agent","Pick the model on an agent’s row in the Agents tab, or from a terminal. Each guide says what magpie writes in that agent’s config and how to switch back. magpie claude zhipu/glm-5.3 magpie codex zhipu/glm-5.3 magpie gemini model zhipu/glm-5.3 magpie opencode zhipu/glm-5.3 Claude Code speaks Anthropic Messages, and so does GLM’s Anthropic endpoint, so its requests are passed on as they are. Every tier (opus, sonnet, haiku) runs on the model you pick unless you give one its own. Models in Claude Code. Codex speaks only OpenAI Responses. The Coding Plan serves the Responses API itself, so Codex’s requests are passed on as they are; on pay as you go, magpie translates them to Chat Completions. The model shows in Codex’s /model with its reasoning efforts. Models in Codex. Gemini CLI speaks Gemini’s API. magpie points it at its gateway and translates. Models in Gemini CLI. OpenCode gets the model in opencode.json, with its reasoning variants and cost. Models in OpenCode."],["thinking","Thinking and effort","GLM-5.3 always thinks. It turns away a request that switches thinking off. magpie asks again with thinking left on, so the agent gets an answer rather than the error. Effort. GLM-5.2 and GLM-5.3 take their reasoning level in output_config.effort, and magpie puts the agent’s level there."],["usage","Usage windows and search","Coding Plan windows. The row shows the plan’s windows, read from Zhipu or Z.ai: the hourly and weekly allowances, and the month’s MCP tool calls. Web search. With a Coding Plan key and no searcher chosen in Settings, magpie searches the web for GLM models through the plan’s own search service."],["faq","FAQ","How do I use the GLM Coding Plan in Claude Code? Add Zhipu GLM (open.bigmodel.cn) or Z.ai (api.z.ai) in magpie, choose Coding Plan as the key’s plan, then pick a GLM model such as glm-5.3 on Claude Code’s row, or run magpie claude zhipu/glm-5.3. Claude Code’s requests go to the Anthropic endpoint, which bills the Coding Plan when the account has one. Can Codex use GLM? Yes. The GLM Coding Plan serves the OpenAI Responses API Codex speaks, so magpie passes Codex’s requests on as they are. On pay as you go, magpie translates Codex’s requests to Chat Completions. Run magpie codex zhipu/glm-5.3 or pick it on Codex’s row. Why does my GLM Coding Plan key say insufficient balance (1113)? A Coding Plan key sent to the pay-as-you-go endpoint, https://open.bigmodel.cn/api/paas/v4, is answered with 429 code 1113. magpie tries the Coding Plan endpoint, https://open.bigmodel.cn/api/coding/paas/v4, and when the key is served there it moves the provider to the plan’s endpoints. Choosing Coding Plan when you add the key avoids it. Can I have a Coding Plan key and a pay-as-you-go key together? Yes. Each key on a Zhipu GLM or Z.ai provider says which plan it is for. Its requests go to that plan’s endpoints, and its model list and usage windows are that plan’s. Zhipu GLM or Z.ai: which preset do I pick? The one that issued your key: Zhipu GLM for a key from open.bigmodel.cn, Z.ai for a key from z.ai. Does GLM-5.3 work with thinking turned off? GLM-5.3 always thinks and turns away a request that switches thinking off. magpie asks again with thinking left on, so the agent gets an answer. Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. Ask on Discord if you get stuck."]]],["/docs/goose","Goose",[["","","Goose, Block’s open-source agent, runs on the provider and model in its config. magpie adds itself to Goose as a custom provider, so Goose’s CLI and desktop app can run on any model you have in magpie: DeepSeek, Kimi, GLM, Qwen, an OpenAI key, or a ChatGPT or Copilot subscription, with no key pasted into Goose. Goose keeps its settings in ~/.config/goose/config.yaml (under $XDG_CONFIG_HOME if set; %APPDATA%\\Block\\goose\\config on Windows). magpie writes a custom provider, custom_providers/magpie.json beside it, with the gateway’s address, a key of Goose’s own and magpie’s models, then makes it the provider Goose uses. The gateway translates each request for the model’s provider, tool calls and reasoning included. A Goose in WSL is set up the same way, reaching the gateway as the distro sees it."],["on","Connect Goose","Add providers in magpie In the Providers tab, add an API key or sign in to a subscription. Pick a model on Goose’s row In the Agents tab, choose a model on Goose’s row. The picker also lists the models of providers Goose is set up with itself. Restart Goose Goose loads its custom providers as it starts: quit and reopen the desktop app, and open goose sessions again. magpie goose deepseek/deepseek-v4-pro # Goose on DeepSeek magpie goose # what Goose runs on now"],["models","Model and thinking effort","Each model magpie lists for Goose carries its context window, so Goose doesn’t have to guess it, and whether it takes a thinking level. The row also sets GOOSE_THINKING_EFFORT, the effort Goose asks of a model that thinks: off, low, medium, high or max. magpie goose effort high magpie goose effort default # back to Goose's own"],["files","What magpie writes","Goose has two layouts for the provider in use: active_provider with providers.magpie.model, and the older GOOSE_PROVIDER and GOOSE_MODEL. magpie writes the one your config already uses. Keys you added to magpie’s provider file yourself, such as timeout_seconds, headers or toolshim, stay when magpie rewrites the models."],["off","Switch back","Pick one of your own providers’ models on Goose’s row, take the row off magpie, or run magpie goose default. Once Goose no longer uses a model of magpie’s, magpie removes its provider file."],["faq","FAQ","Can Goose use my ChatGPT subscription? Yes. Sign in to ChatGPT in magpie and pick a GPT model on Goose’s row. Goose sends its requests to magpie, which uses the subscription. Goose doesn’t show magpie’s models. Goose reads custom providers only as it starts. Quit and reopen Goose, and start a new goose session. Does this work in the Goose desktop app? Yes. The CLI and the desktop app read the same config, so both use the model on Goose’s row after a restart. Does it work with goose in WSL? Yes. magpie sets up a Goose in a WSL distro too, with the gateway’s address as the distro reaches it. More agents on the same models: Models in OpenCode, Models in Claude Code, Cline on any model and Droid on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/grok-app","Grok App",[["","","Grok App (RongleCat/grok-app) is a desktop front end for the grok CLI, which it starts over ACP. Its own model list is Grok Build's official catalog only; a model of your choosing is a provider channel in its settings. magpie adds itself as a custom provider named magpie, so Grok App's model picker offers any model in magpie: DeepSeek, GLM, Kimi, Qwen, Claude or a ChatGPT subscription."],["on","Set up Grok App","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Pick a model for Grok App on the Agents page Pick one via magpie, and magpie writes its custom provider. Press Use in Grok App Press Use on magpie in Grok App's Settings › Account; that is what moves the App onto magpie. magpie grok-app deepseek/deepseek-v4-pro"],["channel","magpie's custom provider","magpie writes [model.magpie] in agent-home/config.toml under the App's data folder, the way the App writes a channel itself: the gateway's /v1 as base_url, magpie's own key for Grok App, chat completions. app_models is a JSON list of magpie's models, each with its context window, whether it takes images and its effort levels, so the custom providers in Settings list magpie and the model picker can offer those models and their efforts. # /agent-home/config.toml [model.magpie] model = \"deepseek/deepseek-v4-pro\" base_url = \"http://127.0.0.1:3425/v1\" name = \"magpie\" api_key = \"\" api_backend = \"chat_completions\" app_provider_mode = \"generic\" app_models = \"[…]\" app_efforts = \"[…]\" supports_reasoning_effort = … context_window = … The channel's context window, images and efforts follow the model picked. When the picked model is one magpie no longer has, the channel moves to the first in the list."],["route","The route is yours to switch","[models] default is the route the App starts on. magpie doesn't write it: making it magpie takes the App over, and the App then drops its own sign-in and the session no longer runs. So the route stays what the App had, and pressing Use in the App's settings is what switches it, the App's own choice. An older magpie set the route to magpie; this one puts the old route back once, on the next sync or connect, and a Use you press after that stays. A model you pick in the App's picker since is yours too, and stays through a sync. On magpie, the App starts the CLI with GROK_HOME at agent-home, its independent mode; its default shared mode uses ~/.grok, Grok Build's home."],["efforts","Models and efforts","Grok Build has no effort none for a channel, so the levels are the model's others. The one the picker starts on is the default you marked for that model on the App's Providers page, while the model still has it, else medium, or the middle level without it."],["folder","The data folder","magpie finds Grok App's data folder at $GROK_APP_HOME when it is set, else by system, the first that is there. macOS ~/Library/Application Support/com.grokapp.grok-app Windows %APPDATA%\\grokapp\\grok-app\\data Linux $XDG_DATA_HOME/grok-app (~/.local/share/grok-app) or ~/.grok-app; $GROK_APP_HOME when set"],["off","Disconnecting","Disconnecting takes [model.magpie] out. The route is touched only when it still names magpie, a route that doesn't run: magpie puts back the one it remembered, or clears it. Any other route is the App's and stays. Picking one of the App's own routes in magpie, such as the official Grok, also takes magpie's channel out and makes that the route."],["faq","FAQ","Can Grok App run on DeepSeek, GLM or a ChatGPT subscription? Yes. magpie adds itself as a custom provider in Grok App, so its model picker offers magpie's models; press Use on magpie in its settings to switch. Why is Grok App not on magpie after connecting? magpie leaves the App's route alone, as taking it over makes the App drop its own sign-in. Press Use on magpie in Grok App's Settings › Account. Can I pick an effort in Grok App? Yes. Each magpie model comes with its own effort levels, starting on the one you marked, else medium. Does disconnecting put Grok App's old route back? Yes, when the route still names magpie; any other route is left alone. More agents on the same models: fx on any model, Aside on any model, Ante on any model and Mister Morph on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/grok","Grok in Claude Code, Codex, Gemini CLI and OpenCode",[["","","xAI serves its Grok models on three APIs at once: OpenAI Chat Completions, OpenAI Responses and Anthropic Messages. Add an xAI API key to magpie once, and Claude Code, Codex, Gemini CLI, OpenCode and every other agent you connect can use Grok through magpie’s local gateway at 127.0.0.1:3425, each agent with a model of its own."],["add","Add xAI","Get a key Make one on console.x.ai. Add the provider In magpie’s Providers tab, press + Add provider, pick xAI, paste the key and save. magpie asks xAI which models the key can use. Pick it for an agent In the Agents tab, click the model on the agent’s row and choose a Grok model such as grok-4.7. magpie provider add xai xai-… magpie provider test xai Model ids in magpie are provider/model, so xAI’s read xai/grok-4.7: the provider, then xAI’s own id. The key is kept in magpie’s settings; magpie doesn’t take it from your shell."],["endpoints","Endpoints","API Base URL Used for Chat Completions https://api.x.ai/v1 the model list, OpenCode’s requests, and every request magpie translates, Gemini CLI’s among them Responses https://api.x.ai/v1 Codex’s requests, and web search that xAI runs itself Anthropic Messages https://api.x.ai Claude Code’s requests An agent whose API xAI serves is passed on to that API. When magpie has to translate, it uses Chat Completions: it keeps Responses first only for OpenAI’s own models at OpenAI, and Messages first only for Claude models, and Grok is neither."],["models","Model list","magpie fetches the list from xAI, at https://api.x.ai/v1/models, so agents see the models your key can use. Names, reasoning levels and prices come from models.dev’s xai catalog. Pick the models agents see in the provider’s model list, or from the terminal: magpie provider models xai +grok-4.7 magpie provider refresh-every xai 1d"],["agents","In each agent","magpie claude xai/grok-4.7 magpie codex xai/grok-4.7 magpie gemini model xai/grok-4.7 magpie opencode xai/grok-4.7 Claude Code speaks Anthropic Messages, and so does xAI at https://api.x.ai, so its requests go there as they are, with the fixes below. Models in Claude Code. Codex speaks OpenAI Responses, which xAI serves at https://api.x.ai/v1, so its requests go there as they are too. If xAI turns away Codex’s custom tools (“unknown variant custom”), magpie translates that model’s Codex requests from then on and offers those tools as ordinary functions. Models in Codex. Gemini CLI speaks Google’s Gemini API, which xAI doesn’t serve. magpie translates each request to Chat Completions and the reply back, streaming and tool calls included. Models in Gemini CLI. OpenCode speaks Chat Completions, so its requests go to xAI as they are. Models in OpenCode. Grok Build, xAI’s own CLI, can take magpie’s models too: magpie adds them to ~/.grok/config.toml, so they join its /model picker."],["shaping","What magpie fixes for xAI","xAI’s API turns away a few things that agents send. magpie changes them on the way, on requests it passes on and on those it translates alike, so the agent never sees these errors: Tool patterns. xAI reads a tool’s pattern with a different regex engine, so a pattern such as Claude Code’s ^[^\\s[\\]]+$ on Windows failed with “Schema validation failed: … is not a \"regex\"”. magpie escapes it so xAI reads it as JavaScript does. Tool roots. A tool whose parameters start with anyOf, oneOf or allOf, such as a Codex desktop automation tool, is folded into an object from the first request. xAI otherwise answers “tool parameter root must be an object type”. Empty fields. \"required\": null in a tool’s schema, and \"content\": null on a Codex reasoning item, are left out. xAI otherwise answers “/required: null is not of type \"array\"” or “Could not decode the compaction blob”. System turns. Claude Code’s system turns in the middle of a conversation are folded into the top-level system prompt. xAI otherwise answers “Invalid request content: Invalid message role.” A tool choice with no tools. A request that sets tool_choice but offers no tools, such as Codex’s compaction summary, goes without it. xAI otherwise answers “A tool_choice was set on the request but no tools were specified”. Codex’s added tools. xAI’s Responses API doesn’t know Codex’s additional_tools items, so magpie puts their tools in the request’s tools. Whole numbers. Grok writes whole numbers in tool-call arguments with a fraction, such as 2500.0, which Codex’s whole-number fields refuse. magpie writes 2500, in streamed replies too."],["reasoning","Reasoning","Effort. The effort an agent asks for is fitted to the nearest level the model has, as the catalog lists them. A model whose levels aren’t known is asked as the agent asked. Reasoning off. When an agent whose requests magpie translates, such as Gemini CLI, turns reasoning off and the model lists none among its levels, magpie asks for none. Switching models mid-conversation. xAI reads only the sealed reasoning it wrote itself. When a Codex conversation moves to Grok from GPT or from another account, xAI answers “Could not decrypt the provided encrypted_content”. magpie asks again without those items at once, and leaves them out for the rest of that conversation."],["search","Web search","Codex. xAI runs web search itself on its Responses API, so Codex’s web_search is done by xAI. Claude Code, Gemini CLI and OpenCode. xAI’s Messages and Chat Completions APIs don’t search, so magpie gives the model its own search tool, answered by the searcher chosen in Settings, or by one magpie picks when none is chosen. xAI as the searcher. Because xAI searches by itself, magpie can pick an xAI key to search for models that can’t."],["cost","Cache, cost and usage","Cache tokens. magpie reads the cached tokens xAI reports in each reply, so the Usage tab counts cache hits apart from the rest of the prompt. Keeping the cache. With several keys, a conversation stays on its key while its cache is worth keeping, 1,024 tokens or more, and still warm, read within the last five minutes, so a turn isn’t sent to a key with a cold cache. Cost. The Usage tab prices each Grok call with xAI’s prices from models.dev. Balance. magpie reads no balance from xAI. Type it in yourself with key-balance, and the Usage page shows it less what magpie has priced the key’s calls at since."],["keys","Several keys and failover","One xAI provider can hold several keys: press Add another key under it, or paste several at once. Requests go to the first key that’s on, and when it runs out or is rate limited the next one takes over. Spend caps. spend-cap stops a key at a dollar amount a day, a month or in all, as the Usage tab prices its calls; routing then goes on to the other keys and the fallbacks. Fallbacks. fallback names where requests go when xAI is out of quota or down: another provider’s model or a routing group. A request xAI can’t read. When xAI answers 422 “Failed to deserialize the JSON body … unknown item type”, the request goes to the next member of the routing group, and the key isn’t rested for it. magpie provider spend-cap xai 20 month magpie provider key-balance xai 25 magpie provider fallback xai deepseek/deepseek-v4-pro"],["trouble","Troubleshooting","“maximum prompt length is …”. The conversation is longer than the model takes. magpie tells the agent so the way it understands, context_length_exceeded or Anthropic’s “prompt is too long”, so the agent compacts and tries again. “Could not decrypt the provided encrypted_content”. Codex moved to Grok mid-conversation with another vendor’s reasoning in it. magpie asks again without it; see Reasoning. “unknown variant custom”. xAI turned away Codex’s custom tools. magpie translates that model’s Codex requests from then on; the first refusal is the last. Checking a key. magpie provider test xai sends a tiny request through each endpoint, or to each model you name. Add --as codex or --as claude-code to send it the way that agent would."],["faq","FAQ","How do I use Grok in Claude Code? Add your xAI API key in magpie (Providers, Add provider, xAI), then pick a Grok model such as grok-4.7 on Claude Code’s row, or run magpie claude xai/grok-4.7. Claude Code’s requests go through magpie’s gateway to xAI’s Anthropic Messages endpoint, https://api.x.ai. Can Codex use Grok 4? Yes. xAI serves the Responses API that Codex speaks, so magpie codex xai/grok-4.7 sends Codex’s requests to https://api.x.ai/v1 as they are, with what xAI would refuse fixed on the way: tool schemas, a tool choice with no tools, and whole numbers Grok writes as 2500.0. Can Gemini CLI and OpenCode use Grok? Yes. Gemini CLI speaks Google’s API, so magpie translates its requests to xAI’s Chat Completions and the replies back. OpenCode speaks Chat Completions, so its requests go to xAI as they are. Run magpie gemini model xai/grok-4.7 or magpie opencode xai/grok-4.7. Does web search work with Grok? Yes. Codex’s web search is run by xAI itself on its Responses API. For Claude Code, Gemini CLI and OpenCode, magpie gives the model its own search tool, answered by the searcher chosen in Settings, or by one magpie picks. Why did Codex fail after switching from GPT to Grok mid-conversation? xAI can’t read reasoning that another vendor sealed, and answers “Could not decrypt the provided encrypted_content”. magpie asks again without those items and leaves them out for the rest of the conversation. Does magpie show my xAI balance? No. The Usage tab counts tokens, cache and cost for every Grok call, priced from models.dev, but magpie reads no balance from xAI. You can type the balance in with magpie provider key-balance, and the Usage page shows it less what magpie has priced since. By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Volcengine Ark · Tencent Cloud · Baidu Qianfan · SiliconFlow · ModelScope · Huawei Cloud MaaS · Xiaomi MiMo · StepFun · LongCat · Qwen · MiniMax · Anthropic · OpenAI · Gemini · Mistral · OpenRouter · GitHub Copilot · Ollama Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. Ask on Discord if you get stuck."]]],["/docs/groq","Groq",[["","","Groq runs open models on its own LPU chips and is known for speed. It serves OpenAI's gpt-oss and other makers' open models. magpie's groq preset brings it to Claude Code, Codex, OpenCode and other agents: one Groq key, with the model list Groq gives."],["add","Add it","Get a key. Create an API key at console.groq.com/keys. Add it. Pick Groq in the app and paste the key into API key, or from the CLI: magpie provider add groq magpie provider test groq The preset points Chat Completions and Responses at https://api.groq.com/openai/v1, so there is no address to type. A Groq provider set up in OpenCode or another app becomes the groq preset when imported."],["agents","Use it in an agent","Model ids are groq/: magpie claude groq/openai/gpt-oss-120b magpie codex groq/openai/gpt-oss-120b Claude Code and other Anthropic agents have their requests translated by magpie to Chat Completions for Groq: Groq's Chat API reports its cache, so Usage shows what was read from it. Most of Groq's models are other makers', and models.dev lists them under Groq, so magpie doesn't take Groq's list as a maker's word on theirs."],["limits","Rate limits and context","Groq's 429 names the model it limits (for model `…`). magpie rests that model on that key alone and asks the other models straight; a 429 that names no model rests the key whole. When Groq says \"reduce the length of the messages\", magpie reads it as an overflow and gives the agent the error it knows (OpenAI's context_length_exceeded, say), so the agent compacts instead of asking again. Groq turns away a field it doesn't take with a 400 saying \"unsupported\". For a field magpie adds, such as its cache key, magpie asks again without it and doesn't send it to Groq again."],["audio","Speech to text and text to speech","The gateway's /v1/audio/transcriptions and /v1/audio/speech take Groq too: the form and the audio go to Groq as sent, with only the model set to Groq's own id, and the answer comes back in Groq's own format. Text to speech works the same way, with model groq/playai-tts. curl http://127.0.0.1:3425/v1/audio/transcriptions \\ -H 'Authorization: Bearer magpie' \\ -F model=groq/whisper-large-v3 -F file=@meeting.m4a"],["notes","Notes","Groq takes its turn in a routing group like any provider: when it fails, the group's next member answers. When one key isn't enough, add another as a second account of the same provider. Fireworks and Fireworks Nexus in Claude Code, Codex and other agents"],["faq","FAQ","Does magpie support Groq? Yes, with the groq preset. Give a Groq API key; Chat Completions and Responses are set, the models come from Groq's list, and a model id is groq/. Can Claude Code use Groq's models? Yes. magpie translates Claude Code's Anthropic requests to Chat Completions for Groq, whose Chat API reports its cache, so Usage shows it. What happens when Groq rate-limits me? When Groq's 429 names the model, magpie rests only that model on that key and the others go on; in a routing group with other providers, the request goes to the next one. Can I use Groq's Whisper? Yes. Send an OpenAI-style form to magpie's /v1/audio/transcriptions with model groq/whisper-large-v3; text to speech goes to /v1/audio/speech. Related: Mistral in Claude Code, Codex, Gemini CLI and OpenCode, OpenAI in Claude Code, Codex, Gemini CLI and OpenCode. If something fails, see Fixing common errors: 401, 429, 502, 504 and more or ask on Discord."]]],["/docs/hermes","Hermes Agent",[["","","Hermes Agent, from Nous Research, runs on the model its config.yaml names. magpie adds itself to Hermes as one provider, so Hermes and each of its bots can run on any model you have in magpie: DeepSeek, Kimi, GLM, Qwen, an OpenAI key, or a ChatGPT or Copilot subscription, with no key pasted into Hermes. Hermes keeps its settings in ~/.hermes/config.yaml (%LOCALAPPDATA%\\hermes on Windows, or $HERMES_HOME). magpie adds a provider named magpie to its providers: the gateway, spoken to as chat completions, with your models in magpie as its models. Then it points model.provider at it and sets model.default to the model you pick. The provider and model you had are kept aside and put back when you switch back."],["on","Connect Hermes","Add providers in magpie In the Providers tab, add an API key or sign in to a subscription. Pick a model on Hermes Agent’s row In the Agents tab, choose a model on Hermes Agent’s row. Restart open Hermes sessions Hermes reads its settings as it starts. magpie hermes deepseek/deepseek-v4-pro # Hermes on DeepSeek magpie hermes # what Hermes runs on now"],["models","Model and reasoning effort","In Hermes’s own model picker, magpie’s models are named magpie//. The row also sets the reasoning effort, the same setting as Hermes’s /reasoning: none, minimal, low, medium, high or xhigh. Left unset, Hermes asks for medium. magpie hermes effort high magpie hermes effort default # back to Hermes's own"],["profiles","Bots and profiles","Each Hermes bot is a profile with a config.yaml of its own. magpie connects the profile hermes starts in: the one $HERMES_HOME names, else the one hermes profile use made sticky, else the default. It also adds its provider to every other profile, so magpie’s models are in every bot’s picker. A bot’s own model is left as you set it. With more than one profile, each other bot gets a model picker of its own on the Agents page; a bot still on the model magpie last set follows the next one, until you pick one for it."],["own","Your own models stay","Pick one of your own models in Hermes, or on the Agents page, and Hermes runs on it, but magpie’s provider stays: Hermes is still connected, and its picker still offers magpie’s models beside yours. Only switching back takes the provider out. Hermes inside WSL on Windows is found too: magpie writes the distro’s ~/.hermes, with the gateway at the address the distro reaches it."],["off","Switch back","Take Hermes Agent’s row off magpie, or run magpie hermes default. magpie removes its provider from every profile, puts back the provider and model you had, and leaves each bot on a model it can start with. Connecting again puts the bots back on the models they had."],["faq","FAQ","Can Hermes Agent use my ChatGPT subscription? Yes. Sign in to ChatGPT in magpie and pick a GPT model on Hermes Agent’s row. Hermes sends its requests to magpie, which uses the subscription. I picked a model in magpie but my bot still uses the old one. Restart the bot’s Hermes session: Hermes reads config.yaml as it starts. A bot you gave a model of its own on the Agents page doesn’t follow the main one. Why does Hermes still say connected after I picked my own model? magpie’s provider stays so its models remain in Hermes’s picker. Switch back to take it out. Does magpie touch my other Hermes providers? No. It adds its own provider and changes only model.provider, model.default and, when you set it, the reasoning effort. More agents on the same models: OpenClaw on any model, Models in OpenCode and Cline on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/huaweicloud","Huawei Cloud MaaS",[["","","Huawei Cloud ModelArts MaaS's Token Plan is for personal accounts in 西南-贵阳一 (Guiyang) and serves GLM, Kimi and DeepSeek over Chat Completions and Anthropic Messages. Add Huawei Cloud in magpie with the plan, and Claude Code, Codex, Gemini CLI and OpenCode use them through magpie's local gateway on 127.0.0.1:3425."],["add","Add Huawei Cloud","Add the provider and pick the plan On Providers, click + Add provider, pick Huawei Cloud MaaS, set the key's plan to Token Plan or Pay as you go, paste the key and save. Pick it for a tool On Agents, pick a model such as glm-5.3 on a tool's row. magpie claude huaweicloud/glm-5.3 magpie codex huaweicloud/deepseek-v4.1-flash magpie opencode huaweicloud/kimi-k2.6"],["plans","Plans and endpoints","Plan Chat Completions Anthropic Messages Token Plan https://api.modelarts-maas.com/plan/v2 https://api.modelarts-maas.com/plan/anthropic Pay as you go https://api.modelarts-maas.com/openai/v1 https://api.modelarts-maas.com/anthropic The Token Plan's quota is spent only at the endpoints under /plan, so magpie uses the plan's by default; pay as you go bills apart. Both take a MaaS API key, made under the ModelArts console's authentication management. Each key in the provider names its plan. Neither serves Responses."],["models","Models","Until its list is fetched, magpie gives the plan's models: glm-5.3, glm-5.1, kimi-k2.6, deepseek-v4.1-flash, deepseek-v4-flash, lowercase as Huawei's OpenClaw page writes them. Once the list is in, Huawei's own list is the one served."],["agents","In each agent","Claude Code speaks Anthropic Messages, which the plan serves, so requests go as they are. See Claude Code with other models. Codex speaks only OpenAI Responses, which Huawei Cloud doesn't serve, so magpie converts to Chat Completions; custom tools such as apply_patch go to the model as functions and come back as Codex can run them. See Codex with other models. Gemini CLI speaks Gemini's API; magpie translates at the local gateway. See Gemini CLI with other models. OpenCode : magpie writes the models into opencode.json. See OpenCode with other models."],["faq","FAQ","How do I use the Huawei Cloud Token Plan in Claude Code? Add Huawei Cloud MaaS in magpie with the key's plan set to Token Plan, then pick glm-5.3 on Claude Code's row, or run magpie claude huaweicloud/glm-5.3. Requests go to the plan's Anthropic endpoint, https://api.modelarts-maas.com/plan/anthropic. Does Huawei Cloud MaaS work in Codex? Yes. Huawei Cloud has no Responses endpoint, so magpie converts Codex's requests to Chat Completions, custom tools included. Run magpie codex huaweicloud/deepseek-v4.1-flash. Why the endpoints under /plan? The Token Plan's quota is spent only at /plan/v2 and /plan/anthropic; requests to pay as you go's /openai/v1 bill apart. magpie uses the plan's endpoints by default. Which models does the Huawei Cloud Token Plan have? magpie gives glm-5.3, glm-5.1, kimi-k2.6, deepseek-v4.1-flash and deepseek-v4-flash until Huawei's list is fetched, and then serves that list. The same for other providers: Tencent Cloud, Baidu Qianfan, Volcengine Ark, GLM Coding Plan, Kimi, DeepSeek, Qwen. Hit an error? See troubleshooting, or ask on Discord."]]],["/docs/images","Images",[["","","Many models can't see images: DeepSeek, GLM and others. Paste a screenshot in Claude Code or Codex, switch to such a model, and the request is usually turned away. Through magpie, a model that can see describes the image first, and the description goes in the image's place: in the current turn, older turns and tool results alike. So screenshots keep working whichever model you switch to. The other way round, agents can generate images and videos through the Magpie Image tool."],["vision","Image recognition","Pick the model that describes images under Settings › Models › Image recognition: Automatic: the default. magpie picks one of your models that can see, one with allowance left first. A model you pick: always that one. If its provider is removed or turned off, the row says so and the automatic choice takes its place. Off: images are no longer described, and a model that can't see turns away a request with one in its latest message. Each image is described once and the description is cached, so an agent sending the same image again every turn doesn't pay again. A request's images are described at once, up to 4 in parallel. A chip beside the model picks how hard it thinks; unset, it uses the model's lowest level. A model that can see still gets the image itself, not a description."],["mcp","Image recognition MCP server","Image recognition is also an MCP server (Streamable HTTP) with one analyze_image tool, which reads an image with the Image recognition model. The address is on the Image recognition MCP server row; by default: http://127.0.0.1:3425/mcp/magpie/vision Add the address to an agent as an MCP server Cursor, Claude Desktop or any agent that speaks Streamable HTTP. Call analyze_image image is an http(s) URL, a data URL, or an absolute path to a file on this computer (~/ and file:// taken, up to 20 MB). An optional prompt asks a question about the image; without one, the image is described. A file path works only for a caller on this computer. From another computer (with magpie shared on the local network), send a gateway key as Authorization: Bearer and the image as a URL or data URL. With Image recognition off, or no model that sees, the tool answers with an error that says where to pick one."],["draw","Generating images and videos","Magpie Image is magpie's own MCP tool (magpie mcp image, stdio). Give it to an agent from the Library, or with Give agents Magpie Image… under Settings › Models › Image generation. It has three tools: generate_image: an image from a prompt, or an edit or combination of reference_images. Optional size (1024x1024 or 16:9, say), n (1 to 4), quality and background. generate_video: a short video of 1 to 15 seconds from a prompt, optionally from an image as its first frame, or with reference images. generation_result: waits for an image or video still being made, by the id it gave, and says where it was saved. Images go in the project's generated-images folder and videos in generated-videos unless a path is given, and an existing file is never written over. Images are drawn with the model picked under Image generation (with Automatic, magpie picks it), videos with the first video model magpie has. Many agents wait only 30 to 60 seconds on a tool call, and an image often takes a minute or more. So a call waits at most 20 seconds: if the job isn't done, it answers with an id, and the job goes on and saves what it makes."],["api","Image API","The gateway also serves OpenAI's image endpoints, translated to the picked model's own image API: /v1/images/generations /v1/images/edits magpie handles the differences between OpenRouter's, Volcengine Ark's and other providers' endpoints. A ChatGPT account's GPT Image, a Grok subscription's Grok Imagine and a WorkBuddy plan's image models aren't held back by an account's own list of models. A name that points to a routing group tries its members in the group's order, moving on when one fails."],["timeout","Image generation timeout","Settings › Models › Image generation timeout: how long a provider is given to draw an image and send it, 1 to 60 minutes, 5 by default. A slow image endpoint may need longer."],["faq","FAQ","Can DeepSeek see images? DeepSeek's models can't see images by themselves. Through magpie, the Image recognition model describes each image first and the description goes to DeepSeek in its place, so screenshots in Claude Code still work. Does image recognition cost extra? Describing an image uses the Image recognition model's allowance or price. Each image is described once and the result is cached. How do I make Claude Code generate images? Give Claude Code Magpie Image from the Library. It then has a generate_image tool that draws with the model under Settings › Models › Image generation and saves to the project's generated-images folder. Can Cursor use magpie's image recognition? Yes. Add /mcp/magpie/vision to Cursor as an MCP server (Streamable HTTP) and it has the analyze_image tool. Related: Web search for any model, DeepSeek in Claude Code, Codex, Gemini CLI and OpenCode. Hit an error? See Fixing common errors: 401, 429, 502, 504 and more, or ask on Discord."]]],["/docs/import","Add to magpie",[["","","Hand your users one link, and your models show up in every agent they run: Claude Code, Codex, OpenCode, Gemini CLI, Pi, Crush. No config files, no environment variables, no copy-pasting base URLs. What your user sees. Nothing is saved until they press Add."],["quick-start","Quick start","Build a link Describe your endpoint as URL parameters: a name, a base URL per API you speak, and optionally the user’s key and the models to offer. Put it behind a button On your dashboard, next to the key you just minted: Add to magpie. The user confirms magpie opens, shows exactly where prompts and the key will go, and adds the provider when the user says yes. Every agent can use it right away. https://usemagpie.ai/import#name=Acme%20Relay&chat=https://api.acme.example/v1&anthropic=https://api.acme.example&key=sk-…&models=gpt-5.5,claude-sonnet-5"],["link","The link","magpie registers the magpie:// scheme with the system. An import link is that scheme, the word import, and a query string: magpie://import?name=Acme%20Relay&chat=https://api.acme.example/v1&key=sk-… On the web, link to the same parameters on usemagpie.ai/import instead, after a #: https://usemagpie.ai/import#name=Acme%20Relay&chat=https://api.acme.example/v1&key=sk-… Why the https link It works everywhere a link does: GitHub READMEs, chat apps and email clients drop or block custom schemes. It opens magpie, and offers the download when magpie isn’t installed yet. Why after the # Browsers never send the fragment to a server. The key goes from your page to the user’s machine without passing through usemagpie.ai, not even its logs. Every value is URL-encoded, as URLSearchParams or urlencode produce. Both %20 and + work for spaces."],["parameters","Parameters","A link either names one of magpie’s presets, which already knows the vendor’s endpoints, or describes a provider from scratch with a name and at least one base URL. Parameter Meaning nameor preset What the provider is called in magpie, at most 80 characters. chat OpenAI Chat Completions base URL, ending in /v1 (magpie appends /chat/completions). responses OpenAI Responses base URL, ending in /v1. Codex speaks only this API; magpie translates for it when you don’t. anthropic Anthropic Messages base URL: the root, without /v1. gemini Google Gemini API base URL, ending in /v1beta, as the app’s editor and the TUI take one. key The user’s API key. Leave it out and the user pastes one in the dialog. models Model ids to offer the agents, comma separated. Without it, magpie lists the models your /v1/models returns. id The id agents use in id/model. Defaults to the name, lowercased with dashes (Acme Relay → acme-relay). catalog A models.dev provider id whose metadata applies, e.g. openai for a relay of OpenAI models: display names, context sizes (written into the agents that take them), reasoning levels and image input; the model list when the provider’s own /models can’t be read; and per-token prices, which the Usage page turns into a cost estimate in USD. Several ids may be given, comma-separated: their models are combined, and where two know the same model the first one’s entry is used. website Your site (https). Shown on the provider’s page. keys The page where users make keys (https). The dialog links to it when the link has no key. icon A picture of your own (https): PNG, JPEG, GIF, WebP, ICO or SVG, at most 1 MB. magpie downloads it once, after the user confirms the import, and keeps it beside the provider. Without one, magpie shows the catalog vendor’s logo or a plain mark. balance Where the key’s balance is read (https), on the host of one of your base URLs: magpie asks it with the key, as a chat request sends it. {key} in it stands for the key. Without it, magpie reads the vendors it knows, and asks a relay where new-api and sub2api tell a key its balance (/api/usage/token, /v1/usage); give one when yours answers elsewhere. balance_path Where the amount is in the JSON reply: a dotted path, list items by index (data.balance, balance_infos.0.total_balance), or a sum of them in your own units ($ data.quota / 500000). $ or ¥ before it is the currency, % after it a percent of 1; several amounts go apart by ;, each with a label: if wanted. Needs balance. balance_method GET, the default, or POST with no body. Needs balance. presetor name A preset id; its endpoints, catalog and pages are used, and name may rename it. region With a preset that has regions, which one. At least one of chat, responses, anthropic and gemini is required without a preset; give every API you speak, and each agent uses the one it speaks natively. Base URLs must be https, except plain http to localhost, loopback, private addresses and *.local, where model servers usually run without TLS. They can’t carry a query, a fragment or credentials. A link sets no other header or token for the balance: an account-wide access token is worth more than one key, and a URL stays in browser history. A balance that needs one is set up in the provider’s editor. Presets Vendors magpie already knows. magpie presets prints the current list. anthropicopenaigoogledeepseekxaimoonshotKimimoonshot-cnkimi-codekimi-code-cnzhipuGLM · api · codingzaiapi · codingminimaxminimax-cnstepfunplan · apistepfun-cnplan · apixiaomiMiMolongcatbaidu-qianfan千帆 · personal · team · apitencent-cloudplan · cn · intl · enterprise · enterprise-intlhuaweicloudplan · apivolcengine火山方舟 · coding · agent · apiqwenqwen-cnqwen-token-planbailian-token-planqwencloudap-southeast-1 · us-east-1 · eu-central-1 · ap-northeast-1 · cn-hongkong · cn-beijingqwencloud-token-planmistralvoyagegroqbedrockollama-cloudopenroutervercelopencode-goclinepassopencode-zenkilocommandcodetogetherfireworkssiliconflowcn · intlnvidiamodelscope魔搭aihubmixpipellm302aicherryinyylxauto · global · cnaigocodeollamalmstudio A vendor with a preset only needs to add the key: magpie://import?preset=deepseek&key=sk-…. Want yours on the list? Open an issue."],["builder","Link builder","Fill in your endpoint; the link, the button and the Markdown follow as you type. Everything stays in this page. Preset Region Name Id optional OpenAI Chat base URL Anthropic base URL OpenAI Responses base URL optional Gemini base URL optional models.dev catalog optional API key optional Models comma separated Website optional Key page optional Icon optional, https Balance URL optional, a base URL’s host Balance field optional Balance methodGETPOST Web link App link HTML Markdown Try itOpens magpie; nothing is added until you confirm."],["button","The button","Two ready-made badges, one for light pages and one for dark. Link them to your import link, or draw your own button: the words Add to magpie and the bird are yours to use. \"Add [![Add to magpie](https://usemagpie.ai/img/add-to-magpie.svg)](https://usemagpie.ai/import#preset=deepseek) For dark pages, use add-to-magpie-light.svg. A public page like a README should never carry a key; leave key out and the user pastes their own."],["generate","From your backend","The natural place for the button is the page that shows a freshly minted key. Build the link where you have it: const params = new URLSearchParams({ name: \"Acme Relay\", chat: \"https://api.acme.example/v1\", anthropic: \"https://api.acme.example\", key: apiKey, models: [\"gpt-5.5\", \"claude-sonnet-5\"].join(\",\"), icon: \"https://acme.example/logo.svg\", }); const href = \"https://usemagpie.ai/import#\" + params; from urllib.parse import urlencode href = \"https://usemagpie.ai/import#\" + urlencode({ \"name\": \"Acme Relay\", \"chat\": \"https://api.acme.example/v1\", \"anthropic\": \"https://api.acme.example\", \"key\": api_key, \"models\": \"gpt-5.5,claude-sonnet-5\", \"icon\": \"https://acme.example/logo.svg\", }) magpie import 'magpie://import?preset=deepseek&key=sk-…' # asks first; -y to skip"],["security","Security","An import link is a suggestion. The user decides. Always confirmed. magpie shows the name, every host that prompts and the key will go to, and the models, and saves nothing until the user presses Add. The user can rename it, or replace the key, first. No silent overwrites. When the id is already taken, the dialog says so and the button reads Replace. https only. Plain http is refused except to this machine or the local network; file:, credentials in URLs and other schemes are refused outright. Read once. Inside the app, the link’s contents are handed to the window a single time; a reload doesn’t bring the dialog back. Icons are fetched, not embedded. An icon= URL is downloaded by magpie, only after the user confirms the import, only over https, and only into its own icons folder — at most 1 MB, and the type is checked. magpie asks for it through usemagpie.ai’s icon proxy, so your host sees Cloudflare’s address and never the user’s, and the fetch is made from Cloudflare, where nothing on the user’s own machine or network can be reached. A loopback or local-network name is refused before anything is asked. The page and the dialog never load a remote picture directly. The balance stays on your hosts. A balance= URL on any host but one of the link’s base URLs is refused, so the key goes nowhere its requests don’t already go. It is asked only after the user adds the provider. Keys stay out of servers. The web link keeps parameters in the fragment. The key ends up only in ~/.config/magpie/providers.json, readable by the user alone. Keys in links are secrets. Put a key in a link only on a page that user alone sees, and prefer a key minted for magpie that they can revoke. Never put a shared key in a public link."],["platforms","Platforms","System How magpie:// gets registered macOS By the app itself, as soon as magpie.app is in Applications. Windows For the current user, the first time magpie runs. Linux By a desktop entry (x-scheme-handler/magpie), written by the installer and again on first run. Terminal magpie import shows the same summary and asks before adding. CC Switch links. magpie also opens the ccswitch://v1/import?resource=provider&… links relays make for CC Switch (app, name, endpoint, apiKey, apiFormat, model, or a base64 config), with the same confirmation. Only providers are taken, not prompts, MCP servers or skills. magpie claims the scheme only when no other app has it, so CC Switch, if installed, keeps its links (on macOS, where both can claim it, the system picks). Import links need magpie 0.1.8 or later. When magpie is already running, the link goes to that instance and its window comes forward."]]],["/docs/integrate","Integrate",[["","","For developers of an AI app, agent or client who want it to work well with magpie. There are three levels, from no work on magpie’s side to a row of your own on the Agents page. You want Route Change to magpie Your app’s requests served by magpie, counted under its own name in Usage Talk to the gateway none A row on the Agents page: detected, its model picked there, put back on disconnect An agent adapter a pull request A new model source (a subscription, a vendor), or rewriting requests A plugin none"],["gateway","1. Talk to the gateway","magpie runs a local LLM gateway. Every model the user has in magpie (subscriptions, API keys, local models, routing groups) is served there under one id each, so your app needs one provider entry, not one per vendor. Find it The gateway listens on 127.0.0.1:3425, or on the port in port of magpie’s settings.json (~/.config/magpie/settings.json, the same path under the user’s folder on Windows; $XDG_CONFIG_HOME/magpie when that is set). GET /api/hello answers {\"name\":\"magpie\",\"version\":\"…\"} when it is magpie. Read that file, never write it. magpie must be running (the app or magpie serve); an app that finds nothing there offers its own providers as usual. curl -s http://127.0.0.1:3425/api/hello curl -s http://127.0.0.1:3425/v1/models -H \"Authorization: Bearer magpie-acme\" Endpoints Requests go straight through when the vendor speaks your API, and are translated otherwise, streaming, tool calls, images and reasoning included. The base URL is http://127.0.0.1:/v1 for an OpenAI client and http://127.0.0.1: for an Anthropic or Gemini one. Path API /v1/chat/completions OpenAI Chat Completions /v1/responses OpenAI Responses /v1/messages, /v1/messages/count_tokens Anthropic Messages /v1beta/models/{model}:generateContent (and :streamGenerateContent) Google Gemini /v1/models the catalog /api/version, /api/tags, /api/show the catalog as an Ollama server lists it, for a client that takes only an Ollama endpoint (Copilot in Visual Studio and VS Code: enter http://127.0.0.1: as the Ollama URL; it chats on /v1/chat/completions, and /api/chat isn’t served) The key names your app On this machine the gateway takes any key. Send magpie- (Authorization: Bearer magpie-acme, or x-api-key) and every call is counted as acme in Usage, the Requests log and the routing rules that match on agents. Without it, magpie counts the call by the first word of your User-Agent (Acme/1.4 (darwin) is Acme); an SDK’s own User-Agent (OpenAI/JS …, ai-sdk/…) would count it as that SDK. From another computer (Settings → Share on local network) the key must be one of the user’s gateway keys, and the User-Agent names your app. Models GET /v1/models lists what the user has turned on: id (provider/model, or a routing group’s name, sent as it is), display_name, owned_by (the provider), reasoning and supported_reasoning_levels ([{\"effort\":\"low\"},…], and the same as plain names in reasoning_levels), context_window and max_output_tokens when known, and modalities when magpie knows whether it takes images. List them from there rather than shipping a list: the user adds and removes providers in magpie. Reasoning is asked in your API’s own field (reasoning_effort, reasoning.effort, Anthropic’s thinking or output_config.effort). ?format=text gives the ids one a line. The list holds chat models alone: ask for image and video models with ?kind=image,video (or ?kind=all). Each is marked \"kind\": \"image\" or \"video\" and is made on /v1/images/generations or /v1/videos, not a chat route. Cherry Studio, which can’t ask and tells an image model from a chat one by its id, is listed every kind. A vendor’s own fields: /v1/images/generations and /v1/videos take OpenAI’s fields and pass the others on to a vendor that takes them, such as Volcengine Ark’s content (reference video and audio, draft_task), ratio, resolution, duration: -1, tools, watermark and sequential_image_generation, and a video’s answer carries Ark’s own fields (content.last_frame_url, usage). For the rest of a vendor’s API use /v1/magpie/native//: GET, POST, PUT, PATCH or DELETE, with joined to the provider’s host (not its base URL), in the vendor’s own shape on the user’s key for that provider, a stream as it comes; Ark’s task list is GET /v1/magpie/native/ark/api/v3/contents/generations/tasks. It serves a provider added with an API key, not a subscription or sign-in, and Ark’s short paths (images/generations, contents/generations/tasks) still work under the key’s base. It takes the same gateway key as every route, and a key held to models, accounts or a budget is refused it. Optional Send X-Magpie-Session: with a conversation’s requests and GET /v1/magpie/route?session= says which model a routing group picked for the turn and the fallbacks it tried, before the first token (long-poll with after=&wait=). GET /v1/magpie/quotas lists the user’s subscription allowances, and GET /v1/magpie/usage and /v1/magpie/usage/requests the Usage page’s numbers and its requests (with session, and subagent/parent_agent for a Claude Code subagent’s call). They answer only this machine, or another with a gateway key; a key held to a budget, models or accounts sees its own calls and routes alone, and is refused the quotas unless its owner lets it see those of what it may use (magpie gateway-key quotas on; its own limit is GET /v1/magpie/limit). Calls your app makes to its vendor itself can be reported with POST /v1/magpie/usage/requests (one record or up to 5000 a post, in usage.jsonl’s shape, each with a rid; past times are kept, so a history can be backfilled). They show on the Usage page as reported, and never count against a key’s limit. The reference has the details. Keep the user’s providers. Add magpie as one more provider (named Magpie) beside the ones the user set up in your app, rather than replacing them, so turning magpie off is picking another provider."],["agent","2. A row on the Agents page","The agents magpie lists (Claude Code, Codex, OpenCode, dsh, Alma, Cindy…) are adapters in internal/agent, one file each. A row gets your app’s name and icon, shows when your app is installed, lets the user pick its model (and reasoning) from magpie’s catalog, follows the catalog as providers change, and on disconnect puts back what your app had before. There is no runtime registration: a row is added by a pull request to magpie, and ships in the next release. An adapter is an Agent value. What your app offers decides its shape: magpie edits your config file (most adapters; fx.go, empryo.go). Dir, Path and Bin find the app; each Field (model, effort…) has Get, Set and Options. Connecting adds a magpie provider at the gateway, keyed magpie-, and sets your model to one of magpie’s; the agent’s default or Unwire takes magpie’s entries out and restores what was there. Only the keys magpie sets are touched. Notice says when your app must be restarted; Sync rewrites a model list your app keeps in a file. Your app takes a provider only through its own import link, confirmed in your app (cindy.go). Import returns the link (yourapp://provider/import?… with the gateway’s URL, the key magpie- and the endpoints), the row’s button opens it, and the user says yes once, in your app. Added reads, read-only, whether your app has magpie already. magpie writes nothing of yours. This suits an app that keeps its providers in a database or encrypted. Your app has a local API while it runs (Alma, Shelley): magpie adds itself as a provider and sets the default model through it. A pull request needs the adapter and its entry in agents.go, UA (what your User-Agent begins with, lower-case) so Usage knows your calls, an icon in internal/gui/assets/icons, tests that run under a temporary HOME (connect, switch, disconnect restoring the original file), and a row in the reference’s Agents table. What helps most is a stable, documented config format or import link, and where your app keeps it on each system."],["plugins","3. Plugins","A plugin is an npm package magpie runs; the user installs it from Settings → Plugins or with magpie plugin add . Provider plugins (OpenCode’s auth hook, or a pi package) add a source of models, such as a subscription magpie doesn’t sign in to itself. Gateway middleware rewrites requests and replies as they pass. See the plugin guide. A plugin can’t add a row to the Agents page or write another app’s config, so it is not how an app registers itself."],["not","What isn’t there","No API or link lets another app register itself as an agent, or install a plugin, without the user: plugins are installed in magpie by the user, and agent rows come from adapters in magpie’s source. magpie://import links add a provider (a source of models, with its key), not an agent or an app: see Add to magpie. Questions, or an adapter you’d like to discuss first: open an issue or ask on Discord."]]],["/docs/intent","Intent routing",[["","","Send a turn to a model by what the user asks for: tests to the strong model, quick questions to the fast cheap one. You describe each kind in a few words. When a turn begins, a small model you choose picks which kind the message is. The Coder group: long turns go to Kimi, quick questions to DeepSeek Flash, tests to DeepSeek Pro. Llama 3.1 8B on Groq picks the intent. Intent is one of the conditions a routing group’s rule can have, next to length, images, reasoning and agent. This page describes exactly what magpie does with it, as of v0.1.99, so you can predict every decision and check it in the Routing tab. In one paragraph. magpie decides once per turn: when you send a message, not while the agent works through tool calls. If a rule with an intent could be the first to match, magpie asks the group’s classifier model one short question through its own gateway. The question holds the intents as a numbered list plus the text of your latest message, and the classifier answers with a number. magpie reads that number and checks the rules top first with it. The first rule that matches puts its model first, and the group’s other models stay behind it for failover. The turn then stays on that model until you speak again. If the classifier fails, times out or answers something else, no intent matches and the turn is routed as if those rules weren’t there. There are no embeddings, no keyword lists and no training: the model you pick reads your message and picks a number."],["setup","Set it up","You need a routing group with at least two models, and one more model to classify with. The classifier can be any model magpie has, in the group or not. Open the group Go to Routing, find the group under Routing groups and click Edit. Add a rule with an intent Click Add a rule. The new rule reads asks for → a model, with the intent box ready: type what the message asks for, such as writing or fixing tests, then pick the model after →. More conditions come from the rule’s +, and must hold too. Pick the classifier Intent told by appears once a rule has an intent, set to Jev when you have a TypeSafe provider. Otherwise choose a small, fast model without reasoning. A group whose effort Jev already picks offers the same under its classifier: It can pick the model too. A group can’t be saved with an intent and no classifier. Save, and send a message Changes apply from the next turn, with no restart. The Routing tab shows what the classifier said and where the turn went. The timeout is global: in Settings → Models → Replies → Intent classifier timeout, choose 8, 15, 30 or 60 seconds. It defaults to 15 seconds and applies to the next classifier call, including Jev, with no restart. A slow classifier may need longer, but the turn waits for it before routing. In ~/.config/magpie/settings.json, \"classifyTimeout\" accepts whole seconds from 1 to 60; 0 or a missing field uses 15. A custom value in that range appears as its own choice in Settings. The same from a terminal: magpie group rule add coder use=deepseek/deepseek-v4-flash intent=\"a quick question\" classifier=groq/llama-3.1-8b-instant magpie group rule add coder use=deepseek/deepseek-v4-pro intent=\"writing or fixing tests\" magpie group rule add coder use=deepseek/deepseek-v4-pro use-effort=low intent=\"a simple edit\" # the same model, asked for low reasoning magpie group rule coder # the rules, numbered, and the classifier magpie group rule classifier coder groq/llama-3.1-8b-instant # change the classifier magpie group rule mv coder 3 1 # order matters: top first magpie group rule rm coder 2 intent= also takes the spellings asks= and about=. classifier= also takes classify= and by=. classifier= on rule add sets the group’s classifier and is needed only the first time. The classifier is saved in the group’s record in ~/.config/magpie/providers.json as \"classifier\", and each rule as {\"use\": …, \"intent\": …}. A rule can also set the reasoning its model is asked for, so an intent picks the model and the effort as a pair: use-effort= (low, medium, high, xhigh or max), saved as \"useEffort\", such as {\"use\": \"deepseek/deepseek-v4-pro\", \"intent\": \"a simple edit\", \"useEffort\": \"low\"}. In the editor it is set from the rule’s ⋯ menu, Set its reasoning, and shows beside the model. The rule’s model is then asked for that effort on the turn’s requests, whatever the agent asked, at the model’s nearest level. A model whose levels magpie doesn’t know is asked as the agent asked, and so are the models the group fails over to. A model fixed at an effort in the group keeps its own. Without it, the model is asked as the agent asked. The Routing tab says when a rule set the effort."],["how","How a turn is routed","Every request an agent sends to a group with rules goes through these steps, in this order: Is this a new turn? magpie looks at the request’s last user message. If it carries text or an image and no tool result, you just spoke, so a new turn begins. If it carries tool results, the agent is continuing a turn already under way (see The rest of the turn). Turns are counted per conversation. A subagent is its own conversation: it shares its agent’s session but starts with different words. Which intents could decide? magpie walks the rules top first and ignores intent for now: a rule is a candidate if its other conditions (tokens, images, reasoning, agents) hold for this request. Each candidate’s intent is collected, and duplicates spelled the same apart from case count once. The walk stops at the first candidate without an intent, because that rule matches outright and nothing below it could come first. If no intents were collected, the classifier isn’t asked and costs nothing. Ask the classifier magpie sends the classifier the collected intents and the text of your message. The exact prompt is shown below. The call goes through magpie’s own gateway, like a request from an agent, so it uses that model’s provider with its keys or accounts and their failover. It has the configured timeout to answer (15 seconds by default). Read the answer magpie takes the first whole number in the reply. 1 to n names that intent, and 0 means none of them. Anything else, such as no number or one out of range, counts as a failure. The answer is kept for 10 minutes for the same message and intents. Match the rules The rules are checked top first with the answer. A rule with an intent matches only when the classifier named its intent, compared without case, and all its other conditions hold. The first rule that matches wins. If none matches, the group routes the turn as it always does. Order the models The winning rule’s model goes first, and the group’s other models follow in their usual order as failover. This holds even if another model answered the conversation’s last turn: a rule outranks the Stays setting as a turn begins. If the rule’s model has nothing ready right now (every key resting, the provider off), the group’s usual order stands and the trace says so. Remember the decision magpie keeps the decision for this conversation (the group, the agent’s session and the conversation’s first words) with the classifier’s answer, so the rest of the turn follows it. An example The Coder group above has three rules: # When Send to 1 ≥ 128000 tokens kimi/kimi-k2.5 2 asks for “a quick question” deepseek/deepseek-v4-flash 3 asks for “writing or fixing tests” deepseek/deepseek-v4-pro A 20k-token turn: rule 1 doesn’t hold, so both intents are candidates. The classifier is asked to choose between “a quick question” and “writing or fixing tests”. A 150k-token turn: rule 1 has no intent and holds, so the walk stops there. The classifier isn’t asked, and the turn goes to Kimi. The classifier says 0 (none): no rule matches, and the turn goes by the group’s routing (here In order, so deepseek-v4-pro first). In the app A real request through a group with two intent rules (“a quick question or explanation, with no code to write or change” and “writing or fixing tests”), sent from Claude Code: “Add unit tests for the LRU cache in cache.go, covering eviction and concurrent reads and writes”. The Routing tab shows it as it happens. The classifier (deepseek-flash) said “writing or fixing tests” in 964 ms, so rule 2 put glm-5.3 first, ahead of the group’s usual first model; it answered in 5.6 s."],["prompt","What the classifier sees","This is the whole request, and nothing else is sent. The system message is fixed. The user message lists your intents in rule order, as they were collected in step 2: You route a user's message to a coding assistant by what it asks for. Given numbered kinds of request and the user's message, answer with the number of the kind the message is, or 0 if it is none of them. Answer with the number only. Kinds: 1. a quick question 2. writing or fixing tests The user's message: Write unit tests for the parseTokens function and fix any that fail. The number of its kind (0 for none): Only your latest message. magpie sends the text parts of the last user message and nothing else: no earlier turns, no system prompt, no tool definitions, no files. Images aren’t sent. A message that is only an image has no words to classify, so no intent matches. To route by images, use the rule’s has an image condition. Agent reminders are removed. … blocks, which Claude Code adds to your message, are stripped. Other text an agent puts in the same message is kept. Long messages are shortened. Over 4,000 characters, magpie keeps the first 3,000 and the last 1,000, joined by …. The start and the end usually say what is being asked. The request settings. An OpenAI-style chat completion, not streamed, with temperature 0, max_tokens 2048 and User-Agent magpie-router/1. When magpie knows the classifier’s reasoning levels, it asks for the least: none if the model has it, else its lowest level (for example low). When the levels aren’t known, nothing is sent and the vendor’s default applies. magpie translates it for the classifier’s provider, like any other request, so an Anthropic, Gemini or other model works too."],["failures","When it can’t say","A classifier is a helper, not a gate. Whatever happens to it, the turn is still answered: the intent rules just don’t match. What happens What magpie does It answers 0 No intent matches. Rules without an intent and the group’s usual order decide. No answer within the configured timeout Treated as a failure: no intent matches, and the turn goes on at once. An error (quota, 5xx, bad key) Its provider’s own failover is tried first, within the configured timeout. If it still fails, no intent matches. An answer that isn’t a number from 0 to n No intent matches this turn. The classifier did answer, so it isn’t rested: the next turn asks it again. An error or a timeout That classifier model is left alone for 30 s: turns in that time don’t wait on it, and the trace says it wasn’t asked. The first good answer clears this. The message has no words Not asked. No intent matches. Each case is written in the turn’s trace with the reason. An intent rule can therefore make a turn go to a different model than you hoped, but it can’t make it fail."],["turn","The rest of the turn","A turn is often dozens of requests: the agent calls a tool, sends the result back, calls another, and so on. magpie deals with them like this: Held. Every request within the turn goes to the model the turn began on, and the classifier isn’t asked again. Switching models mid-turn would throw away what the vendor cached of the conversation (prompt caching), and some vendors reject reasoning that another one wrote. Failover sticks. If the rule’s model failed and another member answered, that member keeps the rest of the turn (with Stays on Auto, Session or Within a turn). The rule decides again at your next message. Outgrown. The one exception: if the conversation grows within the turn to 95% of the current model’s context, magpie checks the rules again, keeping the classifier’s earlier answer. If a rule sends it to a model with more context, it moves. It never moves to a model with less. Waits. If magpie didn’t see the turn begin (it was started or restarted in the middle of one), or the rule that decided it was removed or now sends to another model, no rule moves the turn. The rules decide again at your next message. Subagents. A subagent’s turns are decided on their own, from the subagent’s own messages. A rule can send a subagent elsewhere while its agent stays where it is. Decisions are kept in memory for 24 hours after a conversation’s last request. Restarting magpie clears them, and the next message decides afresh."],["trace","Reading the trace","The Routing tab shows each group’s latest request: who answered it, and under How the last request was routed, why. A message asking for tests: the classifier said “writing or fixing tests” in 323 ms, so rule 3 put deepseek-v4-pro first. The lines you can see about intent: The trace says Meaning … was asked which of “A”, “B” turn 1 is, and said “B” (in 323 ms). The classifier was asked, with these candidates, and named B. … and said none (…). It answered 0. … (said before, for the same message). The answer came from the 10-minute cache, so no call was made. … was to tell which … but couldn’t — reason — so no rule with an intent matches it. It failed. The reason is the error, the timeout, what it answered, or that it is resting after a failure. Turn N begins and rule R matches — asks for “B” — so M goes first … The rule that won, and the model put first. Rule R matches, but M has no account or key that can take this request, so the group’s order stands. No account or key for the rule’s model can take this request. Rule R (…) sent turn N to M as it began; the turn stays there. A tool round within the turn, held on its decision. This turn began before magpie saw it, so the rules wait for the next one. See Waits above. The classifier’s own calls appear in Usage under the agent magpie, with their tokens and cost, so you can see what classifying costs."],["cost","Latency, cost, privacy","Latency. Only the first request of a turn waits for the classifier, typically a few hundred milliseconds on a fast provider (323 ms in the screenshot) with a configured timeout of 15 seconds by default. Tool rounds within the turn, turns where no intent could decide, and cached answers add nothing. Cost. One short call per turn: roughly the size of your message plus the intents in, and one or two tokens out. In the example above that was 212 tokens in and 1 out. With a subscription model as the classifier, these calls count against that subscription’s limits. Privacy. The text of your message (up to about 4,000 characters) goes to the classifier’s provider. To keep it on your machine, use a local model from Ollama or LM Studio as the classifier. magpie keeps only a hash of the message and the answer, in memory, for 10 minutes. The message itself isn’t stored or logged."],["tips","Writing good intents","Describe the request, not the model. Write “writing or fixing tests”, not “hard tasks for Opus”. The classifier sees only your words and the message. Keep kinds apart. If two intents overlap (“a question”, “a question about the code”), a small model will choose between them unpredictably. Merge them, or make the difference plain. Few and broad beats many and narrow. Two to five intents are easy for an 8B model. Up to 200 characters each is allowed, but a few words are usually enough. Order still matters. Only the first matching rule counts, so put a rule that must win (such as a long-context rule) above the intent rules. The classifier is then skipped whenever that rule holds. “None” is a real answer. A turn that fits no intent goes to the group’s usual order, so let that order be your default choice. Any language. Intents and messages can be in any language the classifier understands. The fixed prompt is in English, and small models read mixed languages well. Choosing a classifier. Pick a small, fast model without reasoning: Llama 3.1 8B on Groq, a Flash-Lite, nano or mini model, Claude Haiku, DeepSeek’s non-reasoning chat model, or a local model. A reasoning model is slower; magpie asks it for its least reasoning and leaves it 2048 tokens, but a slow one can still miss the configured timeout. Check the trace for a few turns: if it guesses wrong, rewrite the intents before switching models."],["limits","Numbers","What Value Classifier timeout 15 s by default; configurable from 1 to 60 s, including its provider’s failover Rest after a failure 30 s, per classifier model Answer cache 10 min, per classifier + intents + message; in memory Turn decisions kept 24 h after the conversation’s last request; in memory Message sent Up to 4,000 characters; longer is first 3,000 + last 1,000 Classifier request temperature 0, max_tokens 2048, the least reasoning the model has, not streamed Intent length Up to 200 characters; spaces collapsed, compared without case Outgrown At 95% of the current model’s context, only to a model with more"],["faq","FAQ","Is this embeddings or a vector search? No. There is no embedding model, no similarity threshold, no keyword list and nothing to train. The classifier is an ordinary chat model that reads your intents and your message and answers with a number. It is only as good as that model and your wording, and the trace shows every answer. Does it look at the whole conversation? No, only the message you just sent. So a follow-up like “now do the same for the other file” is judged on those words alone. Give that turn a clearer message, or add an intent that fits follow-ups. My agent made 40 requests for one message. Was the classifier asked 40 times? No, once. The other 39 carried tool results, so they belong to the same turn and follow its decision. You can see this in the trace (“the turn stays there”) and in Usage (one magpie call). Can a turn switch models halfway? Only in two cases: the model it is on fails and another member takes over, or the conversation outgrows the model’s context and a rule sends it to one with more room. Intent is never re-asked mid-turn. What if the classifier is down or slow? The turn still goes through. After waiting up to the configured timeout (15 s by default), no intent matches and the group’s other rules and order decide. For the next 30 s magpie doesn’t ask that classifier again, so turns don’t each wait out the timeout. The trace gives the reason. Why did the turn not go to the rule’s model when the classifier named its intent? Check the trace. The usual causes are: a rule above it matched first; another condition on the rule didn’t hold (tokens, images, reasoning or agent); no account or key for the rule’s model could take this request; it was a tool round in a turn that began elsewhere; magpie didn’t see the turn begin (“the rules wait”). Two rules have the same intent. What happens? The intent is offered to the classifier once. If it is chosen, the first of those rules whose other conditions hold wins. Use this to send, for example, “writing or fixing tests” from Codex to one model and from Claude Code to another. Does changing a rule affect a turn already running? No. Saving applies from the next turn. A turn whose rule you removed, or pointed at another model, keeps where it is until then; the trace says the rules wait. Can the classifier be a routing group, or one of the group’s own models? It can’t be a group: it must be one model, provider/model, which magpie checks when you save. It can be any model magpie has, including one of the group’s members, a subscription model or a local model. Can I use a reasoning model? Yes, if it answers within the configured timeout (15 s by default). magpie asks it for the least reasoning it has (none, else its lowest level) and leaves 2048 tokens, so thinking doesn’t crowd out the answer. A small, fast model is still the better choice: cheaper, and every turn waits for it. How well does it work with real models? We ran 20 real coding messages (English and Chinese: quick questions, test work, and ordinary coding tasks, including “Fix the bug in parseTokens and add a test for it”) through a group with two intent rules. DeepSeek V4 Flash, GLM-5.3 Flash and MiMo v2.6 Flash each classified all 20 correctly; the median classifier time was 0.75 s, 1.3 s and 1.9 s. Gemini 3.8 Flash through one reseller took 11 s even at low reasoning, so with the 8 s timeout that was the default then every turn timed out and routed as if there were no intents — the trace said so each time. That is the pattern to expect: a wrong classifier costs you the routing, never the turn. Does retrying the same message ask again? Not within 10 minutes: the same message with the same intents and the same classifier is answered from the cache, and the trace says “said before”. Changing an intent or the classifier makes it ask again. Which agents does it work with? Any agent that sends to a routing group through magpie: Claude Code, Codex, OpenCode, Gemini CLI and the rest. Turns are detected from the request itself (a message with text and no tool results), whatever API the agent speaks. Is my message stored anywhere? magpie keeps a hash of it (for the cache) and the classifier’s answer, in memory only. The text goes to the classifier’s provider, like any request, under that provider’s terms. The classifier’s usage record holds its token counts, not the text. How accurate is it? That depends on the classifier and on how distinct your intents are. With a few clearly different kinds, a small model picks well; with overlapping ones it will sometimes guess. Since a wrong or missing answer only changes which model answers, start with two or three broad intents, watch the trace for a day and adjust the wording. Questions or a setup worth sharing? Ask on Discord. Routing groups in general are covered in Get started."]]],["/docs/jcode","jcode",[["","","jcode (1jehuang/jcode) is a coding agent in Rust that keeps its settings in config.toml. A provider of your own is a named profile, [providers.], as jcode provider add writes it. magpie adds itself as the profile magpie, at the local gateway, with every magpie model listed, and starts jcode on the model you pick. So jcode runs on any model you have in magpie: DeepSeek, GLM, Kimi, Qwen, an OpenAI or Anthropic key, or a ChatGPT or Copilot subscription."],["on","Set up jcode","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Pick a model on jcode's row With jcode installed, magpie's Agents page has a jcode row; pick a model. Start jcode A new jcode starts on that model; restart a session that is already open. magpie jcode deepseek/deepseek-v4-pro jcode # /model lists every magpie model, /effort its levels"],["files","What magpie writes","jcode's folder is $JCODE_HOME, else ~/.jcode. In its config.toml magpie writes [providers.magpie]: type = \"openai-compatible\" (jcode's Chat Completions client), base_url at the gateway's /v1, an api_key naming jcode, and requires_api_key = true. That last one is there because jcode takes a gateway on loopback as needing no key and then sends none, and the key is how the gateway knows the request is jcode's. It then sets default_provider and default_model in [provider] to magpie and the model you pick. # ~/.jcode/config.toml [provider] default_provider = \"magpie\" default_model = \"deepseek/deepseek-v4-pro\" [providers.magpie] type = \"openai-compatible\" base_url = \"http://127.0.0.1:3425/v1\" api_key = \"…\" requires_api_key = true models = [ { id = \"deepseek/deepseek-v4-pro\", context_window = …, input = [\"text\"], reasoning = true }, … ]"],["models","/model and /effort","Each of magpie's models is an entry in models, so jcode's /model picker lists them all and switches between them. Each entry carries the context window (128K when magpie doesn't know it; jcode would take 200K) and whether it takes images; a model with effort levels gets reasoning = true, so jcode's /effort offers them. A reasoning_effort you set on one of magpie's models stays while the model has that level. When magpie's models change, magpie updates the list."],["restart","When it takes effect","jcode reads its settings at start-up, so restart an open jcode session to use a new model or list; magpie says so while jcode is running."],["own","Your own settings","The profile and model [provider] named before are stashed and put back when magpie steps out. Every other key of the file is yours and stays as written, your own keys in magpie's profile too (headers, extra_body, a model's reasoning_effort). A config.toml that doesn't parse is an error and left as it is, never taken as empty. When jcode saves its settings itself it writes the models as [[providers.magpie.models]] tables; magpie folds them back into one array on its next write."],["off","Switching back","Set the row back to default in magpie: when jcode still starts on magpie, magpie puts [provider] back as it was; a pick you made in jcode since is yours and stands. Then the whole [providers.magpie] goes, with your own keys in it. Or pick one of jcode's own models, and magpie sets default_model to it. magpie jcode default"],["faq","FAQ","Can jcode use DeepSeek, GLM, Kimi or Qwen? Yes. magpie writes an openai-compatible [providers.magpie] profile into jcode's config.toml at the local gateway, and starts jcode on the model you pick. Can I switch magpie's models in jcode's /model? Yes. Every magpie model is in the magpie profile's models, so /model lists and switches them; a model with effort levels offers them in /effort. Why didn't jcode change after I picked a model? jcode reads its settings at start-up. Restart the open jcode session. Do my settings stay after switching back? Yes. magpie removes only [providers.magpie], and puts [provider] back when jcode still starts on magpie; every other key stays as written. More agents on the same models: Crush on any model, Models in OpenCode, Goose on any model and Reasonix Studio on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/jetbrains-air","JetBrains Air",[["","","JetBrains Air runs its own agents (Claude Agent, Codex, Gemini CLI, Junie) on accounts signed in under its settings, with no base URL to point elsewhere. It also takes any agent that speaks the Agent Client Protocol. magpie adds one, named Magpie, so Air can run on any model you have in magpie: DeepSeek, GLM, Qwen, an OpenAI or Anthropic key, or a ChatGPT or Copilot subscription. Air lists custom ACP agents from acp.json in its config folder: ~/Library/Application Support/JetBrains/Air on macOS, $XDG_CONFIG_HOME/JetBrains/Air on Linux, %APPDATA%\\JetBrains\\Air on Windows. magpie adds an entry named Magpie there that starts opencode acp, OpenCode’s ACP server, with OPENCODE_CONFIG set to magpie-opencode.json, a file magpie keeps beside acp.json. That file holds magpie’s provider, its models, the model a task starts on, and enabled_providers narrowed to magpie. OpenCode merges it over your own config and leaves your plugins, agents and MCP servers as they are. Air’s own agents, and the accounts they run on, aren’t touched."],["on","Connect Air","Add providers in magpie In the Providers tab, add an API key or sign in to a subscription. Pick a model on JetBrains Air’s row In the Agents tab, choose a model under magpie. Start a new task in Air Pick Magpie in its agent menu. magpie’s models and routing groups are in its model menu. magpie air deepseek/deepseek-v4-pro # the Air app magpie air-ide deepseek/deepseek-v4-pro # Air in JetBrains IDEs"],["opencode","OpenCode","The Magpie agent is OpenCode, so OpenCode has to be installed. magpie gives Air its full path, since an app may not have your shell’s PATH: the one on PATH, else ~/.opencode/bin, else one a JetBrains IDE or Zed installed from the ACP registry. If none is found, the row says to install it: npm i -g --allow-scripts=@opencode/cli @opencode/cli"],["models","The model menu","Air’s model menu for the Magpie agent is the list OpenCode reports, which is magpie’s models and routing groups and nothing of OpenCode’s own. The model picked on the row is the one a new task starts on, and also OpenCode’s small model for titles and summaries. You can pick another in Air’s menu for each task."],["ide","Air in JetBrains IDEs","Air is also a plugin in JetBrains IDEs: bundled with 2026.3, and installed from JetBrains Marketplace in 2026.2. The plugin reads custom agents from ~/.jetbrains/acp.json on every system, so it has a row of its own, Air (JetBrains IDEs), which adds the same Magpie agent there. Restart the IDE if Magpie isn’t listed yet. In the IDE, Air’s own Codex and Claude Agent, on their own login, run this computer’s codex and claude, so they are on magpie too while Codex and Claude Code are connected in magpie. The model on Air’s row is the Magpie agent’s alone."],["wsl","WSL projects","An IDE on Windows starts the agent of a project that lives in a WSL distro inside that distro, and refuses a Windows command there. So each running distro with OpenCode gets an entry of its own, such as Magpie (WSL Ubuntu), with OpenCode’s path in the distro and a config that names the gateway as the distro reaches it."],["keys","Provider keys in the environment","One gap is OpenCode’s: when a provider’s key is set in the environment Air starts it with (OPENAI_API_KEY, DEEPSEEK_API_KEY and so on, not empty), its ACP server lists that provider and none from its config, so magpie’s models don’t show. Unset the variable, or keep the key in OpenCode’s auth.json instead."],["off","Switch back","Take the row off magpie. magpie removes the Magpie entry from acp.json and deletes magpie-opencode.json. Air’s own agents were never changed. If the Magpie entry is removed by hand, the row says Air no longer reaches magpie."],["faq","FAQ","Can JetBrains Air use DeepSeek, GLM or Qwen? Yes. Pick the Magpie agent in a new Air task, and every model you have in magpie is in its model menu: DeepSeek, GLM, Qwen, GPT, Claude and more. Does magpie change Air’s own agents or accounts? No. It adds one ACP agent, Magpie, to acp.json. Claude Agent, Codex, Gemini CLI and Junie keep their own accounts. Why doesn’t the Magpie agent show magpie’s models? Usually a provider key such as OPENAI_API_KEY is set in the environment Air starts with. OpenCode then lists only that provider. Unset it, or keep the key in OpenCode’s auth.json. Does it work in IntelliJ IDEA, PyCharm and other JetBrains IDEs? Yes, through the Air plugin (bundled with 2026.3, from Marketplace in 2026.2). Connect the Air (JetBrains IDEs) row and restart the IDE. More agents on the same models: Models in OpenCode, Antigravity on any model, CodeBuddy on any model and Snow CLI on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/kimi-code","Kimi Code",[["","","Kimi Code, Moonshot’s kimi coding agent, takes providers and models of your own in its config. magpie adds its models there, so kimi can run on any model you have in magpie, not only Kimi: DeepSeek, GLM, Qwen, an OpenAI or Anthropic key, or a ChatGPT or Copilot subscription, with no key pasted into kimi. For Kimi’s own models in other agents, see Kimi in Claude Code, Codex and more. Kimi Code keeps its settings in ~/.kimi-code/config.toml ($KIMI_CODE_HOME). magpie adds a provider named magpie, of Kimi’s own type, with the gateway’s address and a key of its own, then one [models.\"magpie//\"] table per model, so magpie’s models join kimi’s /model picker. Then it sets default_model to your pick. Thinking travels both ways as reasoning_content, and the gateway translates each request for the model’s provider. The old Python kimi-cli is set up in ~/.kimi ($KIMI_SHARE_DIR) only where there is no Kimi Code folder, since Kimi Code reads ~/.kimi-code alone once it has taken over. A Kimi Code in WSL is set up the same way."],["on","Connect Kimi Code","Add providers in magpie In the Providers tab, add an API key or sign in to a subscription. Pick a model on Kimi Code’s row In the Agents tab, choose a model under magpie. Use it in kimi Kimi Code picks the change up as it runs. Every model of magpie’s is in /model too. magpie kimi deepseek/deepseek-v4-pro # Kimi Code on DeepSeek magpie kimi # what Kimi Code runs on now"],["models","What each model gets","Name and context The name kimi’s picker and status line show, and max_context_size, so kimi compacts in time. Thinking levels A model with levels gets thinking, with support_efforts and a default_effort for Kimi Code’s thinking picker. A model that always thinks gets always_thinking. Images and tools image_in for models that take images, tool_use on Kimi Code, and max_output_size where magpie knows the model’s reply limit. A value you set in one of magpie’s tables yourself, such as a default_effort, stays there on the next sync."],["reload","When it takes effect","Kimi Code 2.x watches its config, so an open session has the new models at once. In its web or desktop app, open Settings › Providers again, or reload the page, to see them in the picker. The old kimi-cli reads its config at start-up: restart open kimi sessions."],["own","Your own settings","Your Kimi Code sign-in, your own providers and models stay, and are listed on Kimi Code’s row beside magpie’s. Keys you added to the magpie provider table, such as custom_headers or env, stay too. The default_model you had is kept aside to be put back."],["off","Switch back","Pick one of your own models on the row, take the row off magpie, or run magpie kimi default. magpie puts back the default model you had, if Kimi still has it, then removes its model tables and its provider."],["faq","FAQ","Can Kimi Code run on models other than Kimi? Yes. Any model you have in magpie is in kimi’s /model list: DeepSeek, GLM, Qwen, GPT, Claude and more. Can Kimi Code use my ChatGPT subscription? Yes. Sign in to ChatGPT in magpie and pick a GPT model under magpie on Kimi Code’s row. kimi sends its requests to magpie, which uses the subscription. Does it work with the old Python kimi-cli? Yes. Where there is no ~/.kimi-code, magpie writes to kimi-cli’s ~/.kimi, without the keys only Kimi Code reads. Restart open sessions after a change. Does it work with Kimi Code in WSL? Yes. magpie sets up a Kimi Code in a WSL distro too, its provider pointing at the gateway as the distro reaches it. More agents on the same models: Models in OpenCode, Models in Claude Code, Qwen Code on any model and Pi on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/kimi","Kimi K2 and Kimi Code in Claude Code, Codex, Gemini CLI and OpenCode",[["","","Kimi, from Moonshot AI, comes two ways: the Kimi API, paid as you go, and the Kimi Code membership, each with a global and a China endpoint. magpie has a preset for each of the four. Add a key once, and Claude Code, Codex, Gemini CLI, OpenCode and your other agents can use Kimi’s models through magpie’s gateway at 127.0.0.1:3425."],["add","Add Kimi","Get a key For the Kimi API, from the Kimi platform’s API keys page; for Kimi Code, from the Kimi Code console. The table below links each. Add the provider In Providers, press + Add provider and pick the preset that issued your key: Kimi, Kimi (China), Kimi Code or Kimi Code (China). Paste the key and save. magpie asks Kimi which models it serves. Pick it for an agent In the Agents tab, choose a Kimi model on the agent’s row: kimi-k2.6 on the API, say, or kimi-for-coding on Kimi Code. magpie provider add moonshot sk-… # Kimi API (platform.kimi.ai) magpie provider add moonshot-cn sk-… # Kimi API, China (platform.kimi.com) magpie provider add kimi-code sk-… # Kimi Code membership magpie provider add kimi-code-cn sk-… # Kimi Code membership, China Model ids are provider/model: moonshot/kimi-k2.6, kimi-code/kimi-for-coding. The models listed are the ones Kimi serves your key at the time."],["endpoints","Plans and endpoints","Preset Plan OpenAI Chat Completions Anthropic Messages Key from Kimi Kimi API, pay as you go https://api.moonshot.ai/v1 https://api.moonshot.ai/anthropic platform.kimi.ai Kimi (China) Kimi API, pay as you go https://api.moonshot.cn/v1 https://api.moonshot.cn/anthropic platform.kimi.com Kimi Code Kimi Code membership https://api.kimi.ai/coding/v1 https://api.kimi.ai/coding kimi.ai/code/console Kimi Code (China) Kimi Code membership https://api.kimi.com/coding/v1 https://api.kimi.com/coding kimi.com/code/console A key works only on the endpoints of the plan and region that issued it, so pick the preset that matches where you got it."],["agents","In each agent","Pick the model on an agent’s row in the Agents tab, or from a terminal. Each guide says what magpie writes in that agent’s config and how to switch back. magpie claude moonshot/kimi-k2.6 magpie codex moonshot/kimi-k2.6 magpie gemini model moonshot/kimi-k2.6 magpie opencode kimi-code/kimi-for-coding Claude Code speaks Anthropic Messages, and so does Kimi’s Anthropic endpoint, so its requests are passed on as they are. Every tier (opus, sonnet, haiku) runs on the model you pick unless you give one its own. Models in Claude Code. Codex speaks only OpenAI Responses. Kimi serves Chat Completions and Anthropic Messages but not Responses, so magpie translates each request and the reply, streaming and tool calls included. The model shows in Codex’s /model with its reasoning efforts. Models in Codex. Gemini CLI speaks Gemini’s API. magpie points it at its gateway and translates. Models in Gemini CLI. OpenCode gets the model in opencode.json, with its reasoning variants and cost. Models in OpenCode."],["thinking","Thinking","Some Kimi models always think: Kimi Code (China)’s K3.1 turns away a request that switches thinking off. When an agent asks for it off and the model refuses, magpie asks again with thinking left on, so the agent gets an answer rather than the error."],["usage","Balance, windows and search","Kimi API. The row shows your balance: in ¥ for Kimi (China), in $ for Kimi. Kimi Code. The row shows the membership’s windows, read from Kimi: the weekly allowance, shorter windows such as five hours, the monthly allowance and a booster pack’s balance. Cost. Kimi Code’s models are listed at $0, so magpie’s Usage tab prices their calls at the Kimi API’s price for the same model. Web search. A Kimi Code key searches the web through the membership’s own search endpoint, and magpie gives that search to Kimi Code models that can’t search by themselves."],["faq","FAQ","How do I use Kimi K2 in Codex? Add your Kimi key in magpie, then pick a Kimi model such as kimi-k2.6 on Codex’s row, or run magpie codex moonshot/kimi-k2.6. Kimi serves Chat Completions and Anthropic Messages but not the Responses API Codex speaks, so magpie translates each request and the reply, streaming and tool calls included. Can I use my Kimi Code membership in Claude Code or Codex? Yes. Add the Kimi Code preset (or Kimi Code (China)) with a key from the Kimi Code console. magpie sends requests to the membership’s own endpoints, https://api.kimi.ai/coding for Anthropic Messages and https://api.kimi.ai/coding/v1 for Chat Completions, and shows the membership’s usage windows. Kimi or Kimi (China): which preset do I pick? The one that issued your key. A key from platform.kimi.ai goes with Kimi (api.moonshot.ai); one from platform.kimi.com goes with Kimi (China) (api.moonshot.cn). Kimi Code has the same two: kimi.ai and kimi.com. Why does Kimi Code show a cost when the membership is prepaid? Kimi Code’s model list prices its models at $0, so magpie prices each call at the Kimi API’s price for the same model. The figure shows what the work would have cost on the API; it isn’t charged. Can Kimi Code search the web for my agent? Yes. A Kimi Code key searches the web through the membership’s own search endpoint, so a Kimi Code model that can’t search by itself is given magpie’s search on your plan. Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode, Kimi Code on any model. Ask on Discord if you get stuck."]]],["/docs/kirocrew","Kiro Crew",[["","","Kiro Crew (kirodotdev/KiroCrew) is a persistent agent: the KiroCrew.app desktop app, the kirocrew CLI, its web dashboard and the Gateway they share. It runs each session on a harness, an agent it starts and talks to over ACP. Kiro Crew has no model provider of its own to point at magpie; its models are its harness's. So what magpie sets is which harness it runs: an agent already connected to magpie, whose own config sends its requests to the gateway, so DeepSeek, GLM, Kimi, Qwen, Claude, a ChatGPT subscription and every other model in magpie are there."],["on","Set up Kiro Crew","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Set Kiro Crew's provider to magpie on the Agents page When Kiro Crew is set to a harness magpie wires, magpie keeps it, and connects that agent to magpie too if it isn't yet. On a harness magpie doesn't wire (KAS, kiro-cli, deepseek), magpie picks the first harness connected to magpie, one whose adapter is here first. Start a new session in Kiro Crew The Gateway reloads the file when it changes. New sessions take the new harness; sessions already open keep theirs. To change the harness, pick another agent connected to magpie under harness on Kiro Crew's row. With none connected, magpie asks you to connect Codex, Claude Code, OpenCode, Pi or Goose to magpie first, then Kiro Crew."],["harness","The harnesses","magpie offers the harnesses it wires itself, through the files each one reads under Kiro Crew too: Codex: through the codex-acp adapter (npm @agentclientprotocol/codex-acp), reading ~/.codex or $CODEX_HOME Claude Code: through the claude-agent-acp adapter (npm @agentclientprotocol/claude-agent-acp), running your claude, which reads ~/.claude OpenCode: opencode acp Pi: through the pi-acp adapter (npm pi-acp) Goose: goose acp Not deepseek: Kiro Crew runs it as dsh --profile acp, a profile of its own that magpie's dsh wiring doesn't reach."],["file","config.json","Kiro Crew's settings are config.json in its home: $KIROCREW_HOME when set (made absolute; a root, /usr, /System or /etc is refused and the default used), else ~/.kiro/crew, the desktop app's too. magpie writes two keys: // ~/.kiro/crew/config.json { \"agent\": { \"acp_backend\": \"codex\", \"member_acp_backend\": \"codex\" }, … } acp_backend is the sessions' harness; empty, it is kiro-cli, the default. member_acp_backend is the crew members' harness, kas by default, written only for a harness that can dispatch members (Codex, Claude Code, OpenCode, Goose), not Pi. magpie keeps what both keys said before, and puts it back on switching off."],["adapter","ACP adapters","Codex, Claude Code and Pi run through an npm adapter Kiro Crew doesn't ship. magpie looks for it where Kiro Crew does: the path its variable names (CODEX_ACP_BIN, CLAUDE_AGENT_ACP_BIN, PI_ACP_BIN), the PATH, ~/.local/bin, npm's, mise's, Volta's and Homebrew's folders, and every Node version mise, asdf, nvm and fnm keep. When it isn't there, the Agents page says to install the package with npm i -g, then start a new session. magpie installs nothing."],["local","config.local.json is yours","config.local.json beside it is merged over config.json key by key and wins. When it sets the harness (agent.acp_backend), magpie writes no key, and asks you to set it there to a harness connected to magpie, or take it out and connect again."],["off","Switching back","When you switch Kiro Crew off in magpie, magpie puts back what both keys said before; a key you changed since stays as you set it. When connecting Kiro Crew is what connected its harness agent to magpie, and you haven't disconnected that agent yourself since, magpie disconnects it again. Otherwise it stays connected."],["faq","FAQ","Can Kiro Crew use DeepSeek or GLM? Yes. Kiro Crew's models are its harness's; magpie sets the harness to Codex, Claude Code, OpenCode, Pi or Goose connected to magpie, and the model is picked in that harness. Why didn't my open session change? Sessions already open keep their harness; the new one is for new sessions. magpie says codex-acp isn't found. What now? Codex, Claude Code and Pi run through an npm adapter. Install the package it names with npm i -g, then start a new session. Why didn't magpie change my harness? Your config.local.json sets agent.acp_backend, which wins over config.json, so magpie leaves your setting alone. More agents on the same models: Goose on any model, Pi on any model and JetBrains Copilot on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/kun","Kun",[["","","Kun (KunAgent) is a local-first AI workbench: a desktop app (Code, Work, chats, agents) and a kun TUI, both clients of one runtime, kun serve. Its models come from the runtime's model connections. magpie adds a connection of its own and makes it the default, so Kun runs on any model in magpie: DeepSeek, GLM, Kimi, Qwen, Claude or a ChatGPT subscription, in the desktop app and the TUI alike."],["on","Set up Kun","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Open Kun magpie adds its connection through the running Kun, as below. Pick a model for Kun on the Agents page Pick a model via magpie; it becomes Kun's default. magpie kun deepseek/deepseek-v4-pro"],["api","Through Kun's own API","Kun keeps its connections in model-connections.v2.json in its data folder ($KUN_DATA_DIR, else ~/.kun/data), and a connection's key in its protected credential store, so a connection can't be written into a file by hand. magpie adds and removes its connection as Kun's own Settings › Providers and its kun provider command do, through the runtime's admin API: GET /v1/model-connections the connections, with a revision POST /v1/model-connections/connect magpie's connection PATCH /v1/model-connections/magpie its model list POST /v1/model-connections/select Kun's default model DELETE /v1/model-connections/magpie switching back The address and token come from runtime.json in the data folder. magpie's connection, magpie, is an HTTP one at the gateway's /v1, spoken to as Chat Completions with magpie's own key for Kun. magpie remembers its id, so one you renamed to magpie-2 in Kun is still magpie's."],["models","The model list","The connection's models are the ones you tick for Kun on magpie's Agents page, at most 500. A model picked or dropped there reaches the connection, and so does a gateway on a new port."],["running","Kun has to be running","Kun adds and changes model providers only while it runs. When it isn't running, magpie says to open Kun, then try again."],["off","Switching back","magpie stashes the default Kun had when it first steps in. Switching back picks that default again, then removes magpie's connection. With no provider of your own in Kun to go back to, magpie asks you to add one in Kun's Settings › Providers. magpie kun default"],["faq","FAQ","Can Kun run on DeepSeek, GLM or a ChatGPT subscription? Yes. Open Kun and pick a via-magpie model for Kun on magpie's Agents page. magpie adds a magpie model connection and makes it the default. magpie says open Kun, then try again. Why? Kun takes provider changes only while it runs. Open the Kun desktop app or kun serve, and try again. Does the kun TUI get the models too? Yes. The desktop app and the kun TUI are both clients of kun serve and share its model connections. Does switching back restore my default model? Yes. magpie stashed the default Kun had, picks it again, then removes its connection. More desktop apps on the same models: OpenHanako on any model, DS Bot on any model, Tuanjie Cowork on any model and Alma on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/library","Library",[["","","magpie’s Library keeps instructions, MCP servers, skills, hooks and subagents in one place, and writes each of them into every agent you tick for it, in that agent’s own files and format. The agents read those files as they always do. magpie adds no layer between an agent and what it is given: the agent itself decides when to use a skill, an MCP tool or a subagent. The page has seven tabs: Instructions, MCP servers, Skills, Hooks, Subagents, RTK and billion-context. Each item has a row of agents; tick an agent to give it the item, untick it to take it away. An agent reads the change when it starts again."],["where","Where it is kept","The library is library.json in magpie’s config folder (~/.config/magpie, or $XDG_CONFIG_HOME/magpie when that is set). Instruction texts and skill folders are in library/ next to it. Every change saves the library and writes it into every agent at once. magpie records what it wrote, so it only ever takes away its own entries and leaves yours alone. Backups. Before a change, the files it replaces are copied to backups/ in the same folder. The last 30 are kept. The Backups button at the top of each tab opens them. Write it again. After you install an agent, or edit its files by hand, magpie library sync writes the library into every agent again. magpie library # what the library gives each agent magpie library sync # write it into the agents again"],["instructions","Instructions","Instructions are text every session of an agent starts with, such as house rules or a coding style. magpie writes its part between two marker lines in the agent’s instructions file: …the Library's instructions… Everything outside the markers is yours and is never changed. You can keep several named sets and give each set to different agents, and a set can live in a file of your own. Agent File Claude Code ~/.claude/CLAUDE.md Codex ~/.codex/AGENTS.md (or AGENTS.override.md when you use one) Gemini CLI ~/.gemini/GEMINI.md Antigravity ~/.gemini/config/GEMINI.md OpenCode AGENTS.md in its config folder Copilot CLI ~/.copilot/copilot-instructions.md Goose, Crush, Qwen Code, CodeBuddy .goosehints, CRUSH.md, QWEN.md, CODEBUDDY.md Droid, Grok, dsh, omp AGENTS.md in the agent’s own folder Pi, OmO the first one there of AGENTS.md and CLAUDE.md Folders follow the agent’s own setting: a custom CLAUDE_CONFIG_DIR or CODEX_HOME is used in place of the default."],["mcp","MCP servers","An MCP server is either a command (a program the agent starts, such as npx …) or a URL (HTTP or SSE). magpie writes one entry per server into each ticked agent’s MCP config, in that agent’s format, and keeps any fields you added to the entry yourself. Agent File Claude Code ~/.claude.json Codex ~/.codex/config.toml Gemini CLI ~/.gemini/settings.json Antigravity ~/.gemini/config/mcp_config.json OpenCode opencode.json Cursor ~/.cursor/mcp.json Copilot CLI ~/.copilot/mcp-config.json Zed context_servers in its settings.json Variables. ${NAME} in a header or an env value is written in each agent’s own syntax. An agent that has no such syntax is not given that server, and the page says why. SSE. Codex, Goose, dsh, Grok, Command Code and Zed can’t use an SSE server. Claude Desktop takes no remote servers at all. Single tools off. You can turn off tools one by one for Codex, Gemini CLI, Crush, Hermes Agent, Claude Code and OpenCode, each in its own setting. Every other agent gets the whole server. Sign-in. A server that needs OAuth is signed in to once, in magpie. Agents then reach it through magpie’s gateway at /mcp/. This computer only. Turn off Sync to your other computers for a server that should stay here (magpie library mcp local on). Another command here. For a synced server whose program sits elsewhere on this computer (a Mac and WSL), click Use another command on this computer under its command. Its name, agents and note still sync; your other computers keep running theirs (magpie library mcp here ). With the MCP router on, each agent gets one server named magpie in place of these entries, and magpie runs each command server once for all of them. It is off by default."],["skills","Skills","A skill is a folder with a SKILL.md in it. The agent reads each skill’s name and description and loads the rest when a task needs it. Add one from GitHub, any git repository, a folder on this computer, or the market on the Skills tab. Agent Folder Claude Code ~/.claude/skills Codex ~/.codex/skills Gemini CLI ~/.gemini/skills OpenCode skills in its config folder Cursor ~/.cursor/skills Copilot CLI ~/.copilot/skills Goose ~/.agents/skills Links or copies Give skills as sets how a skill reaches an agent, for every agent or, under By agent, for one: Links (the default). The agent’s folder links to the library’s copy, so an update reaches every agent at once. On Windows without the right to make links, a junction is used. Copies. Each agent gets a folder of its own, for tools that don’t follow links. A copy is made again when the library’s skill changes. If the agent, or you, edit a copy, the next sync takes the newest edit into the library and gives it to the other agents. An edit that loses to a newer one is kept with the backups. A skill folder of your own with the same name is never written over: the page asks whether to use the library’s or keep yours. Editing and updates Edit opens a skill’s files on the page; Save (or ⌘S) writes them. The command line has no editor. Updates. When you open the Skills tab, skills from GitHub are checked for updates if 12 hours have passed since the last check (magpie library skill update checks now). A skill you changed is never replaced without asking. Put skills in. Skills go to each ticked agent’s own folder (the default), or also into ~/.agents/skills, which Codex, Gemini CLI, OpenCode, Crush, Droid, Kimi Code and other tools read. Off here. A skill can be turned off on this computer only; a sync from another computer doesn’t turn it back on."],["subagents","Subagents","A subagent is a helper the main agent can hand a task to. It has a name, a description and a prompt. magpie writes it as a file in each ticked agent’s subagent folder. The main agent reads every subagent’s description and decides itself when to call one, so the description should say plainly what it is for and when to use it. Name: 2 to 50 lowercase letters, digits and -. A few names are reserved, such as default and main. Description: required, up to 1,000 characters. Prompt: required. It becomes the subagent’s instructions. Model: optional. See Subagent models. Agent File Skills, MCP servers Claude Code ~/.claude/agents/.md the ones you pick Codex ~/.codex/agents/.toml all the agent has OpenCode agents/.md in its config folder all the agent has Gemini CLI ~/.gemini/agents/.md all the agent has Qwen Code agents/.md in its folder all the agent has Droid ~/.factory/droids/.md MCP servers you pick; all skills Grok agents/.md in its folder all the agent has Cursor ~/.cursor/agents/.md all the agent has Copilot CLI ~/.copilot/agents/.agent.md all the agent has Only Claude Code limits a subagent to the skills you pick, and only Claude Code and Droid to the MCP servers you pick. Elsewhere a subagent has everything its agent has. Cursor: only the Cursor app reads ~/.cursor/agents. cursor-agent reads only a project’s .cursor/agents. Kimi Code, Goose, Crush, Qoder, CodeBuddy, iFlow and Kiro have no user-wide subagent folder, so they get none. Agents in WSL get none either. If you edit a file magpie wrote, it becomes yours and magpie stops changing it. A file of your own with the same name is never written over; the page shows a problem instead."],["models","Subagent models","A subagent’s Model field is written only for Codex. Every other agent runs its subagents on the model it picks itself, and the page says so. Left empty, the field reads Picked by the agent. For Codex, the model goes into the subagent’s .toml file. Codex lays that file over the spawn, so requests carry that model and magpie’s gateway routes them like any other request. You can pick any model in Codex’s list, a magpie provider/model, or a routing group (group/). Codex’s subagent model on the Agents page Codex’s row on the Agents page has a subagent model of its own, for every subagent Codex starts: Lead’s pick (the default). The main agent picks each subagent’s model, one of Codex’s own too. A subagent it names no model for runs on the main agent’s model. A resumed subagent stays on the model it started on. Same as the lead. Every subagent runs on the main agent’s model. A model or a group. Every subagent runs on it, even when the main agent names another. The Agents page wins. When that setting is anything but Lead’s pick, the gateway sends every Codex subagent request to it, over a Library subagent’s own model too. The Library editor then says so. Picking a model there also removes default_subagent_model from Codex’s config. Codex’s own [agents] default_subagent_model in config.toml is a different thing: only the model a subagent starts on when the main agent names none. One exception to all of the above: a task the ChatGPT backend has sealed stays on the model it asked for, unless the setting is a ChatGPT account’s model. Claude Code has its own order: the model the main agent names in its call, then the subagent file’s model:, then CLAUDE_CODE_SUBAGENT_MODEL (which Claude Code’s row on the Agents page can set), then the session’s model."],["hooks","Hooks","A hook is a command an agent runs at a point in its turn: a notification when it finishes, a formatter after it edits a file. Pick a portable event (turn end, after a tool, before a tool, on a prompt, at session start) and magpie writes it under each agent’s own name for that event. Only Claude Code, Codex, Gemini CLI, Cursor, Grok Build and Grok App take hooks. A hook entry you change becomes yours."],["rtk","RTK","The RTK tab turns on RTK per agent: the agent’s shell commands run through RTK, which shortens their output to save tokens. magpie can install RTK for you; turning it off works with RTK gone."],["billion-context","billion-context","The billion-context tab turns on billion-context’s plugin per agent: it folds older turns of a long session into summaries the model can open again, so the session stays inside the model’s window. It is offered for Pi, omp, OpenCode, Claude Code, Hermes, DeepSeek Harness and Zed, whose requests still go through magpie with it on. magpie can install it for you (npm install -g billion-context --prefix=~/.local) and runs its own installer and remover; turning it off puts back what the install changed in the agent’s settings. An agent turned on here can’t also run billion-context-pi or opencode-acp. For Claude Code, billion-context’s install turns Claude Code’s own auto-compaction off. magpie turns it back on, so a session billion-context doesn’t fold, such as one in the Claude desktop app’s Code tab, compacts instead of stopping at “Prompt is too long”. A DISABLE_AUTO_COMPACT you set yourself is left as it is. Zed has no billion-context plugin, and Hermes’ and DeepSeek Harness’ plugins only catch HTTPS traffic, which magpie’s local address isn’t. Turned on, magpie runs bili start and points the agent’s magpie provider at http://127.0.0.1:8787/bili/ followed by magpie’s address, the route billion-context documents for any client; for Hermes and DeepSeek Harness, in every profile that has magpie’s provider. Pick one of magpie’s models for the agent on the Agents page first, and restart it after turning it on or off. The card shows how many tokens billion-context saved, in its own count: the net savings its dashboard shows, after the rebuilds a fold causes and the summaries’ cost, with how many folds and sessions, over every session it ran on this computer. magpie asks a running billion-context for it (/__bili/overview); when none runs, the card shows the last count it read and when. It shows nothing until billion-context has run for an agent."],["touch","What magpie touches","Only what it wrote: the text between its markers, entries it recorded, files it marked as its own. Never a file, entry or skill of yours with the same name. The page shows the clash and lets you choose. Anything it replaces goes to the backups first. Projects can get skills and MCP servers too, in the project’s own folders (such as .claude/skills, .agents/skills, .mcp.json or .codex/config.toml). From a terminal, magpie library project add . adds the folder you are in, magpie library project skill add . pdf docx gives it skills, magpie library project skill rm . pdf takes one away, and magpie library project skills . lists them. A project can have instructions of its own as well, so your shared instructions keep only what holds everywhere. On the Instructions page, open a project under the shared text and write what only it needs. magpie puts it between its two marker lines in the file each agent reads in that project: CLAUDE.md for Claude Code, AGENTS.md for Codex, Cursor and most others, GEMINI.md for Gemini CLI. The rest of the file stays yours. A file magpie makes is kept out of git, and turning an agent off takes its part out again. From a terminal: magpie library project instructions . text \"Use pnpm here.\", and … agents claude,codex or … agents none."]]],["/docs/local-models","Local models",[["","","Claude Code speaks Anthropic Messages and Codex speaks OpenAI Responses. A local model server speaks OpenAI Chat Completions, and some speak Anthropic Messages too. magpie sits between them on your computer, so Claude Code and Codex can run on the models you pulled in Ollama or loaded in LM Studio. The gateway runs at 127.0.0.1:3425. magpie points the agent at it and sends each request on to your server. When the server speaks the agent’s API itself, the request is passed on as it is. When it doesn’t, magpie translates the request and the reply, streaming and tool calls included. Ollama, LM Studio Presets with their default ports and no key. magpie asks the server which models it has. oMLX, MLX-Serve MLX servers for Apple silicon, also presets. Anything else vLLM, llama.cpp’s server or any OpenAI-compatible URL, on this computer or another."],["servers","Supported servers","These are under On this machine when you add a provider: Server Default address APIs magpie uses Ollama http://localhost:11434 Chat Completions, Anthropic Messages LM Studio http://localhost:1234 Chat Completions oMLX http://localhost:8000 Chat Completions, Responses, Anthropic Messages MLX-Serve http://localhost:11234 Chat Completions, Responses, Anthropic Messages So Claude Code on Ollama, oMLX or MLX-Serve sends its requests to the server as they are, and on LM Studio magpie translates them. Codex on oMLX or MLX-Serve goes as it is, and on Ollama or LM Studio magpie turns its Responses requests into Chat Completions."],["setup","Set it up","Start the server Pull or load a model in Ollama or LM Studio and leave the server running. Add it in magpie In the Providers tab, press + Add provider and pick Ollama or LM Studio under On this machine. No key is needed. magpie asks the server which models it has, and they show as ollama/… or lmstudio/…. Pick the model for the agent In the Agents tab, click the model on the Claude Code or Codex row and choose the local one. magpie writes Claude Code’s settings.json or Codex’s config.toml. Start a new session to use it. The same from a terminal: ollama pull qwen3 magpie provider add ollama magpie models # every model, as provider/model magpie claude ollama/qwen3 # Claude Code magpie codex ollama/qwen3 # Codex Inside the agent, Claude Code’s and Codex’s /model list magpie’s models too, so you can move between a local model and a cloud one there. What changes in each agent’s config is in Models in Claude Code and Models in Codex."],["address","Another port or another computer","If the server listens on another port, or runs on another computer such as a GPU box or a NAS, change Server address in the provider’s editor. Each of its URLs moves there and keeps its path. magpie provider add lmstudio address=http://192.168.1.5:1234 magpie provider set ollama address=192.168.1.20:11434 magpie provider set ollama address= # back to the default A server behind HTTPS with a self-signed certificate can be reached with Don't check its certificate in the editor; it applies to that provider’s own hosts only."],["custom","vLLM, llama.cpp and other servers","A server with no preset is added as Custom: paste its URL, such as http://localhost:8080/v1, and press Detect APIs. magpie sends the smallest request to Chat Completions, Responses, Anthropic Messages and Gemini at that URL and keeps the ones that answer. The key can be left empty for a server that needs none."],["window","Context window","Agents plan around how long a request the model takes. Claude Code takes a model it doesn’t know for 200K, and Codex compacts a conversation at 90% of the window it is told. A local model is often loaded with a much smaller window, so tell magpie the real one: Context window under Advanced in the provider’s editor, for every model or one of them. magpie passes it on to the agents. magpie provider set ollama context=32k magpie provider set ollama context.qwen3=128k"],["masking","Masking","magpie’s privacy masking replaces keys, tokens and other secrets with placeholders before a request leaves the gateway, a request to a local server too. When the model runs on your own computer or network, you can turn on Send requests unmasked in its editor, or run magpie provider set ollama unmasked=yes. It is your call: Ollama’s cloud models, or a relay you run locally, pass a request on to a vendor whatever the address."],["faq","FAQ","Can Claude Code use Ollama? Yes. Add Ollama in magpie and pick one of its models for Claude Code. magpie writes the gateway’s address into Claude Code’s settings.json, and Ollama’s Anthropic-compatible API takes Claude Code’s requests as they are. Can Codex use Ollama or LM Studio? Yes. Codex speaks only the Responses API, so magpie turns its requests into Chat Completions for Ollama and LM Studio, and the replies back, tool calls included. oMLX and MLX-Serve take Responses themselves. Do I need an API key? No. The local presets take none. A server you secured with a key can have it in the provider’s editor. Can the model run on another computer? Yes. Set the provider’s Server address to that computer, such as http://192.168.1.20:11434. Why does Claude Code fail on long conversations with a local model? It assumes a model it doesn’t know takes 200K. Set the real Context window on the provider in magpie, and Claude Code and Codex compact before they reach it. How do I go back? Pick one of the agent’s own models in magpie, or run magpie claude default or magpie codex default. What magpie wrote comes out, and what it replaced comes back. Looking for cloud models? See Models in Claude Code and Models in Codex. Stuck? Ask on Discord."]]],["/docs/lody","Lody",[["","","Lody is a desktop app that runs coding agents such as Claude Code, Codex, Pi, dsh, Kimi Code, Grok and Bub. It adds a provider through its own import link, in a dialog you confirm. magpie gives it that link, with magpie as one custom provider named Magpie and three endpoints by protocol, covering every runtime it supports. Once confirmed, those agents in Lody run on any model in magpie: DeepSeek, GLM, Kimi, Qwen, an OpenAI or Anthropic key, and the ChatGPT or Copilot subscription you signed in to."],["add","Add magpie to Lody","Open Lody once Once Lody has run, its home folder ~/.lody (~/.lody-oss for its OSS build) or data folder (~/Library/Application Support/Lody on a Mac) is there, and magpie's Agents page lists it. Lody OSS and Lody Nightly count too. Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Click Add magpie On Lody's row, click Add magpie; magpie hands the import link to Lody. Confirm it in Lody Lody shows its local provider dialog, and nothing is added until you confirm. Then pick a model from the Magpie provider for each agent in Lody. magpie lody add # opens Lody to add magpie; confirm it there The row never says it's added: Lody has no public status API, and magpie doesn't guess from a click, files it generates or Lody's private store. Click again whenever you need to."],["link","What the link holds","The link's data is base64url-encoded JSON. Decoded, it is: lody://provider/import?v=1&data= { \"kind\": \"custom\", \"id\": \"magpie\", \"name\": \"Magpie\", \"auth\": {\"method\": \"apiKey\", \"apiKey\": \"…\"}, \"endpoints\": [ {\"protocol\": \"anthropic-messages\", \"baseUrl\": \"http://127.0.0.1:3425\", \"targets\": [\"claude-code\"], \"modelsUrl\": \"http://127.0.0.1:3425/v1/models\"}, {\"protocol\": \"openai-responses\", \"baseUrl\": \"http://127.0.0.1:3425/v1\", \"targets\": [\"codex\"], \"modelsUrl\": \"http://127.0.0.1:3425/v1/models\"}, {\"protocol\": \"openai-chat\", \"baseUrl\": \"http://127.0.0.1:3425/v1\", \"targets\": [\"pi\", \"dsh\", \"kimi-code\", \"grok\", \"bub\"], \"modelsUrl\": \"http://127.0.0.1:3425/v1/models\"} ] } Claude Code speaks Anthropic Messages at the gateway itself; Codex speaks OpenAI Responses; Pi, dsh, Kimi Code, Grok and Bub speak OpenAI Chat, all at the gateway's /v1. Every endpoint lists its models from the gateway's /v1/models."],["local","Loopback addresses only","Lody takes only HTTP on a loopback address (127.0.0.1, localhost or ::1), and only its public attribution token as the key, never a LAN key or a vendor credential. So when the gateway isn't on loopback, say you set magpie's address to a LAN one, magpie doesn't open Lody and says why."],["linux","Lody on Linux","On macOS and Windows, Lody's bundle and installer claim lody:// themselves, and magpie opens the link. On Linux, Lody's AppImage makes itself the default only for its own channel's scheme and leaves lody:// to the desktop database, which nothing builds without update-desktop-database, so xdg-open and browsers turn the link away (“failed to open uri”). So on Linux magpie runs Lody with the link, as its desktop entry (ai.lody.desktop, or the Nightly or OSS one) says; a Lody already running takes the link and the second one quits. With no entry of Lody's, it hands the link to the system."],["usage","Usage and keys","The key in the link is Lody's own, so its requests are counted as Lody's in magpie's usage, apart from other agents."],["faq","FAQ","Can Claude Code in Lody use DeepSeek or GLM? Yes. Once magpie is added to Lody, Claude Code uses any model in magpie, DeepSeek and GLM included, through the Magpie provider's Anthropic endpoint; Codex, Pi, Kimi Code and the rest do the same. Why does magpie say Lody takes only a loopback address? Lody accepts HTTP providers on loopback only. Set magpie's gateway address back to 127.0.0.1 or localhost, then click Add magpie again. On Linux, Add magpie says failed to open uri. That is xdg-open finding no handler for lody://. magpie runs Lody from its desktop entry instead; if that still fails, open Lody once so it writes its entry, then click again. Why doesn't Lody's row say it's added? Lody has no public status API, and magpie doesn't guess. Once you've confirmed, Magpie is in Lody's provider list. More desktop apps on the same models: Cindy on any model, AionUi on any model, Shelley on any model and Empryo on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/longcat","LongCat",[["","","LongCat is Meituan's model platform, serving its own LongCat models at api.longcat.chat. Accounts from longcat.chat and longcat.ai share that host: Chat Completions and Responses under /openai/v1, Anthropic Messages under /anthropic. Add LongCat in magpie, and Claude Code's, Codex's, Gemini CLI's and OpenCode's requests go as they are, with magpie's local gateway on 127.0.0.1:3425 routing them and holding the key."],["add","Add LongCat","Add the provider On Providers, click + Add provider, pick LongCat, paste the key and save. Pick it for a tool On Agents, pick a model such as LongCat-2.0 on a tool's row. Keys are made at longcat.chat/platform/api_keys. magpie claude longcat/LongCat-2.0 magpie codex longcat/LongCat-2.0 magpie opencode longcat/LongCat-2.5-Preview"],["endpoints","Endpoints","API Endpoint Chat Completions https://api.longcat.chat/openai/v1 Responses https://api.longcat.chat/openai/v1 Anthropic Messages https://api.longcat.chat/anthropic /models https://api.longcat.chat/openai/v1/models Both take the key as Authorization: Bearer; with x-api-key alone LongCat answers missing_api_key, and magpie's Anthropic requests carry the key in both x-api-key and a Bearer by default, so they pass. An entry another app has at these endpoints is imported as LongCat."],["models","Models","magpie gives LongCat-2.0 and LongCat-2.5-Preview, then reads LongCat's list from /openai/v1/models and serves that. Model names are case-sensitive; write them as the list does."],["agents","In each agent","Claude Code speaks Anthropic Messages. LongCat has an Anthropic endpoint, so requests go as they are. See Claude Code with other models. Codex speaks only OpenAI Responses. LongCat serves Responses, so Codex's requests go as they are. The models show in Codex's /model. See Codex with other models. Gemini CLI speaks Gemini's API; magpie points it at the local gateway and translates. See Gemini CLI with other models. OpenCode : magpie writes the models into opencode.json. See OpenCode with other models."],["faq","FAQ","How do I use LongCat in Claude Code? Add LongCat in magpie with your longcat.chat platform key, then pick LongCat-2.0 on Claude Code's row, or run magpie claude longcat/LongCat-2.0. Requests go to https://api.longcat.chat/anthropic. Does LongCat work in Codex? Yes. LongCat serves Responses under /openai/v1, so magpie passes Codex's requests through. Run magpie codex longcat/LongCat-2.0. Why does Claude Code get missing_api_key from LongCat directly? LongCat takes the key only as Authorization: Bearer and refuses x-api-key alone. Through magpie, the key goes in both x-api-key and a Bearer by default. Does a longcat.ai account work? Yes. longcat.chat and longcat.ai accounts share api.longcat.chat; add LongCat in magpie for either. The same for other providers: StepFun, Xiaomi MiMo, DeepSeek, GLM Coding Plan, Kimi, DeepSeek, Qwen. Hit an error? See troubleshooting, or ask on Discord."]]],["/docs/masking","Privacy masking",[["","","magpie can mask what your agents send before it leaves this computer. API keys, passwords and tokens, and when you ask, emails, phone numbers and words of your own, go to the vendor as placeholders such as {{API_KEY_es6eu6jk}}. In the reply each placeholder turns back into its value, so your agent and your files keep the real thing and the vendor never sees it. It runs on this computer, in magpie’s gateway, and is off by default. It covers what goes through magpie. An agent connected to magpie sends its requests through the gateway, and they are masked whichever provider or account answers. An agent that calls a vendor directly, not through magpie, is not covered."],["on","Turn it on","Open the page Go to Settings → Privacy. Mask secrets Under What to mask, set Mask secrets to On: API keys, private keys, tokens and passwords. Personal data, if you want it Set Mask personal data to On for emails, phone numbers, ID and bank card numbers. Each further kind of personal data then gets its own switch below it. Your own words In Masked words, list names, codenames or hosts to keep from vendors, one on each row (several pasted with commas between become a row each). Masked words in any case makes Nightjar mask NIGHTJAR too. A secret magpie doesn’t know, such as your gateway’s own keys, goes under Masking rules: what it starts with, or a regular expression. Try it Paste a text into Try it to see exactly what the vendor would get. What you paste there isn’t kept. It applies from the next request, with no restart and nothing to change in your agent. The work is done by the built-in plugin Privacy masking (redact, in Settings → Plugins), which is on whenever any masking is asked for. There is no CLI command for it. Without the window (magpie serve, Docker), open the same page with magpie web, or set it in ~/.config/magpie/settings.json (/config/magpie/settings.json in Docker). The masker reads the file on every request: { \"redact\": true, \"redactPersonal\": true, \"redactWords\": [\"Nightjar\", \"db.acme-corp.cn\"] }"],["what","What is masked","Switch What it finds Mask secrets Private key blocks (-----BEGIN … PRIVATE KEY-----). API keys by their shape: sk-… (OpenAI, Anthropic, OpenRouter), ghp_/github_pat_, glpat-, AIza…, xox…-, sk_live_, AKIA/ASIA, hf_, gsk_, xai-, npm_, pypi-, dop_v1_, SG., Cloudflare's (cfut_, cfat_, cfk_, cfoat_, Origin CA v1.0-, tunnel tokens), and relay keys like oc_sk_…. JWTs. The password in user:password@host. The value of a field named for a secret, as .env files and configs have them: DB_PASSWORD=…, api_key: …, client_secret, token, credential. Your own Masking rules. Wallet private keys by the shape their wallets export: a Bitcoin WIF, a BIP32 xprv, an Ethereum or TRON 0x key, a Solana key or id.json keypair, a Sui suiprivkey1…, an Aptos ed25519-priv-0x…, a Stellar seed, a NEAR ed25519:… key, a Nostr nsec1…, an age identity, a Zcash extended spending key, and a 12 to 25 word seed phrase after seed or mnemonic whose every word is in the BIP39 list. A key with no prefix of its own is masked only when it checks out: a WIF or xprv by its checksum, a Solana key by its public half, a Stellar seed by its CRC, so a Solana transaction signature goes as written. A 0x key has the shape of a transaction hash, so it is masked only after a key’s name (PRIVATE_KEY=, --private-key, new Wallet(…), 私钥); a hash, a storage slot or a sha256 sum goes as written. An exchange’s API key, secret and passphrase go by their fields’ names. Mask personal data Emails, mainland China mobile numbers (not an 11-digit id: one under order_id or after 订单号 goes as written), Chinese ID numbers and bank card numbers whose checksum adds up. Also on by default: US Social Security numbers, passport numbers (after passport, 护照 or パスポート), IBANs, birthdays (next to birthday, DOB or 生日, and over a year ago, so today’s date stays), MAC addresses and serial numbers (after S/N). Off until you turn them on, since agents send them in nearly every request: the user name in home folders (sent as a made-up name, the same every turn, so the model reads a real folder rather than a placeholder), user and computer names (user@host), public IP addresses (sent as a name such as public-ip-kvxqmrtz, so the model still knows the address is public and connects with it, and the real address goes back into its commands) and cloud storage buckets. A wallet or contract address (0x and 40 hex digits) is public and goes as written; a private key is still masked. Masked words Each word you listed, exactly, as {{TERM_…}}. A date, such as 1990-05-12, matches that day however it is written: 1990/5/12, 1990.05.12, 1990年5月12日, 19900512, May 12, 1990, and 13/05/1990 style only where the day can’t be read as a month. Never another date or a version like 1990.5.12.1. Find with a local model Under How it’s found. A model on this computer finds what no rule can: a name or an address in free text. It is on unless you turned it off, and AstrLink Guard downloads with the first masked request; until it is on disk, the rules mask alone. It needs Mask secrets or Mask personal data on, and finds under the same switches. The menu beside it picks the model: AstrLink Guard (Chinese and English, a 39 MB download, few false alarms in code, on a Mac it runs on the Neural Engine; the default) or OpenAI’s Privacy Filter (1.6 GB, uses the GPU, masks more ordinary values in code). Confidence threshold under it is how sure the model must be before a value is masked: Privacy Filter’s default is 0.5, AstrLink Guard’s 0.8, its publisher’s. Higher masks fewer ordinary values, and lets more real names and addresses through: the rules after the model drop most false alarms already, so the default is where we measured the fewest real values lost. A placeholder is the kind plus eight characters of a keyed hash. The same value gets the same placeholder every time, so the conversation reads the same turn after turn and the vendor’s prompt cache stays valid. The values are held in memory only."],["example","An example","With Mask secrets and Mask personal data on and Nightjar in Masked words, your agent sends: Deploy Nightjar with OPENAI_API_KEY=sk-proj-8fK2mQx7Lp4Rt9Vw3Yz6Ab1Cd, then mail li.wei@acme-corp.cn or call 13800138000. Deploy {{TERM_5hmsrhdc}} with OPENAI_API_KEY={{API_KEY_srhjgvja}}, then mail {{EMAIL_eh5um6mb}} or call {{PHONE_uf7iy2qq}}. When the model answers “I set OPENAI_API_KEY to {{API_KEY_srhjgvja}} in .env”, your agent reads the real key there, in streamed text and tool-call arguments alike, so the file it writes has the real key. A placeholder the model rewrote a little (spaces inside the braces, another case) is still turned back."],["check","Check that it works","Before: Try it on Settings → Privacy shows the text as the vendor would get it, with each value’s kind. Each request: a shield badge with a count appears on the request in the Gateway page’s recent calls and in the Routing log. Point at it for the kinds; click it to open the request’s record. Over time: Insights → Masking (also What was masked on the Privacy page) shows the values masked over 7 or 30 days by kind, agent and provider, and each request’s text as the vendor saw it, placeholders marked. The records are kept in ~/.config/magpie/masking for 30 days: the agent, provider, model, and each placeholder’s kind, length and first characters, never the value."],["found","When a value is found","Under When a value is found, choose per kind: Mask (the default): sent as a placeholder. Warn: sent as written, and the badge counts it in amber. Block: the request is held back with a 400, “magpie held this request back: Settings › Privacy blocks API_KEY, and it has one (sk-…, 33 characters). Nothing was sent.” The message never has the value. A value the task needs as it is, such as a team address or a test key, goes in Never mask: it is sent as written wherever it is found whole."],["limits","What it leaves alone, and limits","Thinking stays as the vendor wrote it. A thinking block with its signature, Gemini’s thoughts and Responses’ encrypted reasoning are sealed by the vendor and go back unchanged, so the signature still matches. Only values already masked elsewhere in the request are swapped in them. Ids and tool definitions go as written: model ids, message and call ids, UUIDs, tool names, MCP server names, and tool schemas (their descriptions are masked), so a vendor or a tool can still check them. Images and file data are sent as they are. Text inside a screenshot is not masked. It fails closed. If masking is on and can’t run (the Privacy masking plugin turned off by hand, or the local model you turned on can’t answer), the request gets a 503 that says nothing was sent. It is never sent unmasked instead. The model on by default that can’t answer leaves the rules to mask alone. A provider can skip it. Send requests unmasked on a provider sends its requests as written: a model on this computer or your local network (Ollama, LM Studio), and, if you choose, any other provider, a subscription or a plugin’s provider too. Turned on for one that isn’t local, the editor says its vendor gets your requests unmasked. A request that can fall back to a provider still masked is masked. magpie provider set ollama unmasked=yes does the same. Or send what masking would change to one of them. In Settings › Privacy, Instead of masking, send to picks such a model. An agent’s request that masking would change then goes to it as written, so it can answer about the real names, and a request with nothing to mask goes where it was going. If that model fails, the request fails: it is never masked and sent to a vendor instead. Off by default. The model sees placeholders. It can’t read or reason about a masked value; it can only pass it on. Put a value it must read under Never mask. Rules find shapes. A phone number in another country’s format or a name in free text needs Find with a local model, or your own Masked words and Masking rules. Try your own text in Try it first. See also Privacy for everything magpie sends by itself. The code is internal/redact and internal/masking."]]],["/docs/mcp-router","MCP router",[["","","The MCP servers you add in magpie’s Library are normally written into each agent’s own config, one entry per server. With the MCP router on, each agent is given a single server named magpie instead, and magpie passes each call on to the Library server behind it. It is off by default. Set up once. A server written once in the Library reaches every agent and app through one entry. Run once. A command server (one started as a program, such as npx …) runs once in magpie, not once in each agent. A server with no calls for 10 minutes is stopped and starts again on the next call. One address for other apps. Cursor, VS Code, Windsurf or an app on another computer can connect to magpie and use every Library server. Tools appear in the agent as server__tool. Only tools are served (no resources or prompts), and a tool you turned off in the Library is neither listed nor run."],["on","Turn it on","Open the page Go to Library → MCP. Switch it on Below the server list, turn on MCP router. Each agent that has Library servers ticked and can reach a server over HTTP (Streamable HTTP) gets one magpie entry at /mcp/magpie/hub/ on magpie’s gateway, and those servers’ own entries are taken out of its config. Restart your agents An agent reads the change when it starts again. Turning it off writes each server’s own entry back, removes only the magpie entry magpie wrote, and stops every server the router started. From the command line: magpie library mcp router on magpie library mcp router off magpie library lists which agents are given the router and which keep their own entries, with why."],["apps","Other apps","With the router on, the Other apps row shows an address ending in /mcp/magpie/hub, which serves every server in the Library. Connect… opens a sheet with a ready entry to copy for Cursor, VS Code, Windsurf or any app that takes a JSON MCP config; in the app window, Cursor and VS Code also have Add, which opens the app to confirm. An app on another computer needs a gateway key, as every request from your network does (see Remote magpie). Command servers run on this computer. Anyone holding a gateway key on your network can call them through the router, with your rights here. Only share keys with people you trust."],["kept","Agents that keep their own entries","These agents keep each server’s own entry, and the Library page says which and why: No remote servers. The agent can’t reach an MCP server over HTTP, such as Claude Desktop. A server named magpie. One of your Library servers is itself called magpie, so the names would clash. Its own magpie entry. The agent already has an entry called magpie that magpie didn’t write; it is left as it is."],["when","When to use it","Turn it on when you use several agents with the same servers, when command servers start many copies of themselves, or when you want editors and other computers to use your Library. Leave it off if you use one agent, if you want each agent to talk to its servers directly, or if you’d rather nothing else on your network can reach your command servers. Every call goes through magpie, so magpie needs to be running."]]],["/docs/minimax","MiniMax and the MiniMax Coding Plan in Claude Code, Codex, Gemini CLI and OpenCode",[["","","MiniMax serves an OpenAI-compatible Chat API and an Anthropic-compatible one, on a global site and a China site, for pay-as-you-go keys and Coding Plan keys alike. Add your key to magpie once, and Claude Code, Codex, Gemini CLI, OpenCode and every other agent you connect can use models such as MiniMax-M3 and MiniMax-M2.7 through magpie’s gateway at 127.0.0.1:3425."],["add","Add MiniMax","Get a key Create one at platform.minimax.io, or platform.minimaxi.com for the China site. A Coding Plan key starts with sk-cp-. Add the provider In magpie’s Providers tab, press + Add provider, pick MiniMax or MiniMax (China), paste the key and save. A pay-as-you-go key and a Coding Plan key go in the same way. Pick it for an agent In the Agents tab, click the model on the agent’s row and choose a MiniMax model. magpie provider add minimax sk-… # platform.minimax.io magpie provider add minimax-cn sk-cp-… # Coding Plan, platform.minimaxi.com"],["endpoints","Plans and endpoints","Preset Site Chat Completions Anthropic Messages MiniMax minimax platform.minimax.io https://api.minimax.io/v1 https://api.minimax.io/anthropic MiniMax (China) minimax-cn platform.minimaxi.com https://api.minimaxi.com/v1 https://api.minimaxi.com/anthropic The Coding Plan uses the same endpoints as pay as you go; the key decides which one a request is billed to. A global key and a China key are different accounts, so each goes under its own site’s preset."],["agents","In each agent","Pick the model on an agent’s row in the Agents tab, or from a terminal. Each guide says what magpie writes in that agent’s config and how to switch back. magpie claude minimax/MiniMax-M3 magpie codex minimax/MiniMax-M3 magpie gemini model minimax/MiniMax-M2.7 magpie opencode minimax/MiniMax-M3 Claude Code speaks Anthropic Messages, and so does MiniMax’s Anthropic endpoint, so its requests are passed on as they are. Every tier (opus, sonnet, haiku) runs on the model you pick unless you give one its own. Models in Claude Code. Codex speaks only OpenAI Responses. MiniMax serves Chat Completions and Anthropic Messages but not Responses, so magpie translates each request and the reply, streaming and tool calls included. The model shows in Codex’s /model with its reasoning efforts. Models in Codex. Gemini CLI speaks Gemini’s API. magpie points it at its gateway and translates. Models in Gemini CLI. OpenCode gets the model in opencode.json, with its reasoning variants and cost. Models in OpenCode. MiniMax Code is one of the agents magpie connects too: its row takes MiniMax’s models or any other vendor’s."],["thinking","Thinking and effort","Interleaved thinking. MiniMax’s Chat API gives a model’s thinking in the reply text, between tags, and wants it back there on later turns. magpie hands it to the agent as thinking and puts it back where MiniMax expects it. Effort. MiniMax-M3.1-Flash and its preview think at levels from low to max. magpie sends the level an agent asks for in output_config.effort, as MiniMax Code does, so it isn’t lost to a token budget. Models that always think. MiniMax-M3.1-Flash-Preview refuses to have thinking turned off. When an agent asks for it off, magpie asks again with thinking left on, so the agent gets an answer rather than the error."],["usage","Coding Plan windows and usage","Coding Plan windows. A Coding Plan key’s row shows what is left of each window MiniMax reports, a rolling one and a weekly one, read from MiniMax. Models draw on the general bucket; a bucket metered apart, such as video, shows as a count, like 4 / 5. A pay-as-you-go key has no windows and no card. Routing. With several Coding Plan keys, magpie weighs them by their windows and rests one that has used a window up until it resets. Usage. The Usage tab counts tokens, cache hits and cost for each agent and model that went through magpie."],["faq","FAQ","How do I use MiniMax M2.7 or M3 in Claude Code? Add your MiniMax key in magpie (Providers, Add provider, MiniMax or MiniMax (China)), then pick a model such as MiniMax-M3 on Claude Code’s row, or run magpie claude minimax/MiniMax-M3. magpie writes Claude Code’s settings.json and passes its requests to MiniMax’s Anthropic endpoint, https://api.minimax.io/anthropic. How do I use the MiniMax Coding Plan? Add the Coding Plan key (sk-cp-…) to the MiniMax preset of the site you bought it on, the same as a pay-as-you-go key. magpie tells the two apart by what MiniMax says about the key, and shows a Coding Plan key’s usage windows on its row. Can Codex use MiniMax? Yes. MiniMax serves Chat Completions and Anthropic Messages but not Responses, so magpie translates Codex’s requests and MiniMax’s replies. Pick the model on Codex’s row or run magpie codex minimax/MiniMax-M3; it shows in Codex’s /model list. Can MiniMax Code use other models? Yes. MiniMax Code is one of the agents magpie connects, so its row in the Agents tab takes any model you have added, MiniMax’s or another vendor’s. Why does MiniMax’s thinking show up in the text? MiniMax’s Chat API puts a model’s thinking in the reply text between tags. magpie takes it out and gives it to the agent as thinking, then puts it back on the next turns, where MiniMax wants it. Can I use several MiniMax keys? Yes. Add them all to the MiniMax provider and tick each one. magpie spreads requests over them, and weighs and rests Coding Plan keys by their windows, so a key that has used up its window sits out until it resets. Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. Ask on Discord if you get stuck."]]],["/docs/miniq","miniQ",[["","","miniQ is a desktop AI coworker with a miniq terminal client, both clients of one miniq-daemon. Its models come from one OpenAI- or Anthropic-compatible endpoint, the provider in settings.json. magpie makes that provider the local gateway, so miniQ runs on any model in magpie: DeepSeek, GLM, Kimi, Qwen, GPT or a ChatGPT subscription."],["on","Set up miniQ","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Pick a model for miniQ on the Agents page miniQ's row lists your current miniQ model and the models via magpie. Pick one of the latter. Keep working A running daemon is told the new provider, and open chats move onto the new model, with no restart. magpie miniq deepseek/deepseek-v4-pro On Windows, miniQ in a WSL distro is found too and set up the same way."],["where","Where settings.json is","settings.json sits in the daemon's data folder, found as miniQ finds it. MINIQ_DATA_DIR comes first. Next is the folder named by miniq-data-dir.json beside the default, which exists when you moved the data folder in miniQ's Settings. Otherwise it is the default. macOS uses ~/.local/share/miniq too. macOS / Linux: ~/.local/share/miniq/settings.json Windows: %LOCALAPPDATA%\\miniq\\settings.json MINIQ_DATA_DIR set: $MINIQ_DATA_DIR/settings.json"],["files","What gets written","{ \"provider\": { \"baseUrl\": \"http://127.0.0.1:3425/v1\", \"apiKey\": \"\", \"model\": \"deepseek/deepseek-v4-pro\", \"apiProtocol\": \"chat_completions\" } } baseUrl is the gateway's /v1. apiKey is magpie's own key for miniQ: miniQ sends no User-Agent of its own, so the key is how magpie knows the request is miniQ's. model is the model's catalog id. apiProtocol is chat_completions, because auto would guess Responses or Anthropic Messages from a model's name. magpie changes only provider. It stashes your own provider whole. The rest of settings.json stays as it is: MCP servers, approvals, hooks and remote access. Where there is no file, magpie makes one with 0600 permissions, as miniQ does."],["daemon","A running daemon","The daemon reads settings.json once, when it starts, and writes its own copy back on every settings change. So after writing the file, magpie also calls settings.update over the local WebSocket that daemon.json names, as miniQ's own Settings does. A daemon magpie can't reach keeps the old provider until it restarts. magpie then asks you to restart miniQ."],["off","Switching back","Switching back puts your own provider back whole and tells the daemon. If you had no provider, magpie removes its own, and miniQ goes back to its default. If magpie made settings.json and nothing is left in it, the file goes too. You can also pick your own miniQ model in magpie; it goes into your restored provider. magpie miniq default"],["faq","FAQ","How do I use DeepSeek, GLM or a ChatGPT subscription in miniQ? Pick a via-magpie model for miniQ on magpie's Agents page. magpie sets settings.json's provider to the local gateway's /v1 and tells the running miniq-daemon. Do I need to restart miniQ? Usually not. magpie tells a running daemon through settings.update, and open chats move onto the new model. Only a daemon magpie can't reach needs a restart, and magpie says so. Why chat_completions and not auto? auto guesses the protocol from a model's name and could pick Responses or Anthropic Messages. The gateway's /v1 speaks Chat Completions, so magpie names it. Are my MCP servers and other settings changed? No. magpie changes only settings.json's provider, and switching back restores the one you had. More agents on the same models: Empryo on any model, Lody on any model, Cindy on any model and OpenBot on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/mirrors","Mirrors",[["","","From China, npm and GitHub are often slow or unreachable when installing plugins. magpie can have those downloads asked of a mirror in China first; the mirror's file is the very same, checked the same way."],["plugins","The Plugins page's Mirrors in China","Open the Plugins page. Turn on Mirrors in China. The page's downloads then ask a mirror in China first and the official address after. npm (plugin packages, versions and search): registry.npmmirror.com. Bun: npmmirror's binary mirror. The plugin list: jsDelivr (cdn.jsdelivr.net/gh/magpie-community/plugins). What the mirror hasn't copied yet is asked of the official address. npm's weekly download counts stay npmjs's own. bun add is pointed at npmmirror too, unless BUN_CONFIG_REGISTRY or NPM_CONFIG_REGISTRY names a registry already. The switch never sends anything through a proxy such as gh-proxy."],["update","Installs and updates through a mirror or proxy","Both the installer and magpie update take --proxy (http, https, socks5, socks5h; or MAGPIE_PROXY, HTTPS_PROXY, ALL_PROXY) and --mirror, a GitHub download mirror put before the release's github.com URL (or MAGPIE_MIRROR). curl -fsSL https://usemagpie.ai/install.sh | sh -s -- --proxy http://127.0.0.1:7890 magpie update --mirror https://mirror.example/ magpie update mirror https://mirror.example/ # every update, the app's too magpie update mirror off In the app, Settings' Download source row has Use a mirror… for a Mirror address, and Remove mirror to go back. No mirror is used unless you give one. On a network that lets GitHub through and not usemagpie.ai, nothing needs setting: the update comes from GitHub, its signature checked."],["settings","Download source and Update source in Settings","Two rows in the app's Settings decide where an update comes from. Neither needs changing on a network that reaches usemagpie.ai. Setting Choice What the update is downloaded from About › Download source usemagpie.ai (the default) usemagpie.ai, and github.com when that fails. Use a mirror… usemagpie.ai, and the mirror when that fails, in place of github.com. Remove mirror goes back. About › Update source Automatic (the default) usemagpie.ai's release list and files, and GitHub's when the site can't be reached. usemagpie.ai only usemagpie.ai alone, never GitHub, so a mirror is never used. GitHub only github.com alone (through the mirror when one is set), never usemagpie.ai. What a mirror's address is A mirror here is a GitHub download proxy: a site that fetches any github.com link put after its own address, as in https://mirror.example/https://github.com/yetone/magpie-releases/releases/download/…. Type only the part before https://github.com, a full https:// address such as https://mirror.example/. Public GitHub download proxies work this way; gh-proxy.com, the one MAGPIE_MIRRORS falls back to, is one of them. magpie names no mirror of its own and vouches for none: whichever you use, the file is checked against usemagpie.ai's checksum and the release's signature, and one that doesn't match is not installed. When to use one An update stalls or fails with a timeout or EOF, and both usemagpie.ai and github.com are slow or blocked where you are (often in mainland China): set a mirror. usemagpie.ai is slow and GitHub is fast: pick GitHub only, no mirror needed. You have a proxy: put it in Network and sharing › App updates instead; a mirror is for when you have none. A download that failed through the mirror says so, and offers to download from GitHub instead, which removes the mirror."],["fallback","MAGPIE_MIRRORS: a mirror after a failure","Another way is off by default. With MAGPIE_MIRRORS=on, the official source is tried first, and a mirror only after a network error, HTTP 429, HTTP 5xx or GitHub's rate-limit 403. The defaults are registry.npmmirror.com for npm and gh-proxy.com for GitHub; MAGPIE_NPM_REGISTRY and MAGPIE_GITHUB_MIRROR replace them: MAGPIE_MIRRORS=on \\ MAGPIE_NPM_REGISTRY=https://registry.example.com \\ MAGPIE_GITHUB_MIRROR=https://gh.example magpie serve The official source and the mirror share one request budget, so a hanging official source doesn't make the wait twice as long."],["safe","Is a mirror safe","magpie's own update files are checked against a SHA-256 from usemagpie.ai, never from the mirror; a file that doesn't match is not installed. Bun's zip is checked against Bun's SHA-256s, and a plugin package against the integrity npm gave. Requests that carry credentials (Authorization, a cookie, an API key, a token in the URL) never use a mirror; they go to the official source alone. Skill tarballs always use the official source. npm metadata, plugin READMEs and search results and version checks are not checksummed; a mirror can report a different version."],["faq","FAQ","Plugins install slowly in magpie. What helps? Turn on Mirrors in China on the Plugins page. The plugin list comes from jsDelivr, npm packages and Bun from npmmirror, and the official address after. A magpie update fails to download. What do I do? Run magpie update --mirror , or magpie update mirror to keep it for every update; --proxy goes through a proxy. The checksum always comes from usemagpie.ai. Can a mirror see my API keys? No. Requests carrying Authorization, a cookie, an API key or a URL token never use a mirror; they go to the official source alone. How is MAGPIE_MIRRORS different from the Mirrors in China switch? The switch has the Plugins page ask a mirror in China first. MAGPIE_MIRRORS=on asks the official source first and a mirror only after a network error, 429, 5xx or GitHub's rate limit. Related: Get started, Fixing common errors: 401, 429, 502, 504 and more. Questions go to Discord."]]],["/docs/mister-morph","Mister Morph",[["","","Mister Morph (the morph command) keeps its settings in ~/.morph/config.yaml, or the file MISTER_MORPH_CONFIG names: the main model under llm.model, asked of the vendor llm.inference_provider names at llm.endpoint with llm.api_key. It has no list of providers to add one to, so magpie takes those llm keys over, and Mister Morph runs on any model in magpie: DeepSeek, GLM, Kimi, Qwen, Claude or a ChatGPT subscription."],["on","Set up Mister Morph","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Pick a model for Mister Morph on the Agents page Pick one via magpie, and an effort if you want. magpie finds it by its ~/.morph folder, not the morph command, which other tools are named too; the folder is made by its first run, morph install or the desktop app's setup. Start a new task Mister Morph's Console uses the model for new tasks; restart open morph chats to use it there. magpie morph deepseek/deepseek-v4-pro"],["config","config.yaml","magpie writes these keys under llm: inference_provider openai_response_compatible, OpenAI's Responses API, Mister Morph's own default, which the gateway serves for every vendor; endpoint the gateway's /v1 (Mister Morph adds no second /v1 to a base ending in one); api_key magpie's key; and model the catalog id. In Mister Morph the model reads magpie/deepseek/deepseek-v4-pro. magpie also sets a User-Agent of mistermorph in llm.headers, as its requests otherwise carry the OpenAI SDK's, which tells them from no one's. # ~/.morph/config.yaml (or $MISTER_MORPH_CONFIG) llm: inference_provider: openai_response_compatible endpoint: http://127.0.0.1:3425/v1 api_key: model: deepseek/deepseek-v4-pro context_window_tokens: … headers: User-Agent: mistermorph reasoning_effort: high llm.provider is left as it is: Mister Morph derives it from inference_provider. A Mister Morph in WSL is set up the same way, at ~/.morph/config.yaml, as MISTER_MORPH_CONFIG isn't read there."],["window","The context window","Mister Morph knows a model's context window only from a list of its own, by the id after its last slash. So magpie writes the window it knows in llm.context_window_tokens, and removes the key when it knows none."],["effort","Effort","The effort goes in llm.reasoning_effort: none, minimal, low, medium, high, xhigh or max. Unset, Mister Morph sends none. magpie morph effort high"],["profiles","Profiles and routes","llm.profiles and llm.routes are yours, and magpie leaves them alone. A route that sends the main loop to another profile still does."],["off","Switching back","Before it first takes llm over, magpie saves what you had under those keys. Switching back puts them back, and removes the ones you didn't have; when the User-Agent was alone in llm.headers, headers goes too. Picking one of Mister Morph's own models restores them the same way, then sets llm.model to it. magpie morph default"],["faq","FAQ","Can Mister Morph run on DeepSeek, GLM or a ChatGPT subscription? Yes. Pick a via-magpie model for Mister Morph on magpie's Agents page, and magpie sets the llm keys in config.yaml. Which API does Mister Morph use through magpie? OpenAI's Responses API (openai_response_compatible), Mister Morph's default, which magpie's gateway serves for every vendor. Why does magpie write context_window_tokens? Mister Morph looks a window up only in its own list, which doesn't have magpie's model ids, so magpie gives it the window it knows. Are my llm.profiles and llm.routes changed? No. They are yours; magpie changes only its keys under llm and puts them back when you switch back. More agents on the same models: Grok App on any model, fx on any model, Aside on any model and mu on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/mistral-vibe","Mistral Vibe",[["","","Mistral Vibe is Mistral's open-source coding agent, the vibe CLI. It keeps its settings in config.toml in $VIBE_HOME, else ~/.vibe. magpie adds a magpie provider there with one model per catalog model, so Vibe's /model picker lists DeepSeek, GLM, Kimi, Qwen, Claude, a ChatGPT subscription or any other model in magpie. For Mistral's own models in other agents, see Mistral in Claude Code, Codex, Gemini CLI and OpenCode."],["on","Set up Mistral Vibe","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Pick a model for Mistral Vibe on the Agents page Pick one via magpie; magpie points Vibe's active_model at it. Restart open vibe sessions Vibe reads its settings at start-up. Afterwards you can switch to another magpie model in Vibe's /model too."],["file","config.toml","magpie writes a [[providers]] entry with the gateway's /v1 as OpenAI chat completions, and one [[models]] entry per catalog model. A model's alias is magpie//, which is what /model shows and active_model holds: # ~/.vibe/config.toml active_model = \"magpie/deepseek/deepseek-v4-pro\" [[providers]] name = \"magpie\" api_base = \"http://127.0.0.1:3425/v1\" api_style = \"openai\" backend = \"generic\" extra_headers = { Authorization = \"Bearer \" } [[models]] name = \"deepseek/deepseek-v4-pro\" provider = \"magpie\" alias = \"magpie/deepseek/deepseek-v4-pro\" thinking_levels = [\"off\", …] supports_images = … max_context_length = …"],["key","Where the key goes","Vibe reads a provider's key only from the environment variable its api_key_env_var names, or the keyring, never from config.toml. A keyless provider sends its extra_headers as they are, so magpie's key for Vibe goes there as an Authorization header. Nothing of magpie's is put in your environment or in ~/.vibe/.env. Vibe's requests say Mistral-Vibe/ as their User-Agent, which the gateway tells apart."],["models","Models and thinking","A model with effort levels offers them in thinking_levels beside off; one without offers off alone. A thinking level you chose in Vibe on one of magpie's models stays while the model still has it. A model whose context magpie doesn't know is given 128K, since without one Vibe takes a default window with a warning."],["yours","What stays yours","Every other key and entry of the file is yours and stays as written. magpie rewrites its own entries only when its models changed. Avibe, whose command is also vibe, is not taken for Mistral Vibe. Vibe's skills and AGENTS.md, in ~/.vibe/skills and ~/.vibe/AGENTS.md, are kept by magpie's Library."],["off","Switching back","magpie notes what active_model was when it first takes over. When you pick Vibe's own model in magpie, or switch Vibe off, magpie puts active_model back to that value (or the model you picked) and removes its provider and model entries."],["faq","FAQ","Can Mistral Vibe use DeepSeek or Claude? Yes. magpie adds a magpie provider and its models to config.toml; pick a model starting with magpie/ in Vibe's /model. Where does magpie put its key? Vibe doesn't read keys from config.toml, so magpie puts its key in extra_headers as an Authorization header, not in your environment. Why is Vibe still on its old model? Vibe reads its settings at start-up. Restart open vibe sessions. Is my old model back when I switch back? Yes. magpie noted what active_model was and puts it back. More agents on the same models: Avibe on any model, Pencil on any model, WorkBuddy on any model and OpenMausBot on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/mistral","Mistral in Claude Code, Codex, Gemini CLI and OpenCode",[["","","Mistral serves its models on one API, OpenAI-style Chat Completions, at api.mistral.ai. Add a Mistral API key to magpie once, and Claude Code, Codex, Gemini CLI, OpenCode and every other agent you connect can use Mistral through magpie’s local gateway at 127.0.0.1:3425, each agent with a model of its own. Agents that speak another API are translated on the way."],["add","Add Mistral","Get a key Make one on console.mistral.ai. A Le Chat plan’s Vibe key goes in the same provider. Add the provider In magpie’s Providers tab, press + Add provider, pick Mistral, paste the key and save. magpie asks Mistral which models the key can use. Pick it for an agent In the Agents tab, click the model on the agent’s row and choose a Mistral model such as mistral-large-4. magpie provider add mistral magpie provider test mistral Model ids in magpie are provider/model, so Mistral’s read mistral/mistral-large-4: the provider, then Mistral’s own id. The key is kept in magpie’s settings; magpie doesn’t take it from your shell. Already set Mistral up in OpenCode or Alma? magpie’s import from those apps brings it in as the Mistral provider. An app that keeps one entry per key (“Mistral #0001”, “Mistral #0002”…) becomes one Mistral provider with that many keys, listed once in every agent’s picker."],["endpoints","Endpoints","API Address Used for Chat Completions https://api.mistral.ai/v1 the model list and every agent’s requests: OpenCode’s as they are, Claude Code’s, Codex’s and Gemini CLI’s translated Billing https://api.mistral.ai/v1/billing/budget, /v1/billing/subscription a key’s month of Vibe or API budget, and the plan it is on magpie’s Mistral provider has no Anthropic Messages or Responses address, so an agent that speaks either is translated to Chat Completions and the reply translated back, streaming and tool calls included."],["models","Model list","magpie fetches the list from Mistral, at https://api.mistral.ai/v1/models, so agents see the models your key can use. Names, reasoning levels and prices come from models.dev’s mistral catalog, and Devstral, Codestral and Magistral models carry Mistral’s logo in every picker. Mistral also serves models from other labs, such as GLM and DeepSeek’s deepseek-v4.1-flash-1017; they come through the same key, and the fixes below apply to them too. Pick the models agents see in the provider’s model list, or from the terminal: magpie provider models mistral +mistral-large-4 +mistral-medium-3.5 magpie provider refresh-every mistral 1d"],["agents","In each agent","magpie claude mistral/mistral-large-4 magpie codex mistral/mistral-large-4 magpie gemini model mistral/mistral-large-4 magpie opencode mistral/mistral-large-4 Claude Code speaks Anthropic Messages, which Mistral doesn’t serve. magpie translates each request to Chat Completions and the reply back; a reasoning model’s thinking reaches Claude Code as thinking, then the text. Models in Claude Code. Codex speaks OpenAI Responses, which Mistral doesn’t serve either, so its requests are translated too. Codex’s custom tools, such as apply_patch, are offered to the model as functions, and its calls come back as the custom tool calls Codex runs. Models in Codex. Gemini CLI speaks Google’s Gemini API. magpie translates each request to Chat Completions and the reply back. Models in Gemini CLI. OpenCode speaks Chat Completions, so its requests go to Mistral as they are, with the fixes below. Models in OpenCode."],["shaping","What magpie fixes for Mistral","Mistral’s API is strict about what it takes and sends a reasoning model’s thinking in a shape of its own. magpie changes both on the way, on requests it passes on and on those it translates alike: Thinking in typed parts. Mistral sends a reasoning model’s thinking as typed parts in content, thinking and text sometimes in one chunk, where the Chat contract has a string. OpenCode turned the first such chunk away (“Invalid … stream event”). magpie moves the thinking to reasoning_content and the text to a plain string, streamed or not. Thinking sent back. OpenCode sends an earlier turn’s thinking back in reasoning_content, which Mistral refuses with 422 extra_forbidden. magpie puts it in the thinking part Mistral itself returns, ahead of the turn’s text, so the thinking stays in context. Translated requests get the same, so a Codex tool loop keeps going on a DeepSeek model served by Mistral. Fields Mistral doesn’t know. OpenCode’s store and Kimi Code’s thinking switch got 422 extra_forbidden. magpie asks again without the optional fields Mistral named, and doesn’t send them to it again once that works. Ollama options. An agent that took the gateway for an Ollama server, such as Hermes Agent, sends Ollama’s options (its num_ctx) beside the Chat fields. magpie leaves them out, so Mistral never sees them."],["reasoning","Reasoning","Effort. The effort an agent asks for is fitted to the nearest level the model has, as the catalog lists them. A model whose levels aren’t known is asked as the agent asked. Reasoning off. When an agent whose requests magpie translates, such as Gemini CLI, turns reasoning off and the model lists none among its levels, magpie asks for none. Thinking across turns. Each agent sees a reasoning model’s thinking in its own shape: reasoning_content for OpenCode, thinking blocks for Claude Code, reasoning for Codex. When it comes back in a later turn, Mistral gets it as a thinking part; see What magpie fixes."],["search","Web search","Mistral’s Chat Completions API doesn’t search the web for magpie, so magpie gives the model its own search tool in every agent, answered by the searcher chosen in Settings, or by one magpie picks when none is chosen."],["cost","Vibe, cost and usage","Vibe month. A Le Chat plan (Pro, Student or Team) comes with a month of Mistral Vibe. Its Vibe key’s row shows how much of the month’s budget is used, in the currency Mistral bills in, when it resets, and the plan’s name. API month. A Studio key made in the console shows the organization’s API budget, as “API · Month”, apart from a Vibe month. The budget is the organization’s, so every key of one organization shows the same numbers. A key with no budget has no card. Pay as you go. With pay-as-you-go on, what goes past the budget is billed rather than stopped, so a used-up month doesn’t stop the key’s models. Cache tokens. When a reply reports cached prompt tokens, the Usage tab counts them apart from the rest of the prompt. Keeping the cache. With several keys, a conversation stays on its key while its cache is worth keeping, 1,024 tokens or more, and still warm, read within the last five minutes. Cost. The Usage tab prices each call with Mistral’s prices from models.dev. magpie reads no balance from Mistral; type it in with key-balance, and the Usage page shows it less what magpie has priced the key’s calls at since."],["keys","Several keys and failover","One Mistral provider can hold several keys: press Add another key under it, or paste several at once. Requests go to the first key that’s on, and when it runs out or is rate limited the next one takes over. Spend caps. spend-cap stops a key at a dollar amount a day, a month or in all, as the Usage tab prices its calls; routing then goes on to the other keys and the fallbacks. Fallbacks. fallback names where requests go when Mistral is out of quota or down: another provider’s model or a routing group. magpie provider spend-cap mistral 20 month magpie provider key-balance mistral 25 magpie provider fallback mistral deepseek/deepseek-v4-pro"],["trouble","Troubleshooting","422 extra_forbidden, “Extra inputs are not permitted”. Mistral turned away a field it doesn’t know. magpie fixes the ones agents are known to send and asks again without an optional field Mistral names; see What magpie fixes. “Invalid … stream event” in OpenCode. That was Mistral’s thinking in typed parts. magpie sends OpenCode the thinking in reasoning_content and the text as a string. No Vibe card. magpie shows the month only for a key Mistral says is a Vibe key or a Studio key, and only when its budget is more than zero. Checking a key. magpie provider test mistral sends a tiny request through each endpoint, or to each model you name. Add --as codex or --as claude-code to send it the way that agent would. Groq in Claude Code, Codex and other agents"],["faq","FAQ","How do I use Mistral in Claude Code? Add your Mistral API key in magpie (Providers, Add provider, Mistral), then pick a Mistral model such as mistral-large-4 on Claude Code’s row, or run magpie claude mistral/mistral-large-4. Mistral serves Chat Completions only, so magpie translates Claude Code’s Anthropic Messages requests to https://api.mistral.ai/v1 and the replies back, thinking included. Can Codex use Devstral and other Mistral models? Yes. Codex can use any model your Mistral key lists, Devstral among them. Codex speaks OpenAI Responses, which Mistral doesn’t serve, so magpie translates each request to Chat Completions, offers Codex’s custom tools such as apply_patch as functions, and gives the calls back the way Codex runs them. How do I use Codestral or other Mistral models in OpenCode? Pick the model in magpie, or run magpie opencode mistral/mistral-large-4; Codestral and Devstral work the same way when your key lists them. OpenCode speaks Chat Completions, so its requests go to Mistral as they are, with what Mistral would refuse fixed on the way: OpenCode’s store field, and earlier turns’ thinking sent back in reasoning_content. Can Gemini CLI use Mistral? Yes. Gemini CLI speaks Google’s Gemini API, so magpie translates its requests to Mistral’s Chat Completions and the replies back, streaming and tool calls included. Run magpie gemini model mistral/mistral-large-4. Why does Mistral answer 422 extra_forbidden? Mistral turns away any field it doesn’t know. magpie sends an earlier turn’s thinking as the thinking part Mistral takes, leaves out Ollama options some agents add, and asks again without an optional field Mistral names, such as OpenCode’s store, then stops sending it. Does magpie show my Le Chat plan’s Vibe budget? Yes. A Vibe key from a Le Chat plan (Pro, Student or Team) shows how much of the month’s Vibe budget is used, in the currency Mistral bills in, and when it resets, with the plan’s name. A Studio key made in the console shows the organization’s API budget instead, as “API · Month”. By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Volcengine Ark · Tencent Cloud · Baidu Qianfan · SiliconFlow · ModelScope · Huawei Cloud MaaS · Xiaomi MiMo · StepFun · LongCat · Qwen · MiniMax · Anthropic · OpenAI · Gemini · Grok · OpenRouter · GitHub Copilot · Ollama Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. Ask on Discord if you get stuck."]]],["/docs/modelscope","ModelScope",[["","","ModelScope's (魔搭) API-Inference takes a ModelScope account's access token as its key and serves models such as Qwen and GLM over Chat Completions and Responses. Add ModelScope in magpie, and Claude Code, Codex, Gemini CLI and OpenCode use them through magpie's local gateway on 127.0.0.1:3425."],["add","Add ModelScope","Add the provider On Providers, click + Add provider, pick ModelScope, use your ModelScope access token as the key, paste the key and save. Pick it for a tool On Agents, pick a model such as Qwen/Qwen3-Coder-30B-A3B-Instruct on a tool's row. magpie claude modelscope/Qwen/Qwen3-Coder-30B-A3B-Instruct magpie codex modelscope/ZhipuAI/GLM-4.6 magpie opencode modelscope/Qwen/Qwen3-235B-A22B-Instruct-2507"],["endpoint","Endpoint and token","API Endpoint Chat Completions https://api-inference.modelscope.cn/v1 Responses https://api-inference.modelscope.cn/v1 The key is a ModelScope account's access token, made at modelscope.cn/my/myaccesstoken. ModelScope is not Alibaba Cloud's DashScope: a DashScope key goes in the Qwen provider, and neither works on the other. A provider added by hand at api-inference.modelscope.cn is taken as ModelScope too."],["models","Models","ModelScope's model names carry their organisation, written as they are: Qwen/Qwen3-Coder-30B-A3B-Instruct, Qwen/Qwen3-235B-A22B-Instruct-2507, Qwen/Qwen3-235B-A22B-Thinking-2507, ZhipuAI/GLM-4.6, ZhipuAI/GLM-4.5, among others. magpie takes their names and context from models.dev's modelscope catalog. On the command line, write modelscope/ then the name."],["agents","In each agent","Claude Code speaks Anthropic Messages, which this provider doesn't serve. magpie converts each request to Chat Completions and the reply back, reasoning included. Claude Code with other models. Codex speaks OpenAI Responses. It serves Responses too, so Codex's requests go as they are. Codex with other models. Gemini CLI speaks Gemini's API; magpie converts it to Chat Completions. Gemini CLI with other models. OpenCode speaks Chat Completions, so requests go as they are. OpenCode with other models."],["images","Images","ModelScope draws through async tasks of its own: a request starts a task and answers its task_id, which is asked about until it succeeds or fails. It runs one task of a user's at a time and answers bursts with 429, so magpie asks for one image at a time, waits a moment when it is busy, and hands the result to your tool as an image it can read. NVIDIA NIM in Claude Code, Codex and other agents"],["faq","FAQ","How do I use ModelScope in Claude Code? Add ModelScope in magpie with your access token as the key, then pick Qwen/Qwen3-Coder-30B-A3B-Instruct on Claude Code's row, or run magpie claude modelscope/Qwen/Qwen3-Coder-30B-A3B-Instruct. ModelScope has no Anthropic endpoint, so magpie converts to Chat Completions. Where do I get a ModelScope key? ModelScope uses your account's access token, made at modelscope.cn/my/myaccesstoken. Paste it into magpie's ModelScope provider. Is ModelScope the same as Alibaba's DashScope? No. ModelScope's API-Inference is at api-inference.modelscope.cn on a ModelScope access token; DashScope takes an Alibaba Cloud key and is magpie's Qwen provider. Does ModelScope work in Codex? Yes. ModelScope serves Responses, so magpie passes Codex's requests through. Run magpie codex modelscope/ZhipuAI/GLM-4.6. The same for other providers: SiliconFlow, Volcengine Ark, GLM Coding Plan, Kimi, DeepSeek, Qwen. Hit an error? See troubleshooting, or ask on Discord."]]],["/docs/mothx","MothX",[["","","MothX (OSCHINA's oschina/mothx, the mothx command, formerly vibecoding) is a coding agent in the terminal, written in Go. Its providers and the model it starts on are in one settings.json. magpie adds a provider named magpie and makes it the default, so MothX runs on any model in magpie: DeepSeek, GLM, Kimi, Qwen, Claude or a ChatGPT subscription."],["on","Set up MothX","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Pick a model for MothX on the Agents page Pick a model via magpie, and a thinking level if you want one. Restart MothX MothX reads its settings when it starts, so an open session keeps its model until it starts again. magpie mothx deepseek/deepseek-v4-pro"],["file","settings.json","The config folder is $MOTHX_DIR, else %APPDATA%\\mothx on Windows and ~/.mothx elsewhere. What magpie writes: { \"defaultProvider\": \"magpie\", \"defaultModel\": \"deepseek/deepseek-v4-pro\", \"defaultThinkingLevel\": \"high\", \"providers\": { \"magpie\": { \"baseUrl\": \"http://127.0.0.1:3425/v1\", \"api\": \"openai-chat\", \"apiKey\": \"\", \"thinkingFormat\": \"openai\", \"models\": [ { \"id\": \"deepseek/deepseek-v4-pro\", \"name\": \"…\", \"reasoning\": true, \"input\": [\"text\"], \"contextWindow\": …, \"maxTokens\": …, \"cost\": { \"input\": …, \"output\": …, \"cacheRead\": …, \"cacheWrite\": … } } ] } } } MothX asks the default provider for the default model on that provider's api: openai-chat is baseUrl plus /chat/completions, under Bearer apiKey. Each of magpie's models is one entry, with whether it reads images, its context window, its cap on a reply and its price per million tokens; without them MothX takes its own default window and cap, and can't count a turn's cost. Headers or an httpProxy you put in magpie's provider stay, and your own providers aren't touched. MothX in a WSL distro is set up the same way, in ~/.mothx there."],["thinking","Thinking levels","defaultThinkingLevel is the level a session starts at: off, minimal, low, medium, high, xhigh or max, narrowed to the ones a model takes when magpie knows them. MothX sends a level only for a model whose entry says reasoning is true. magpie writes thinkingFormat: \"openai\", so MothX asks every model as reasoning_effort, which the gateway carries to each vendor's own form. Without it MothX guesses the vendor from the model id and the address: a model named qwen… got Qwen's enable_thinking, a deepseek… one only thinking:{type:enabled}, whatever served it. A thinkingFormat you already set is left alone."],["restart","Restart MothX","MothX reads settings.json at start-up, so a running MothX needs a restart; magpie tells you when a mothx or vibecoding process is running. MothX's own /model and /auth dialogs write the whole file back, and magpie's settings survive that. Its requests say Vibecoding Client/ as their User-Agent, and Usage counts them as MothX."],["off","Switching back","Switching back takes out defaultProvider, defaultModel and providers.magpie, and a providers object left empty. When the file then says the same as before magpie's first write, the original file is put back byte for byte. magpie mothx default"],["faq","FAQ","Can MothX run on DeepSeek, GLM or a ChatGPT subscription? Yes. Pick a via-magpie model for MothX on magpie's Agents page, then restart MothX. Does this work for vibecoding too? Yes. vibecoding is MothX's old name; magpie takes it for MothX, with the same settings.json. How does the thinking level reach the model? magpie sets thinkingFormat to openai, so MothX sends reasoning_effort, which the gateway turns into each vendor's own form. Does switching back restore my settings? Yes. magpie takes out the default and the provider it added; when the file says the same as before, the original is put back as it was. More agents on the same models: PenguinHarness on any model, Paimon on any model, Pi on any model and Avibe on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/mu","mu",[["","","mu (qybaihe/mu: npm's mu-agent, the mu command and the mu desktop app) is Pi with a judgment kernel added as an extension. It starts Pi, with Pi's settings.json and models.json in its own ~/.mu/agent folder, and the desktop app uses the same folder. So magpie sets mu up as it does Pi, and mu runs on any model in magpie: DeepSeek, GLM, Kimi, Qwen, Claude or a ChatGPT subscription."],["on","Set up mu","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Pick a model for mu on the Agents page Pick one via magpie, and an effort if you want. The command and the desktop app both use it. Start a new session New mu sessions use the model. magpie mu deepseek/deepseek-v4-pro"],["files","settings.json and models.json","magpie writes defaultProvider, defaultModel and defaultThinkingLevel in settings.json, and adds itself to models.json as the provider magpie, as it does for Pi. // ~/.mu/agent/settings.json { \"defaultProvider\": \"magpie\", \"defaultModel\": \"deepseek/deepseek-v4-pro\", \"defaultThinkingLevel\": \"…\" } // ~/.mu/agent/models.json { \"providers\": { \"magpie\": { \"apiKey\": \"\", … } } } On its first run mu asks for mu setup only while models.json has no provider and settings.json no defaultProvider. Once magpie has written them, mu counts as set up and doesn't ask."],["key","mu's own key","mu's requests say pi/ and a version, as Pi's do. So magpie gives mu a key of its own (magpie-mu), and the gateway counts its requests as mu's, not Pi's."],["folder","mu's folder","magpie finds mu's folder as mu does: the first of these variables that is set, with ~ in it standing for your home. MU_AGENT_DIR KYRN_AGENT_DIR MU_CODING_AGENT_DIR KYRN_CODING_AGENT_DIR With none set it is ~/.mu/agent, or ~/.kyrn/agent when only ~/.kyrn, its old name, exists and ~/.mu doesn't. A mu in WSL is set up the same way, though magpie can't read the variables there. mu is a common name: a mu on PATH that is maildir-utils' mu (djcb/mu) isn't taken for mu-agent. mu is also found by its alias mu-agent."],["judge","The judge","mu's judgment kernel has settings of its own (mu.json and MU_JUDGE). They are mu's, and magpie leaves them alone."],["off","Switching back","Before its first write magpie saves settings.json and models.json as they were. Switching back puts them back byte for byte while they still say what magpie left. magpie mu default"],["faq","FAQ","Can mu run on DeepSeek, GLM or a ChatGPT subscription? Yes. Pick a via-magpie model for mu on magpie's Agents page, and magpie writes settings.json and models.json in ~/.mu/agent. Do I still run mu setup? No. mu asks for it only while models.json has no provider and settings.json no defaultProvider, and magpie writes both. Are mu's requests counted as Pi's? No. Both say pi/ in their User-Agent, so magpie gives mu its own key (magpie-mu) and counts its requests as mu's. Is mu's judge changed? No. mu.json and MU_JUDGE are mu's own settings, and magpie leaves them alone. More agents on the same models: Pi on any model, Mister Morph on any model, Grok App on any model and Claude Science on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/muse-code","Muse Code",[["","","Muse Code is Meta's muse coding agent CLI. Where its requests go is endpoint_transport in its settings.json, and the model sessions start on is the top-level model. magpie points both at the gateway, so Muse Code runs on any model in magpie: DeepSeek, GLM, Kimi, Qwen, Claude or a ChatGPT subscription."],["on","Set up Muse Code","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Pick a model for Muse Code on the Agents page Pick a model via magpie. Restart open muse sessions Muse Code reads its settings at start-up. magpie muse deepseek/deepseek-v4-pro"],["file","settings.json","Muse Code keeps its settings in ${XDG_CONFIG_HOME:-~/.config}/muse/settings.json, and refuses the file without \"schema_version\": 1. magpie writes: { \"schema_version\": 1, \"endpoint_transport\": { \"base_url\": \"http://127.0.0.1:3425/v1\", \"auth\": \"none\" }, \"model\": \"deepseek/deepseek-v4-pro\" } Muse Code streams to /responses under base_url (OpenAI's Responses API), where the gateway answers. The file's other keys are left as they are. With no file, magpie makes one with the schema version. Muse Code in a WSL distro is set up the same way, in ~/.config/muse there."],["auth","Why auth is none","With auth bearer, Muse Code sends the Meta sign-in's token (auth.json, or META_API_KEY); with none it sends no Authorization and asks for no sign-in. magpie uses none, so your Meta token is neither read by magpie nor sent to the gateway."],["models","The model list","Muse Code lists its models from /muse-code/models on base_url's host, which the gateway serves, so magpie's models show in Muse Code's model choice."],["off","Switching back","When it first steps in, magpie stashes the endpoint_transport and model you had. Switching back puts them back, or takes magpie's out where you had none. A file magpie made goes again once only the schema version is left. magpie muse default"],["faq","FAQ","Can Muse Code run on DeepSeek, GLM or a ChatGPT subscription? Yes. Pick a via-magpie model for Muse Code on magpie's Agents page, then restart open muse sessions. Does magpie read my Meta sign-in token? No. magpie sets auth to none, so Muse Code sends no Authorization; the token is neither read nor sent to the gateway. Nothing changed in Muse Code. Why? Muse Code reads settings.json at start-up. Restart open muse sessions. Does switching back restore my settings? Yes. magpie stashed the endpoint_transport and model you had and puts them back; the file's other keys were never touched. More agents on the same models: Prime Agent on any model, Pi on any model, Kimi Code on any model and Paimon on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/nanobot","nanobot",[["","","nanobot (HKUDS/nanobot, pip install nanobot-ai) is a personal AI assistant that answers in chat apps, its CLI and its WebUI. Its model comes from ~/.nanobot/config.json, where any key under providers that isn't one of its own is an OpenAI-compatible endpoint. magpie adds a magpie provider there and sets the default model to one of magpie's, so nanobot runs on any model you have in magpie: DeepSeek, GLM, Kimi, Qwen, an OpenAI or Anthropic key, or a ChatGPT or Copilot subscription."],["on","Set up nanobot","Run nanobot once nanobot onboard or its first run makes ~/.nanobot. Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Pick a model on nanobot's row On the Agents page, pick a magpie model for nanobot. A nanobot in WSL is set up there too. pip install nanobot-ai && nanobot onboard # nanobot makes ~/.nanobot magpie nanobot deepseek/deepseek-v4-pro"],["config","What goes in config.json","magpie adds providers.magpie at the gateway's /v1, with the gateway's key and a User-Agent of nanobot (the OpenAI SDK's otherwise, which tells it from no one), and sets agents.defaults to provider magpie, model magpie/ and the context window magpie knows the model to take. nanobot strips the magpie/ prefix before it sends the model. // ~/.nanobot/config.json { \"providers\": { …, \"magpie\": {\"apiBase\": \"http://127.0.0.1:3425/v1\", \"apiKey\": \"…\", \"extraHeaders\": {\"User-Agent\": \"nanobot\"}} }, \"agents\": {\"defaults\": { \"provider\": \"magpie\", \"model\": \"magpie/deepseek/deepseek-v4-pro\", \"contextWindowTokens\": … }} } nanobot's pydantic models read camelCase and snake_case keys alike. magpie writes nanobot's own camelCase, and takes out a snake_case spelling of the same key, so no two settings disagree."],["preset","modelPreset","When agents.defaults.modelPreset names one of modelPresets, it goes over both provider and model. So magpie stashes it and takes it out while magpie's model is on, and puts it back when it steps out; your modelPresets stay as they are."],["when","When it takes effect","nanobot's gateway (nanobot gateway, the WebUI's) watches the file and takes a change at its next reply. nanobot agent reads it once, so restart an open nanobot agent chat. magpie says so while nanobot is running."],["own","Your own settings","The provider, model, context window and modelPreset you had under agents.defaults are stashed and put back when magpie steps out. Your other providers, presets and keys stay as they are. A config.json magpie made goes again once nothing is left in it. If you delete the magpie provider in nanobot, magpie's check says it no longer reaches magpie."],["off","Switching back","Set the row back to default in magpie: magpie takes out providers.magpie and puts agents.defaults back. Or pick a model of your own, and magpie puts things back and then sets it as the model. magpie nanobot default"],["faq","FAQ","Can nanobot use DeepSeek, GLM, Kimi or Qwen? Yes. magpie adds an OpenAI-compatible magpie provider to ~/.nanobot/config.json and sets the default model to the one you pick in magpie. Why is nanobot still on the old model? nanobot's gateway and WebUI take the change at their next reply; nanobot agent reads its config once, so restart the chat. Do I lose my modelPreset? No. magpie stashes agents.defaults.modelPreset and takes it out (it would go over magpie's model), and puts it back when it steps out; modelPresets stay. Does it work for nanobot in WSL? Yes. magpie sets up a nanobot in a WSL distro too. More agents on the same models: OpenClaw on any model, Hermes Agent on any model, OpenChamber on any model and AstrBot on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/nvidia","NVIDIA NIM",[["","","NVIDIA hosts NIM endpoints at build.nvidia.com: one nvapi- key reaches the many models it hosts. magpie's nvidia preset brings it to Claude Code, Codex, OpenCode and other agents."],["add","Add it","Get a key. Sign in at build.nvidia.com and make one under Settings → API Keys. Add it. Pick NVIDIA NIM in the app and paste the key into API key, or from the CLI: magpie provider add nvidia nvapi-… magpie provider test nvidia The preset sets Chat Completions alone, at https://integrate.api.nvidia.com/v1: NIM's /v1/responses answers for a few models and 404 for the rest, so magpie doesn't use it."],["agents","Use it in an agent","Model ids are nvidia/, from NIM's own list: magpie claude nvidia/ magpie codex nvidia/ Claude Code speaks Anthropic's API and Codex speaks Responses; magpie translates both to Chat Completions for NIM and the answers back to what the agent reads."],["free","Free models","A model NIM prices at 0 is marked free beside it in agents' model pickers. The price is NIM's alone: the same model on another provider costs what it costs there, and NIM's $0 isn't taken as the maker's price."],["keys","Many keys","Importing from an app that keeps an entry per key, as CC Switch does, often brings hundreds of entries, \"NVIDIA #001\" to \"NVIDIA #600\". magpie folds entries alike in all but their key into one provider, each key an account of it; otherwise every model showed hundreds of times in every agent's picker. Each entry's old name becomes its key's name, and one that was off stays off."],["notes","Notes","An nvidia provider set up in OpenCode becomes this preset when imported. When NIM's free use runs out or is rate-limited, put it in a routing group with other providers: when one fails, the group's next member answers. magpie can't tell a free NIM key from a paid one, so it doesn't say how a key bills. Free models in Claude Code, Codex and other agents"],["faq","FAQ","Does magpie support NVIDIA NIM? Yes, with the nvidia preset. Give a build.nvidia.com API key; magpie asks Chat Completions at integrate.api.nvidia.com/v1, and a model id is nvidia/. Can Claude Code and Codex use NIM's models? Yes. NIM is asked on Chat Completions alone, and magpie translates Claude Code's Anthropic requests and Codex's Responses requests to Chat and the answers back. How do I tell which models are free? A model NIM prices at 0 is marked free beside it in agents' model pickers. That is NIM's price only; the same model costs what it costs on other providers. I imported hundreds of NVIDIA entries. What now? magpie folds entries alike in all but their key into one provider, each key an account of it, so models aren't repeated in the pickers. Related: ModelScope in Claude Code and Codex, Round robin and failover across accounts, keys and providers. If something fails, see Fixing common errors: 401, 429, 502, 504 and more or ask on Discord."]]],["/docs/obsidian","Obsidian",[["","","Obsidian has no AI of its own; its community plugins bring it. magpie wires Copilot for Obsidian (logancyang/obsidian-copilot), which takes an OpenAI-compatible endpoint you name. magpie adds a provider called magpie in every vault that has Copilot, so Obsidian's AI chat runs on any model you have in magpie: DeepSeek, GLM, Kimi, Qwen, an OpenAI or Anthropic key, or a ChatGPT or Copilot subscription."],["on","Set up Obsidian","Install Copilot in Obsidian Install and turn on Copilot from Obsidian's Settings › Community plugins. magpie shows the Obsidian row once a vault has Copilot. Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Pick magpie on Obsidian's row On the Agents page, pick magpie. Then reload Copilot in Obsidian, and magpie's models are in its model menu. magpie obsidian provider magpie"],["vaults","Vaults","Obsidian lists its vaults in obsidian.json in its config folder: ~/Library/Application Support/obsidian on a Mac, %APPDATA%\\obsidian on Windows, $XDG_CONFIG_HOME/obsidian on Linux, or the Flatpak's and the Snap's own folders. Copilot keeps its settings in each vault's .obsidian/plugins/copilot/data.json. magpie wires every vault that has Copilot; after that it keeps the wired vaults up to date and wires none you haven't asked for."],["models","The model list","This is what magpie writes into data.json. Only these keys change; everything else in the file stays as written: \"providers\": {\"magpie\": { \"providerType\": \"openai-compatible\", \"displayName\": \"magpie\", \"baseUrl\": \"http://127.0.0.1:3425/agent/obsidian/v1\", \"requiresApiKey\": false, …}}, \"configuredModels\": [{\"providerId\": \"magpie\", \"info\": {\"id\": \"deepseek/deepseek-v4-pro\", …}}, …], \"backends\": {\"chat\": {\"enabledModels\": […]}}, \"defaultModelKey\": \"…\" Each model carries its context size, output limit, images and thinking levels from magpie's catalog. A model new in magpie comes on in chat; a magpie model you turned off in Copilot stays off; one gone from magpie leaves every backend. Models and providers you added in Copilot yourself are untouched. The first time, Copilot's default model becomes magpie's first, and the one it had is kept to put back when you switch back."],["key","No key to enter","Copilot keeps API keys in Obsidian's keychain, which magpie doesn't write. So magpie's provider needs no key (requiresApiKey: false): its requests carry no Authorization, and the gateway takes a call with no key from this computer. Copilot calls it with fetch from Obsidian's window, so replies stream, and the gateway answers that window's CORS. The /agent/obsidian in the address is how magpie knows it is Obsidian, since the window's User-Agent is a browser's."],["reload","Reloading Copilot","While Obsidian runs, Copilot holds its settings and writes data.json whole when it saves. So after wiring, reload Copilot in Settings › Community plugins (or restart Obsidian) before changing Copilot's settings, or the old settings write over magpie's. magpie says so while Obsidian is running."],["v3","Copilot 3","magpie writes only Copilot 4's format (providers and configuredModels). Copilot 3 kept models in activeModels; magpie leaves such a vault alone and names it in the error. Update Copilot to 4, which moves the settings itself when it first loads."],["off","Switching back","Turn the row off in magpie. magpie takes its provider, its models and their places in every backend out of each vault's data.json, and puts back the default model you had while magpie's is still the default. A provider you added by hand under the name magpie, at an address that isn't magpie's Obsidian route, is yours and stays. magpie obsidian default"],["faq","FAQ","Can Obsidian use DeepSeek, GLM, Kimi or Qwen? Yes, through the Copilot for Obsidian plugin. magpie adds a magpie provider in every vault with Copilot, and every model you have in magpie is in Copilot's model menu. Do I enter an API key in Copilot? No. magpie's provider needs no key: requests go to the magpie gateway on this computer, which calls the model with your key or subscription. Why doesn't Copilot show magpie's models? Reload Copilot in Obsidian's Settings › Community plugins, or restart Obsidian. A vault on Copilot 3 needs Copilot 4 first. Does Smart Connections work? No. Its free plugin embeds with a local model only; its API providers are in the closed Pro plugin, with keys in the keychain magpie can't write. More apps on the same models: Raycast, Cherry Studio and CodeBuddy on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/ollama","Ollama in Claude Code, Codex, Gemini CLI and OpenCode",[["","","Ollama serves the models you pull on two APIs, OpenAI Chat Completions and Anthropic Messages, at http://localhost:11434. Ollama Cloud serves its models the same way at ollama.com, with an API key. Add either to magpie once, and Claude Code, Codex, Gemini CLI, OpenCode and every other agent you connect can use them through magpie’s local gateway at 127.0.0.1:3425, each agent with a model of its own."],["add","Add Ollama","Pull a model Pull a model in Ollama, such as qwen3, and leave the server running. Add the provider In magpie’s Providers tab, press + Add provider and pick Ollama under On this machine. No key is needed. magpie asks the server which models it has, and they show as ollama/…. Pick it for an agent In the Agents tab, click the model on the agent’s row and choose an Ollama model. ollama pull qwen3 magpie provider add ollama magpie provider test ollama Model ids in magpie are provider/model, so a model you pulled as qwen3 reads ollama/qwen3. A tag stays in the id, as in ollama/qwen3:8b. In the terminal UI, magpie asks for the server’s address when you add it. LM Studio, oMLX, vLLM and llama.cpp’s server are in Local models."],["remote","Another port or another computer","If Ollama listens on another port, or runs on another computer such as a GPU box or a NAS, change Server address in the provider’s editor. Only the scheme, host and port change; each API keeps its path. The scheme can be left out, and http is taken; a path pasted with the address, such as /v1, is dropped. magpie provider set ollama address=192.168.1.20:11434 magpie provider set ollama address= # back to the default Proxies. A server on your own network is reached directly, whatever proxy Settings or the system name. A proxy you set on the provider itself is still used. HTTPS. An Ollama behind HTTPS with a self-signed certificate can be reached with Don't check its certificate in the editor. It applies to that provider’s own hosts only."],["cloud","Ollama Cloud","Get a key Make one at ollama.com/settings/keys. Add the provider In the Providers tab, press + Add provider, pick Ollama Cloud, paste the key and save. magpie asks Ollama Cloud which models the key can use. Pick it for an agent Choose an Ollama Cloud model, such as deepseek-v4-pro, on the agent’s row. magpie provider add ollama-cloud magpie claude ollama-cloud/deepseek-v4-pro Names, reasoning levels and prices come from models.dev’s ollama-cloud catalog. The key is kept in magpie’s settings."],["endpoints","Endpoints","Provider Chat Completions Anthropic Messages Ollama http://localhost:11434/v1 http://localhost:11434 Ollama Cloud https://ollama.com/v1 https://ollama.com An agent whose API Ollama serves is passed on to that API. magpie uses no Responses endpoint for either, so when it has to translate, it uses Chat Completions: it keeps Responses first only for OpenAI’s own models, and Messages first only for Claude models."],["models","Model list","magpie asks the server for its list at the Chat Completions base: http://localhost:11434/v1/models, or https://ollama.com/v1/models for Ollama Cloud. A model shows in magpie once Ollama has it. After you pull another, press Fetch models in the provider’s editor, or run magpie provider refresh ollama. Pick the models agents see in the provider’s model list, or from the terminal: magpie provider refresh ollama magpie provider models ollama +qwen3 Ollama 0.35.0 and later (0.40.5 for its cloud models) also serves decision models, such as Nimble, Clef and Tev. magpie reads Ollama’s /api/tags as well, and a model marked there as a decision model becomes one of the provider’s decision models for intent routing, never an agent’s model. An older Ollama lists none."],["agents","In each agent","magpie claude ollama/qwen3 magpie codex ollama/qwen3 magpie gemini model ollama/qwen3 magpie opencode ollama/qwen3 Claude Code speaks Anthropic Messages, and so does Ollama at http://localhost:11434, so its requests go there as they are. Models in Claude Code. Codex speaks OpenAI Responses, which magpie doesn’t send to Ollama. magpie turns each request into Chat Completions and the reply back, streaming and tool calls included. Models in Codex. Gemini CLI speaks Google’s Gemini API. magpie translates each request to Chat Completions and the reply back. Models in Gemini CLI. OpenCode speaks Chat Completions, so its requests go to Ollama’s /v1 as they are. Models in OpenCode. Inside the agent, Claude Code’s and Codex’s /model list magpie’s models too, so you can move between a local model and a cloud one there. To go back to the agent’s own models, run magpie claude default or magpie codex default."],["window","Context window and num_ctx","Agents plan around how long a request the model takes. Claude Code takes a model it doesn’t know for 200K, and Codex compacts a conversation at 90% of the window it is told. magpie doesn’t read an Ollama chat model’s window, so tell it the real one: Context window under Advanced in the provider’s editor, for every model or one of them. magpie passes it on to the agents. magpie provider set ollama context=32k magpie provider set ollama context.qwen3=128k num_ctx. Some clients send Ollama’s per-request options, such as {\"num_ctx\": …}, beside the Chat Completions fields. magpie leaves them out of every request it sends on: no Chat Completions API reads them, Ollama’s own /v1 included. The window the model runs with is Ollama’s to set; give magpie the same number. Too long. When a conversation outgrows the window, Ollama answers “exceeded max context length”. magpie tells the agent so the way it understands, context_length_exceeded or Anthropic’s “prompt is too long”, so the agent compacts and tries again."],["reasoning","Reasoning","Effort. The effort an agent asks for is fitted to the nearest level the model has, as the catalog lists them. A model whose levels magpie doesn’t know is asked as the agent asked. Reasoning off. When an agent whose requests magpie translates, such as Codex or Gemini CLI, turns reasoning off and the model lists none among its levels, magpie asks for none. Your own levels. magpie model efforts offers only the levels you name, or sends a model no reasoning field at all. magpie model efforts ollama/qwen3 low,medium,high magpie model efforts ollama/qwen3 off"],["tools","Tool calls","Claude Code’s and OpenCode’s tool calls reach Ollama as the agent wrote them. For Codex and Gemini CLI, magpie translates the tools, the model’s calls and their results to Chat Completions and back, in streamed replies too."],["masking","Privacy masking","magpie’s privacy masking replaces keys, tokens and other secrets with placeholders before a request leaves the gateway, a request to a local Ollama too. When the model runs on your own computer or network, you can turn on Send requests unmasked in its editor, or run magpie provider set ollama unmasked=yes. Cloud models. Ollama’s cloud models pass a request on to a vendor whatever the address, so it is your call. The editor warns you while it is on for a provider that isn’t local, such as Ollama Cloud. Tool arguments. In a request in Ollama’s own format, a tool call’s arguments are masked as tool arguments, as in every other API. Anonymous stats. magpie’s daily stats name an Ollama model only when models.dev knows it; any other counts as “other”. See Privacy."],["cost","Usage and cost","Usage. The Usage tab counts the tokens of every Ollama call. A model is priced at the price magpie finds for its id, which for a local model can be its maker’s list price. To count a local model at nothing, give it your own price. Free first. free=yes counts every model of the provider as free, so a Free first routing spends it before paid ones. Prices and Usage’s costs stay as listed. Ollama Cloud’s allowance. magpie reads the account’s balance from Ollama Cloud. The included allowance shows as a plan, in dollars used, with when it resets; an older plan shows its session and weekly limits instead. Credits you bought show as a balance. Past the allowance Ollama Cloud draws on those credits, so a spent allowance with credits left doesn’t stop the key. Peak hours. On Ollama Cloud, deepseek-v4.1-flash and deepseek-v4-pro (with their tags) cost double from 12:00 to 18:00 UTC, Monday to Friday. models.dev lists the off-peak price; the Usage tab doubles it in those hours, and a Cheapest first routing counts it. Out of allowance. When Ollama Cloud says a key is out without saying when it comes back, as its weekly limit does, magpie rests the key for 15 minutes. quota-rest sets how long, up to 8 days. With several keys (Add another key) the next one takes over; when every key is out, the gateway answers at once with Retry-After. magpie model price ollama/qwen3 0,0,0,0 magpie provider set ollama free=yes magpie provider quota-rest ollama-cloud 7d magpie provider fallback ollama-cloud ollama/qwen3"],["server","magpie as an Ollama server","Some apps take a custom model only as an Ollama server: VS Code’s Copilot Ollama provider, Visual Studio’s Copilot BYOK, Zed’s Ollama provider and the ollama CLI. Point them at magpie’s gateway, http://127.0.0.1:3425, and they see magpie’s models, from every provider, not only Ollama. Routes. magpie answers /api/version, /api/tags, /api/show, /api/chat and /api/generate. The same path. A chat there is served as /v1/chat/completions is, so key limits, routing, fallbacks and usage are the same. A gateway key held to some models lists only those. What it tells. /api/tags and /api/show mark tools, vision when the model reads images, and thinking when it reasons. /api/show also gives the model’s window, or 32768 for one magpie doesn’t know. The ollama CLI’s name:latest finds a model called name."],["trouble","Troubleshooting","A model you pulled isn’t listed. The list comes from the server. Press Fetch models, or run magpie provider refresh ollama, and pick it in the provider’s model list. Use the name Ollama lists, tag included. Ollama isn’t running. magpie provider test ollama sends a tiny request through each endpoint, or to each model you name; add --as codex or --as claude-code to send it the way that agent would. Start Ollama, or check Server address. fallback names where requests go while it is down. “exceeded max context length”. The conversation is longer than the model was loaded for. Set the real Context window on the provider, and the agents compact before they reach it. Another computer can’t be reached. Check the address and port in Server address; for HTTPS with a self-signed certificate, turn on Don't check its certificate."],["faq","FAQ","How do I use Ollama in Claude Code? Add Ollama in magpie (Providers, Add provider, Ollama under On this machine), then pick one of its models on Claude Code’s row, or run magpie claude ollama/qwen3. Claude Code’s requests go through magpie’s gateway to Ollama’s Anthropic Messages API at http://localhost:11434 as they are. Can Codex use Ollama? Yes. Codex speaks only the Responses API, so magpie turns its requests into Chat Completions for Ollama, and the replies back, tool calls included. Run magpie codex ollama/qwen3. Can Gemini CLI and OpenCode use Ollama? Yes. Gemini CLI speaks Google’s API, so magpie translates its requests to Ollama’s Chat Completions and the replies back. OpenCode speaks Chat Completions, so its requests go to Ollama as they are. Run magpie gemini model ollama/qwen3 or magpie opencode ollama/qwen3. How do I run qwen3-coder from Ollama in Claude Code? Pull it in Ollama, press Fetch models in the provider’s editor in magpie (or run magpie provider refresh ollama), and pick it on Claude Code’s row. Its id in magpie is ollama/ and the name Ollama lists it under, tag included. Set its Context window too: Claude Code takes a model it doesn’t know for 200K. Can magpie use Ollama on another computer? Yes. Set the provider’s Server address to that computer, such as magpie provider set ollama address=192.168.1.20:11434. A server on your own network is reached directly, not through a proxy set in Settings or the system. Does magpie work with Ollama Cloud? Yes. Add Ollama Cloud with a key from ollama.com/settings/keys. magpie lists the models the key can use, prices them from models.dev, and shows the account’s included allowance and the credits you bought. Do I need an API key for a local Ollama? No. The Ollama preset takes none. Ollama Cloud needs one. Other local servers, such as LM Studio, oMLX, vLLM and llama.cpp’s server, are in Local models. To let a local model classify each request for routing, see Intent routing. By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Volcengine Ark · Tencent Cloud · Baidu Qianfan · SiliconFlow · ModelScope · Huawei Cloud MaaS · Xiaomi MiMo · StepFun · LongCat · Qwen · MiniMax · Anthropic · OpenAI · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. Ask on Discord if you get stuck."]]],["/docs/omp","omp",[["","","omp (oh-my-pi, the omp command) is a fork of Pi, a coding agent in the terminal. It gives each kind of work a model role: default for the session, task for subagents, smol for small jobs, slow for review, plus plan, commit and more. magpie adds a provider named magpie to models.yml and points the roles you pick at it, so each of omp's roles runs on any model in magpie: DeepSeek, GLM, Kimi, Qwen, Claude or a ChatGPT subscription."],["on","Set up omp","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Pick models for omp on the Agents page Pick the default role's model first, then one for any other role and a thinking level if you want. On the command line, magpie oh-my-pi is the same agent. Start a new session A new omp session starts on the default role's model. magpie omp deepseek/deepseek-v4-pro"],["files","config.yml and models.yml","omp's settings are in ~/.omp/agent/config.yml; PI_CONFIG_DIR renames ~/.omp, and PI_CODING_AGENT_DIR moves the agent folder. Each role's model is under modelRoles as provider/model, so one of magpie's is magpie//, with an optional :level on the end. # ~/.omp/agent/config.yml modelRoles: default: magpie/deepseek/deepseek-v4-pro slow: magpie/…:high enabledModels: - … - magpie/** In models.yml beside it, magpie's provider takes no key on this computer (auth: none), and its models carry their context window, cap on a reply, whether they read images, the thinking levels each takes and the price per million tokens. With the price, omp counts what each call cost; without it a magpie model matches none of omp's bundled ones and every call costs 0. Your own providers and what else you keep in models.yml, such as modelOverrides, are left alone. # ~/.omp/agent/models.yml providers: magpie: baseUrl: http://127.0.0.1:3425/v1 auth: none models: - id: deepseek/deepseek-v4-pro …"],["roles","A model per role","default is the model a session starts on. task is for subagents; scout and sonic run on smol and reviewer on slow. Unset, task takes the parent session's model, and smol and slow the default's. plan is plan mode's, vision handles images, advisor gives a second opinion (slow first when unset), commit writes commit messages, tiny names sessions, and memory follows tiny. Every role but default can have a thinking level of its own, say medium for sessions and high for slow. The levels are minimal, low, medium, high, xhigh and max; an omp before 16.4.0 doesn't take max, so it gets xhigh. Image models set in magpie's Settings › Models › Images show up for omp's image role in its own Roles view, from omp 18.7.0."],["scope","enabledModels","While enabledModels lists models, a new session is held to it: a default model outside the list never starts, and omp picks another from the list. So when you have one, magpie adds magpie/** to it, which also keeps all of magpie's models in omp's picker and Ctrl+P. The list is yours: magpie keeps its entries, order and comments, never makes one where there is none, and leaves entries scoped to folders as they are. The other roles aren't held to it."],["api","Each model on its own API","As with Pi, each model is asked on its provider's native API, and the gateway relays it as it is: OpenAI's Responses, Anthropic's Messages, Gemini's /v1beta. Over Chat, a Claude lost its thinking's signatures between tool turns, since Chat has no place for them. magpie also has omp send its session id and its own name in headers, so Usage counts it as omp and Record gateway conversations keeps its turns."],["profiles","Profiles and WSL","Each profile in ~/.omp/profiles//agent is an omp of its own, shown on the Agents page as omp# with its own config.yml and models.yml; the one OMP_PROFILE picks is the default row. omp in a WSL distro uses ~/.omp/agent there; when it reaches Windows' address from behind NAT, the provider carries the key the gateway is shared on the network with."],["off","Switching back","Before magpie takes a role over it saves what the role had, and setting the role back puts that back as it was, a YAML list in the style it was written. magpie's provider stays in models.yml while any role, fallback chain or task agent is on one of its models, and goes once none is, with the enabledModels entry magpie added. magpie omp default"],["faq","FAQ","Can omp run on DeepSeek, GLM or a ChatGPT subscription? Yes. Pick a via-magpie model for omp's default role on magpie's Agents page, then start a new session. Can smol, slow and commit each have their own model? Yes. Each role can take its own magpie model, and every role but default its own thinking level. Why did omp start on another model when default was set? While enabledModels lists models, the default model has to be in it. magpie adds magpie/** and removes it when switching back. Does switching back restore my settings? Yes. Each role gets back what it had; once nothing is on magpie, its provider and its enabledModels entry go too. More agents on the same models: Pi on any model, StepCode on any model, MothX on any model and Ante on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/openai","OpenAI in Claude Code, Codex, Gemini CLI and OpenCode",[["","","OpenAI serves its models on two APIs at api.openai.com: Responses and Chat Completions. Its own models are best asked on Responses, and its newest answer only there. Add an OpenAI API key to magpie once, and Claude Code, Codex, Gemini CLI, OpenCode and every other agent you connect can use OpenAI’s models through magpie’s local gateway at 127.0.0.1:3425, each agent with a model of its own. Codex’s requests go to OpenAI as they are; the other agents’ are translated on the way. This page is about an API key from platform.openai.com. A ChatGPT Plus or Pro subscription is signed in to separately; see Subscriptions in any agent."],["add","Add OpenAI","Get a key Make one on platform.openai.com. It starts with sk-. Add the provider In magpie’s Providers tab, press + Add provider, pick OpenAI, paste the key and save. magpie asks OpenAI which models the key can use. Pick it for an agent In the Agents tab, click the model on the agent’s row and choose an OpenAI model such as gpt-6.1-sol. magpie provider add openai magpie provider test openai Model ids in magpie are provider/model, so OpenAI’s read openai/gpt-6.1-sol: the provider, then OpenAI’s own id. The key is kept in magpie’s settings; magpie doesn’t take it from your shell. Already set OpenAI up in OpenCode or another app magpie imports from? The import brings it in as the OpenAI provider."],["endpoints","Endpoints","API Address Used for Responses https://api.openai.com/v1 OpenAI’s own models, ids starting gpt-, codex or o and a digit: Codex’s requests as they are, Claude Code’s, Gemini CLI’s and OpenCode’s translated Chat Completions https://api.openai.com/v1 the model list, and any other model the key lists magpie’s OpenAI provider has no Anthropic Messages address, so Claude Code’s requests are always translated. For OpenAI’s own models magpie keeps Responses first even for an agent that speaks Chat Completions. When OpenAI answers that a model is served only on /v1/responses, magpie asks again there and remembers it. To send a model on one API yourself: magpie model api openai/gpt-5.5 chat magpie model api openai/gpt-5.5 --reset magpie model apis openai Azure OpenAI is a provider of its own, Azure OpenAI. Give it your resource’s endpoint, https://.openai.azure.com, and its key. magpie uses the v1 API under /openai/v1 for Chat Completions and Responses, sends the key in the api-key header, and lists the resource’s deployments as its models. A deployment named for its model, such as gpt-5-codex, goes to Responses first too."],["models","Model list","magpie fetches the list from OpenAI, at https://api.openai.com/v1/models, so agents see the models your key can use. Names, context windows, reasoning levels and prices come from models.dev’s openai catalog. A reasoning model OpenAI has just listed, before its levels are known, gets those of the newest reasoning model in its family: gpt-6.1-sol got gpt-6-sol’s. Pick the models agents see in the provider’s model list, or from the terminal: magpie provider models openai +gpt-6.1-sol +gpt-6-luna +gpt-5.5 magpie provider refresh-every openai 1d"],["agents","In each agent","magpie claude openai/gpt-6.1-sol magpie codex openai/gpt-6.1-sol magpie gemini model openai/gpt-6.1-sol magpie opencode openai/gpt-6.1-sol Claude Code speaks Anthropic Messages, which OpenAI doesn’t serve. magpie translates each request to Responses and the reply back; the model’s reasoning summary reaches Claude Code as thinking, then the text. Models in Claude Code. Codex speaks Responses, so its requests go to OpenAI as they are: its custom tools such as apply_patch, its reasoning items and its own prompt_cache_key included. Codex is also offered Fast here; see Reasoning. Models in Codex. Gemini CLI speaks Google’s Gemini API. magpie translates each request to Responses and the reply back. Models in Gemini CLI. OpenCode speaks Chat Completions. OpenAI’s own models go to Responses first, so magpie translates its requests there and the replies back; any other model the key lists gets OpenCode’s requests as they are. Models in OpenCode."],["shaping","What magpie does for OpenAI","A prompt cache key. A translated request to OpenAI that carries no prompt_cache_key gets one, made from the session the agent names, or else its first user message, and hashed, so it names nothing of the agent. Codex sends its own, which goes on as it is, and one you set yourself wins. If OpenAI answers 400 over the field, magpie asks again without it. Tools loaded where they were loaded. A tool that Claude Code’s tool search loads mid-conversation is sent to OpenAI’s Responses API as an additional_tools item at that point, not added to the tool list, which keeps the cached prefix. additional-tools=off puts it with the other tools. Sealed reasoning from elsewhere. OpenAI reads only its own sealed reasoning (encrypted_content). An item sealed under another key, organization or account is refused (“could not be verified”); magpie asks again without those items and remembers it for the conversation. Claude’s thinking, which Codex carries in a reasoning item after a turn on a Claude model, is taken out before the request reaches OpenAI. Earlier responses. A Responses client may send only a turn’s new input and name the response it follows (previous_response_id). magpie keeps each response it gave such a client, in memory and under the caller’s gateway key. OpenAI keeps responses too, so when the same key answered the one named, OpenAI is sent only the new input after its own id. Codex over HTTP says store false and names none. Codex’s own compaction. With compaction=native, Codex’s compaction is asked of OpenAI as Codex sent it and the sealed item comes back to Codex as it came. Only the key that sealed it can read it, so later requests carrying it go only there. The default, compaction=magpie, has magpie summarise. magpie provider set openai compaction=native magpie provider set openai additional-tools=off"],["reasoning","Reasoning","Effort. The effort an agent asks for is fitted to the nearest level the model has, as the catalog lists them: gpt-6-sol has none, low, medium, high, xhigh and max. On Responses it is sent as reasoning.effort, with summary set to auto, so the model’s reasoning summary comes back. Reasoning off. When an agent whose requests magpie translates, such as Gemini CLI, turns reasoning off and the model lists none among its levels, magpie asks for none. Encrypted reasoning. magpie passes on what an agent asks to include, but asks for reasoning.encrypted_content only with reasoning: OpenAI refuses it of a model that doesn’t reason. Codex sends the sealed items back on the next turn, and magpie passes them on as they are. Fast. On an OpenAI key, Codex is offered Fast for GPT and o-series models. magpie sends it as service_tier: \"priority\", OpenAI’s priority processing. A service tier set for Codex in magpie overrides what Codex asked."],["search","Web search","OpenAI’s Responses API searches the web itself. When an agent offers its model web search, as Codex and Claude Code do, magpie gives the model OpenAI’s own web_search tool on Responses, and OpenAI runs the search."],["cost","Cost and usage","Cost. The Usage tab prices each call with OpenAI’s prices from models.dev. Cache tokens. When a reply reports cached prompt tokens, the Usage tab counts them apart from the rest of the prompt. Keeping the cache. With several keys, a conversation stays on its key while its cache is worth keeping, 1,024 tokens or more, and still warm, read within the last five minutes. Service tier. Each call records the tier the agent asked for, the one magpie sent, and the one OpenAI’s reply says it ran at. Balance. magpie reads no balance from OpenAI; type it in with key-balance, and the Usage page shows it less what magpie has priced the key’s calls at since."],["keys","Several keys and failover","One OpenAI provider can hold several keys: press Add another key under it, or paste several at once. Requests go to the first key that’s on, and when it runs out or is rate limited the next one takes over. To keep keys apart instead, say from two organizations, add the provider again: the second is openai-2. Spend caps. spend-cap stops a key at a dollar amount a day, a month or in all, as the Usage tab prices its calls; routing then goes on to the other keys and the fallbacks. Fallbacks. fallback names where requests go when OpenAI is out of quota or down: another provider’s model or a routing group. magpie provider spend-cap openai 20 month magpie provider key-balance openai 25 magpie provider fallback openai deepseek/deepseek-v4-pro"],["trouble","Troubleshooting","“The encrypted content for item rs_… could not be verified”. The conversation carries reasoning sealed under another key, organization or account. magpie asks again without those items; see What magpie does. A model that answers only on /v1/responses. magpie moves it to Responses and remembers it. magpie model apis openai shows which API each model is asked on. A 400 over prompt_cache_key. magpie asks again without the key it added. Checking a key. magpie provider test openai sends a tiny request through each endpoint, or to each model you name. Add --as codex or --as claude-code to send it the way that agent would. Azure OpenAI in Codex, Claude Code and other agents"],["faq","FAQ","How do I use OpenAI’s models in Claude Code? Add your OpenAI API key in magpie (Providers, Add provider, OpenAI), then pick a model such as gpt-6.1-sol on Claude Code’s row, or run magpie claude openai/gpt-6.1-sol. OpenAI serves no Anthropic Messages API, so magpie translates Claude Code’s requests to OpenAI’s Responses API at https://api.openai.com/v1 and the replies back, the reasoning summary as thinking. Can Codex use an OpenAI API key instead of a ChatGPT sign-in? Yes. Add the key, then run magpie codex openai/gpt-6.1-sol. Codex speaks Responses, so its requests go to OpenAI as they are, custom tools and reasoning included, and Fast is sent as priority processing. A ChatGPT Plus or Pro sign-in is set up separately, in Subscriptions. How do I use GPT models in OpenCode? Pick the model in magpie, or run magpie opencode openai/gpt-6.1-sol. OpenCode speaks Chat Completions, but OpenAI’s own models go to Responses first, so magpie translates OpenCode’s requests there and the replies back. To send a model on Chat Completions instead, run magpie model api openai/gpt-5.5 chat. Can Gemini CLI use OpenAI? Yes. Gemini CLI speaks Google’s Gemini API, so magpie translates its requests to OpenAI’s Responses API and the replies back, streaming and tool calls included. Run magpie gemini model openai/gpt-6.1-sol. Does magpie keep OpenAI’s prompt cache? Yes. Codex’s own prompt_cache_key goes on as it is. A translated request without one gets a key made from its session or first user message, hashed so it names nothing of the agent. With several keys, a conversation stays on its key while its cache is warm. Why does OpenAI say the encrypted content could not be verified? OpenAI reads only reasoning it sealed for the same key, organization or account. When a conversation carries reasoning sealed elsewhere, magpie asks again without those items and remembers it for the conversation. Does magpie support Azure OpenAI? Yes, as its own provider, Azure OpenAI. Give it the resource’s endpoint and key; magpie uses the v1 API under /openai/v1, sends the key in the api-key header and lists the resource’s deployments as models. By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Volcengine Ark · Tencent Cloud · Baidu Qianfan · SiliconFlow · ModelScope · Huawei Cloud MaaS · Xiaomi MiMo · StepFun · LongCat · Qwen · MiniMax · Anthropic · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. Ask on Discord if you get stuck."]]],["/docs/openbot","OpenBot",[["","","OpenBot is an Electron workspace that runs Codex, Claude, OpenCode and other agents. Its model picker lists the OpenAI-compatible endpoints you add yourself. magpie adds one named magpie, so the picker lists the models in magpie: DeepSeek, GLM, Kimi, Qwen, GPT or a ChatGPT subscription."],["on","Set up OpenBot","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Set OpenBot's provider to magpie on the Agents page magpie writes its endpoint into OpenBot's custom endpoints file. Restart OpenBot and pick a model in its own picker magpie's models show as magpie/. magpie openbot provider magpie"],["where","Where the file is","OpenBot keeps custom endpoints in Electron's userData folder: macOS: ~/Library/Application Support/OpenBot/openbot-custom-providers-v1.json Windows: %APPDATA%\\OpenBot\\openbot-custom-providers-v1.json Linux: ~/.config/OpenBot/openbot-custom-providers-v1.json"],["files","What gets written","{ \"version\": 1, \"providers\": [ …your own endpoints, left as they are…, { \"id\": \"magpie\", \"name\": \"magpie\", \"baseUrl\": \"http://127.0.0.1:3425/agent/openbot/v1\", \"models\": [ {\"id\": \"deepseek/deepseek-v4-pro\", \"name\": \"DeepSeek V4 Pro\", \"contextWindow\": 1000000}, … ], \"secret\": null } ] } version must be 1. A file OpenBot can't parse leaves it with no endpoints and refuses every save, so magpie leaves alone a file it can't read either. OpenBot keeps each endpoint's key and headers together in secret, sealed with Electron's safeStorage (the Keychain, DPAPI). magpie doesn't open it, so magpie's endpoint has no key (secret is null). OpenBot hands it to OpenCode keyless, and the gateway takes a request with no key from this computer. OpenCode sends the requests, with OpenCode's User-Agent. The /agent/openbot in the address tells the gateway they are OpenBot's, and they are counted as OpenBot's. A name, harness or key you give magpie's endpoint in OpenBot stays. Your other endpoints stay as written."],["models","Which models show","OpenBot's list check fails closed: one endpoint or model it wouldn't accept empties the whole list. So magpie writes only the models picked for OpenBot in magpie, and: At most 64 That is OpenBot's limit for one endpoint; a longer list hides them all. Ids OpenBot accepts ASCII letters, digits and ._:/[],=-, at most 160 characters with the magpie/ prefix. Context windows in range contextWindow is written only between 1,024 and 100,000,000."],["restart","When it takes effect","OpenBot reads the file once, when it starts. It writes the file whole from what it holds only when an endpoint is saved, edited or removed there. So a change shows after a restart. An endpoint saved in OpenBot before the restart writes magpie's endpoint out again. While OpenBot is running, magpie reminds you to restart it before adding or editing an endpoint there. MCP servers live in OpenBot's SQLite database, which magpie doesn't write. To use magpie's own MCP servers (/mcp/magpie/…), add them in OpenBot by hand as HTTP servers."],["off","Switching back","Switching back removes only magpie's endpoint. When nothing else is left in the file, magpie removes the file, since OpenBot starts with an empty list without one. magpie openbot default"],["faq","FAQ","How do I use DeepSeek, GLM or a ChatGPT subscription in OpenBot? Set OpenBot's provider to magpie on magpie's Agents page, restart OpenBot, then pick a magpie/ model in its model picker. Why does magpie's endpoint have no API key? OpenBot seals each endpoint's key with the system keychain, which magpie doesn't open. The gateway takes keyless requests from this computer, and /agent/openbot in the address tells it they are OpenBot's. Why don't I see every magpie model? magpie writes only the models picked for OpenBot, at most 64, and skips ids OpenBot wouldn't accept. One bad model would make OpenBot empty the whole list. Why hasn't the change shown up? OpenBot reads custom endpoints only at start-up, so restart it. Don't save an endpoint in OpenBot before that, or it writes magpie's endpoint out. More desktop apps on the same models: Lody on any model, Cindy on any model, miniQ on any model and Tuanjie Cowork on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/openchamber","OpenChamber",[["","","OpenChamber is a desktop, web and VS Code front end for OpenCode. It runs an OpenCode of its own (the desktop app bundles OpenCode 2) on your OpenCode config. magpie sets OpenChamber's default model to one of magpie's and puts magpie's provider in the OpenCode config, so OpenChamber runs on any model you have in magpie: DeepSeek, GLM, Kimi, Qwen, an OpenAI or Anthropic key, or a ChatGPT or Copilot subscription."],["on","Set up OpenChamber","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Pick a model on OpenChamber's row On the Agents page, pick OpenChamber's default model, and a small model if you like. Start a new session OpenChamber takes the new model for new sessions. magpie openchamber deepseek/deepseek-v4-pro # new sessions magpie openchamber small deepseek/deepseek-v4-flash # titles, commit messages OpenChamber's settings are under $OPENCHAMBER_DATA_DIR, ~/.config/openchamber by default (not moved by XDG_CONFIG_HOME). magpie writes its profile, preferences.json, and the copy in settings.json that older builds read, where that file is: // ~/.config/openchamber/preferences.json {\"version\": 1, \"fields\": { \"defaultModel\": {\"value\": \"magpie/deepseek/deepseek-v4-pro\", \"updatedAt\": …}, \"smallModelUseDefault\": {\"value\": false, …}, \"smallModelOverride\": {\"value\": \"magpie/deepseek/deepseek-v4-flash\", …} }}"],["order","Which model a session gets","OpenChamber sends each new session the model it picks, in this order: the project's defaultModel (settings.json's projects), the profile's defaultModel, the agent's own, and only then OpenCode's model. So setting OpenCode's model alone doesn't reach OpenChamber; magpie sets the profile's defaultModel. A project with a default model of its own keeps it there, and magpie names the project and its model. On a new model magpie also clears the old one's defaultVariant, as OpenChamber's own picker does."],["small","The small model","OpenChamber's small model writes session titles and commit messages. It is smallModelOverride once smallModelUseDefault is false, else OpenCode's small_model. Picking a small model in magpie writes those two keys; switching back takes both out and leaves it to OpenCode."],["opencode","The OpenCode config","A model in OpenChamber is OpenCode's provider/model, so one of magpie's needs magpie's provider in the OpenCode config: $OPENCODE_CONFIG_DIR, else $XDG_CONFIG_HOME/opencode. A provider of your own that already sends that model to magpie's gateway is used instead of a second list of the same models. An OpenCode 2 config is written in OpenCode 2's words. Once OpenChamber steps off magpie, magpie's provider goes too, when nothing else in the OpenCode config names one of its models. Its requests count as OpenCode's, since OpenChamber's OpenCode sends them."],["sessions","New and open sessions","OpenChamber takes the new model for new sessions; sessions already open keep theirs. magpie says so while OpenChamber is running."],["off","Switching back","Set the row back to default in magpie: magpie takes out the profile's defaultModel and defaultVariant, and OpenChamber goes back to the OpenCode config's model. magpie openchamber default"],["faq","FAQ","Can OpenChamber use DeepSeek, GLM, Kimi or Qwen? Yes. magpie sets OpenChamber's default model to the one you pick in magpie and puts magpie's provider in the OpenCode config. OpenCode is on magpie already; why is OpenChamber still on my old model? OpenChamber takes a project's and its profile's own defaultModel before OpenCode's model. Pick a model on OpenChamber's own row in magpie. One project is still on the old model? That project has a default model of its own in settings.json, which goes first there. magpie names the project. Which model writes session titles and commit messages? The small model: smallModelOverride once smallModelUseDefault is false, else OpenCode's small_model. More agents on the same models: Models in OpenCode, T3 Code on any model and Craft Agents on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/openclaw","OpenClaw",[["","","OpenClaw answers you on WhatsApp, Telegram, Discord and more, on whatever model its config names. magpie adds itself to OpenClaw as one provider, so OpenClaw can run on any model you have in magpie: DeepSeek, Kimi, GLM, Qwen, an OpenAI key, or a ChatGPT or Copilot subscription, with no key pasted into OpenClaw. OpenClaw keeps its settings in ~/.openclaw/openclaw.json. magpie adds a provider named magpie there: its gateway’s /v1 address, OpenAI’s chat completions API, a key of OpenClaw’s own, and one entry per model you have in magpie. Then it makes the model you pick OpenClaw’s default. The gateway translates each request for that model’s provider, tool calls and reasoning included."],["on","Connect OpenClaw","Add providers in magpie In the Providers tab, add an API key or sign in to a subscription. Pick a model on OpenClaw’s row In the Agents tab, choose a model on OpenClaw’s row. OpenClaw takes it up without a restart. magpie openclaw deepseek/deepseek-v4-pro # OpenClaw on DeepSeek magpie openclaw # what OpenClaw runs on now"],["models","Pick a model","In OpenClaw a model is named provider/model, so magpie’s models show up as magpie/deepseek/deepseek-v4-pro, magpie/openai/gpt-6.1 and so on. magpie sets the primary model and keeps your fallbacks. If your config has a list of allowed models, magpie adds magpie/* to it so its models aren’t refused. A model whose context magpie doesn’t know is given 128K."],["chats","Chats that already have a model","A change to the default model reaches new chats at once. A chat that already has a model keeps it: send /model default in that chat to move it onto the new one."],["file","What magpie writes","Only models.providers.magpie, the default model, and the allow list when you have one. Your other providers, channels and keys stay as you wrote them, and so do keys you add to magpie’s provider yourself (headers, timeoutSeconds, a model’s maxTokens). A model set for one agent (agents.entries.*.model) stays yours, and a config split with $include isn’t changed. magpie finds the file where OpenClaw does: $OPENCLAW_CONFIG_PATH, else openclaw.json in $OPENCLAW_STATE_DIR, else ~/.openclaw- for $OPENCLAW_PROFILE, else ~/.openclaw. A file written in JSON5 that isn’t plain JSON is left alone, and magpie says so."],["off","Switch back","Take OpenClaw’s row off magpie, or run magpie openclaw default. magpie removes its provider and puts back the model OpenClaw ran on before, as long as magpie’s model is still the default; a model you picked since stays."],["faq","FAQ","Can OpenClaw use my ChatGPT subscription? Yes. Sign in to ChatGPT in magpie and pick a GPT model on OpenClaw’s row. OpenClaw sends its requests to magpie, which uses the subscription. Do I need to restart OpenClaw? No. OpenClaw’s gateway takes up a change of models and default model by itself. Chats that already have a model keep it until you send /model default there. Does magpie touch my channels or other providers? No. It writes only its own provider, the default model and, if you have one, the allow list. I use an OpenClaw profile. Does magpie find it? Yes. It reads OPENCLAW_PROFILE, OPENCLAW_STATE_DIR, OPENCLAW_CONFIG_PATH and OPENCLAW_HOME the way OpenClaw does. More agents on the same models: Models in OpenCode, Hermes Agent on any model, Models in Claude Code and nanobot on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/opencode-models","Models in OpenCode",[["","","OpenCode reaches a model through a provider in its config. magpie adds one provider, named magpie, that leads to a gateway on your computer. Every model you have in magpie is listed under it: DeepSeek, Kimi, GLM and Qwen keys, and the models of a Claude, ChatGPT or Copilot sign-in. The gateway runs at 127.0.0.1:3425. OpenCode sends it OpenAI Chat Completions, and magpie passes each request on in the API its provider speaks, translating the request and the reply where they differ, streaming and tool calls included. OpenCode’s own providers stay as they were, next to magpie’s. Chinese models DeepSeek, Kimi and Kimi Code, Zhipu GLM (pay as you go or Coding Plan), Z.ai, MiniMax and Qwen. Subscriptions Claude Pro/Max, ChatGPT Plus/Pro and GitHub Copilot, signed in once in magpie. Anything else Any OpenAI- or Anthropic-compatible URL and key, Ollama and LM Studio."],["setup","Set it up","Add the provider In magpie’s Providers tab, press + Add provider, pick DeepSeek, Kimi, Zhipu GLM, MiniMax or Qwen, paste your API key and save. magpie asks the vendor which models it serves. Pick the model for OpenCode In the Agents tab, click the model on OpenCode’s row and choose one, such as deepseek/deepseek-v4-pro. magpie writes \"model\": \"magpie/deepseek/deepseek-v4-pro\" into OpenCode’s config, with the magpie provider beside it. Or pick it in OpenCode Once the provider is there, magpie’s models are in OpenCode’s own /models list under magpie, so you can switch there too. The same from a terminal: magpie provider add deepseek sk-… magpie models # every model, as provider/model magpie opencode deepseek/deepseek-v4-pro # OpenCode's model magpie opencode small deepseek/deepseek-v4-flash # its small_model OpenCode’s small_model is a field of its own on the row, so it can run on a cheaper model than the main one. Zhipu GLM Coding Plan. When you add Zhipu GLM or Z.ai, pick the plan your key is for. A Coding Plan key has its own endpoints, and sent to the pay-as-you-go one it is told it has no balance."],["subs","Subscriptions","Sign in once in magpie, from + Add provider or a terminal, and the subscription’s models are listed under magpie in OpenCode like any other. No API key. Subscription Models are From a terminal Claude (Pro, Max, Team) claude/… magpie accounts add claude magpie opencode claude/claude-opus-5-5 ChatGPT (Plus, Pro, Business) codex/… magpie accounts add codex magpie opencode codex/gpt-5.5 GitHub Copilot copilot/… magpie accounts add copilot Requests on a Claude subscription run through the Claude Code installed on your computer, so keep it installed. Copilot gives you a code to enter on GitHub’s page. Several accounts of one subscription can share the load and fail over; see Subscriptions in any agent."],["config","What changes in opencode.json","magpie writes to the config file OpenCode reads from its config folder, $OPENCODE_CONFIG_DIR when that is set and ~/.config/opencode otherwise: the first of opencode.jsonc, opencode.json and config.json that exists, or a new opencode.json. It changes only these keys; your other settings stay. Key Set to model magpie// small_model The same form, when you set one provider.magpie.npm @ai-sdk/openai-compatible provider.magpie.options.baseURL http://127.0.0.1:3425/v1 provider.magpie.options.apiKey The gateway’s key provider.magpie.models Every model magpie lists for OpenCode Each model carries its context window and output limit, so OpenCode knows when to compact; whether it takes images; its reasoning levels; and its price. magpie keeps the list up to date as you add providers and accounts. With OpenCode 2 installed, magpie writes OpenCode 2’s own keys instead: the provider under providers.magpie and the small model as agents.title.model. OpenCode in a WSL distro on Windows is set up the same way, in the distro’s ~/.config/opencode."],["variants","Reasoning levels and cost","Reasoning levels. A model’s reasoning efforts are written as its variants in OpenCode, each one asking for that reasoningEffort. A model that offers fast processing, such as a GPT model from a ChatGPT plan, also gets a fast variant for each level. Cost. magpie writes each model’s price per million tokens, input, output, cache read and cache write, so OpenCode’s session cost counts, where without it every model costs 0. Prompt caching. magpie turns on OpenCode’s prompt cache key for its provider, so a provider that caches by it keeps the cache between turns."],["narrow","A shorter model list","By default OpenCode is shown every model you have in magpie. To show it only some providers or groups: magpie visible opencode deepseek,claude # only these providers magpie visible opencode all # every model again A model left out of the list still answers when OpenCode asks for it by name."],["back","Switch back","On OpenCode’s row in magpie, the model picker lists OpenCode’s own providers too, the ones signed in in its auth.json. Pick one of them, or run: magpie opencode default It puts back the model and small_model OpenCode had before magpie, and takes the magpie provider out of the file. By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Volcengine Ark · Tencent Cloud · Baidu Qianfan · SiliconFlow · ModelScope · Huawei Cloud MaaS · Xiaomi MiMo · StepFun · LongCat · Qwen · MiniMax · Anthropic · OpenAI · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama OpenCode Go and ClinePass in Claude Code, Codex and other agents"],["faq","FAQ","How do I use DeepSeek in OpenCode? Add DeepSeek with your API key in magpie, then pick a DeepSeek model on OpenCode’s row in the Agents tab, or run magpie opencode deepseek/deepseek-v4-pro. magpie adds a magpie provider to opencode.json and sets the model. Can I use Kimi or GLM in OpenCode? Yes. Add Kimi or Zhipu GLM in magpie and pick its model for OpenCode. For a GLM Coding Plan key, pick the Coding Plan when you add it, since it has its own endpoints. Can I use my Claude Pro or Max subscription in OpenCode? Yes. Sign in to Claude in magpie (magpie accounts add claude) and pick a claude/… model for OpenCode. Requests on a Claude subscription run through the Claude Code installed on your computer, so keep it installed. Can I use my ChatGPT Plus or Pro subscription in OpenCode? Yes. Sign in to ChatGPT in magpie (magpie accounts add codex) and pick a codex/… model, such as codex/gpt-5.5. Its reasoning levels show as the model’s variants in OpenCode. Which file does magpie change? OpenCode’s config in ~/.config/opencode (or $OPENCODE_CONFIG_DIR): the first of opencode.jsonc, opencode.json and config.json, or a new opencode.json. It sets model and small_model and adds provider.magpie; other settings stay. How do I switch back to OpenCode’s own model? Pick one of OpenCode’s own models on its row in magpie, or run magpie opencode default. It puts back the model and small_model you had and removes magpie’s provider. Other agents: Models in Claude Code, Models in Codex, Models in Gemini CLI, OpenClaw on any model, OpenChamber on any model. Stuck? Ask on Discord."]]],["/docs/openhanako","OpenHanako",[["","","OpenHanako (HanaAgent) is a desktop personal agent that keeps what it knows in ~/.hanako, or the folder $HANA_HOME names. magpie adds a provider, magpie, there and makes your pick the primary agent's chat model, so OpenHanako runs on any model in magpie: DeepSeek, GLM, Kimi, Qwen, Claude or a ChatGPT subscription."],["on","Set up OpenHanako","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Open OpenHanako once It makes its agent the first time. Until it has one, magpie asks you to open it. Pick a model for OpenHanako on the Agents page Pick a model via magpie; the primary agent chats on it. magpie hanako deepseek/deepseek-v4-pro"],["files","What gets written","~/.hanako/ (or $HANA_HOME) provider-catalog.json providers.magpie: the gateway's /v1, api openai-completions, magpie's key, models provider-plugins/magpie/... the same provider, once OpenHanako moves it agents//config.yaml models.chat: {id, provider: magpie} magpie is one provider in OpenHanako, magpie, spoken to as Chat Completions (openai-completions) at the gateway's /v1, with magpie's catalog as its models: each with its context, max output, and whether it takes images and reasons. OpenHanako runs on Pi's SDK, so the effort goes as reasoning_effort. The model set is the primary agent's models.chat: primaryAgent in user/preferences.json, else the first agent with a config, as OpenHanako picks at start-up."],["live","Changes while it runs","While OpenHanako runs, magpie adds its provider and changes the chat model through OpenHanako's local API, which saves them and reloads its models at once, with no restart. Otherwise magpie writes the files, which OpenHanako reads when it starts."],["sealed","The sealed catalog","Since 1.0 OpenHanako seals its provider catalog under a key kept in the system keychain: the file is then HANA-SECRET-1.AES-256-GCM.…, not JSON. magpie can't read it or write it, and never writes over it. A provider's definition is in its plugin file under provider-plugins/magpie, out of the catalog, so magpie still keeps that up to date; its key stays sealed. Adding or removing magpie needs OpenHanako running, to do it through its API. When it isn't, magpie says to open OpenHanako and try again."],["off","Switching back","magpie stashes the primary agent's model when it first steps in and puts it back when it steps out. With none stashed, or one OpenHanako no longer has, the agent goes to the first of OpenHanako's own models, as since 1.0 its API takes no agent without a model. Then magpie's provider is removed. magpie hanako default"],["faq","FAQ","Can OpenHanako run on DeepSeek, GLM or Kimi? Yes. Pick a via-magpie model for OpenHanako on magpie's Agents page. magpie adds the magpie provider and makes it the primary agent's chat model. magpie says OpenHanako keeps its providers encrypted. What now? Since 1.0 OpenHanako seals its catalog, so magpie can change it only through its API while it runs. Open OpenHanako and try again. Do I restart OpenHanako for the change? Not while it runs: magpie goes through its local API and the models reload at once. When it isn't running, the change is there the next time it opens. Does switching back give me my old model? Yes. magpie stashed it and puts it back; if OpenHanako no longer has it, the agent goes to OpenHanako's first model of its own. More desktop apps on the same models: DS Bot on any model, Tuanjie Cowork on any model, OpenBot on any model and Kun on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/openmausbot","OpenMausBot",[["","","OpenMausBot is an open-source Electron chat app whose bots run the CLIs installed on the computer. It keeps its settings in config.json in its data folder: $OMB_DATA_DIR, else ~/.openmausbot on every system. Each engine a bot can run on is an entry in that file's instances. magpie adds an engine of its own there, magpie, so bots can run on DeepSeek, GLM, Kimi, Qwen, Claude, a ChatGPT subscription or any other model in magpie."],["on","Set up OpenMausBot","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Quit OpenMausBot magpie refuses the change while OpenMausBot runs (on Windows magpie can't tell, so quit it first). Set OpenMausBot's provider to magpie on the Agents page magpie puts every magpie model in the magpie engine's model picker. Open OpenMausBot and pick magpie as a bot's engine Then pick the model in the engine's picker."],["engine","The magpie engine","Why an engine of its own: OpenMausBot's Claude bots run Claude Code isolated, with only the sign-in keys of ~/.claude/settings.json carried over, so a Claude Code wired to magpie reaches the gateway already but its picker lists Claude's own models alone. Its Codex bots run your ~/.codex as it is, which magpie's Codex wiring already covers. magpie writes the engine as OpenMausBot's own Claude endpoint writes one: a claudeAgent with access custom, a Claude home of its own, requireApiKey, the gateway's address and magpie's key as ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN and ANTHROPIC_API_KEY, and every magpie model in endpointModels. An engine with those keys owns its routing: neither your settings nor a provider switch in OpenMausBot reaches it. If you gave OpenMausBot a Claude Code of your own, the magpie engine uses it too. // ~/.openmausbot/config.json \"instances\": { \"magpie\": { \"driver\": \"claudeAgent\", \"displayName\": \"magpie\", \"access\": \"custom\", \"config\": { \"configDir\": \"~/.openmausbot/providers/magpie\", \"requireApiKey\": true, \"endpointModels\": […] }, \"environment\": { \"ANTHROPIC_BASE_URL\": \"http://127.0.0.1:3425\", \"ANTHROPIC_AUTH_TOKEN\": \"\", \"ANTHROPIC_API_KEY\": \"\", \"ANTHROPIC_MODEL\": \"…\" } }, … } A 1M model is marked [1m]. A model id OpenMausBot wouldn't take is left out, since one such id makes it refuse the whole engine."],["fleet","The default fleet stays","With no engines saved in config.json, OpenMausBot runs its default fleet. A saved instances map is the whole fleet, so one holding magpie's alone would take every other engine away. When the file has none, magpie writes the default fleet beside its own."],["running","Why quit it first","OpenMausBot reads the file when it starts, and writes its whole map of engines, as it holds it, back when you change one in its Settings. So magpie refuses a change while it runs. A sync writes anyway: what OpenMausBot writes over is written again by the next sync, or within half a minute. When OpenMausBot runs on an older list than the file's, magpie's Agents page offers a restart."],["yours","What stays yours","The magpie engine's name, colour, icon, whether it is on or hidden, the keys magpie doesn't write and the environment besides the routing are yours. So is the model picked first, while magpie still lists it. The routing, the Claude home and the model list are magpie's."],["off","Switching back","When you switch OpenMausBot off in magpie, magpie takes its engine out, and the default fleet it wrote with it while that is still the default fleet, so OpenMausBot runs its defaults again as they are then."],["faq","FAQ","Can OpenMausBot's bots use DeepSeek or GLM? Yes. magpie adds a magpie engine to config.json; pick it as a bot's engine, then pick the model. Why quit OpenMausBot first? When you change an engine in it, it writes its whole map back over magpie's change, so magpie refuses while it runs. Will my other engines disappear? No. When the file has no engines saved, magpie writes OpenMausBot's default fleet beside its own. How do Codex bots use magpie? OpenMausBot's Codex bots run your ~/.codex as it is, which magpie's Codex wiring already covers. More agents on the same models: Mistral Vibe on any model, Pencil on any model, Claude Desktop on any model and JetBrains Copilot on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/openpencil","OpenPencil",[["","","OpenPencil (ZSeven-W/openpencil, the openpencil-desktop app) is a design canvas whose chat runs models through builtin agents of your own: an Anthropic or OpenAI-compatible endpoint, a key and a list of models, each listed in the chat's model picker. magpie adds an entry named magpie, so OpenPencil runs on any model in magpie: DeepSeek, GLM, Kimi, Qwen, Claude or a ChatGPT subscription."],["on","Set up OpenPencil","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Quit OpenPencil Why is below. Pick magpie for OpenPencil on the Agents page Then tick the models it should list. Open OpenPencil and pick a magpie model in its chat's model picker The model is picked in OpenPencil, not in a file. magpie openpencil magpie"],["file","The entry in settings.json","OpenPencil keeps its settings in one settings.json: macOS ~/Library/Application Support/openpencil/settings.json Linux ~/.config/openpencil/settings.json ($XDG_CONFIG_HOME) Windows %APPDATA%\\openpencil\\settings.json magpie writes one entry of builtin_agents, id magpie, of kind openai-compat, which posts to /chat/completions under the gateway's /v1. OpenPencil's User-Agent isn't known, so the gateway tells its requests apart by the key magpie-openpencil: {\"version\": 1, \"builtin_agents\": [{\"id\": \"magpie\", \"preset\": \"custom\", \"display_name\": \"magpie\", \"kind\": \"openai-compat\", \"api_key\": \"magpie-openpencil\", \"model\": \"\", \"models\": [\"\", …], \"base_url\": \"http://127.0.0.1:3425/v1\", \"enabled\": true}]} Your other entries and settings stay, and so do the name and the on/off you give magpie's entry in OpenPencil. version has to be 1: without it OpenPencil sets the file aside as corrupt and then refuses to save at all. So magpie writes version 1 in a file it makes, and leaves alone a file whose version it doesn't know."],["quit","Quit OpenPencil first","OpenPencil reads settings.json once, when it starts, and writes all of it back from what it holds when a setting changes and when it quits. A change magpie makes while it runs is written over when it quits, so magpie refuses one then and says to quit OpenPencil and try again. On Windows, where magpie can't tell it is running, a notice asks you to quit it first."],["models","The model list","The entry's models are the ones you tick for OpenPencil on magpie's Agents page, each once, at most 64 (OpenPencil drops the rest when it next saves). The models list is written for two or more, with the first again as model; v0.8.4 knows only model, so it lists the first model alone. Changes in magpie are synced to it."],["off","Switching back","Switching back takes magpie's entry out of builtin_agents, and the file too when all that is left is the version and empty list magpie wrote. Quit OpenPencil first here too. magpie openpencil default open-pencil/open-pencil, the other app of the name, keeps its providers in its webview's localStorage, which magpie can't write. It reaches magpie through an agent magpie sets up (Pi, an ACP agent) or a base URL typed in."],["faq","FAQ","Can OpenPencil run on DeepSeek, GLM or a ChatGPT subscription? Yes. Quit OpenPencil, pick magpie for it on magpie's Agents page, then open OpenPencil and pick a magpie model in its chat's model picker. Why quit OpenPencil first? OpenPencil writes its whole settings back to settings.json when it quits, over what magpie wrote while it ran. Why does OpenPencil show only one magpie model? OpenPencil v0.8.4 reads only the model field, so it lists the first model; later versions read the models list, up to 64. Are my other builtin agents kept when I switch back? Yes. magpie removes only the entry with id magpie and leaves the rest as it was. More desktop apps on the same models: Alma on any model, Kun on any model and Pi on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/openrouter","OpenRouter in Claude Code, Codex, Gemini CLI and OpenCode",[["","","OpenRouter sells many vendors’ models behind one key and serves them on OpenAI Chat Completions and Anthropic Messages. Add the key to magpie once, and Claude Code, Codex, Gemini CLI, OpenCode and every other agent you connect can use any OpenRouter model through magpie’s gateway at 127.0.0.1:3425, each agent on a model of its own."],["add","Add OpenRouter","Get a key Make one on openrouter.ai/keys. Add the provider In magpie’s Providers tab, press + Add provider, pick OpenRouter, paste the key and save. magpie asks OpenRouter which models it serves. Pick it for an agent In the Agents tab, click the model on the agent’s row and choose an OpenRouter model such as anthropic/claude-opus-5.5. magpie provider add openrouter sk-… magpie provider test openrouter Model ids in magpie are provider/model, so OpenRouter’s read openrouter/anthropic/claude-opus-5.5: the provider, then OpenRouter’s own id. The key is kept in magpie’s settings; magpie doesn’t take it from your shell. OpenRouter documents two optional headers that credit an app in its rankings, HTTP-Referer and X-OpenRouter-Title. magpie doesn’t send them. The provider editor’s Headers field offers them if you want your requests credited."],["endpoints","Endpoints","API Base URL Used for Chat Completions https://openrouter.ai/api/v1 the model list, requests to non-Claude models, image models Anthropic Messages https://openrouter.ai/api Claude Code’s requests, and Claude models from any agent Decisions https://openrouter.ai/api/v1 decision models for intent routing magpie doesn’t use OpenRouter’s Responses API. An agent that speaks Responses, such as Codex, is translated to one of the two above."],["models","Model list","Where it comes from. magpie fetches the list from https://openrouter.ai/api/v1/models, which gives each model’s context length. Names, reasoning levels and prices come from the openrouter catalog on models.dev. Which models agents see. OpenRouter lists hundreds. Unless you pick some, magpie shows agents the first 24 OpenRouter lists, newest first. Pick the rest in the provider’s model list, or turn on Best in family to keep only the newest of each family. New models. auto-include rules expose matching models now and each one a later fetch lists for the first time, and refresh-every has magpie fetch the list again by itself. Image models. OpenRouter’s /models lists text models only, so magpie reads image models such as FLUX, Seedream, Riverflow, Recraft and GPT Image, and their free variants, from /api/v1/models?output_modalities=image. Choose one in Settings → Models → Images. Decision models. OpenRouter’s decision models (liquid/d1, cloudflare/clef, ~typesafe/jev-latest…) are listed too, so a routing group can classify turns with the same key. magpie provider models openrouter +anthropic/claude-opus-5.5 # expose one more magpie provider models openrouter best # newest of each family magpie provider auto-include openrouter '*:free' # every free model, now and later magpie provider refresh-every openrouter 1d"],["agents","In each agent","Pick the model on an agent’s row in the Agents tab, or from a terminal. Each guide says what magpie writes in that agent’s config and how to switch back. magpie claude openrouter/anthropic/claude-opus-5.5 magpie codex openrouter/anthropic/claude-opus-5.5 magpie gemini model openrouter/google/gemini-3-pro magpie opencode openrouter/anthropic/claude-opus-5.5 Claude Code speaks Anthropic Messages, and so does OpenRouter at https://openrouter.ai/api, so its requests are passed on as they are. Models in Claude Code. Codex speaks only OpenAI Responses. magpie translates each request and the reply, streaming and tool calls included: a Claude model goes to OpenRouter’s Anthropic endpoint, every other model to Chat Completions. Models in Codex. Gemini CLI speaks Gemini’s API. magpie translates it the same way as Codex’s requests. Models in Gemini CLI. OpenCode speaks Chat Completions, so its requests go to OpenRouter as they are, except for Claude models, which magpie sends to the Anthropic endpoint for their prompt cache (see below). Models in OpenCode. If OpenRouter says a model isn’t served on the endpoint magpie chose, magpie builds the request again for the other one and remembers that for the model."],["reasoning","Reasoning","Models that always reason. Some OpenRouter models refuse to have reasoning turned off (“reasoning is mandatory for this endpoint and cannot be disabled”). When an agent asks for it off, magpie asks again with the level left to the model, on Chat Completions and on Messages alike. Effort mid-conversation. Claude Code sends a turn’s effort inside the conversation. OpenRouter’s Anthropic endpoint refuses that on some models, such as DeepSeek and GLM. magpie asks again at once without it, and doesn’t send it to OpenRouter again until magpie restarts. Earlier thinking. OpenRouter’s Anthropic endpoint turns away a thinking block without a signature, so magpie always sends one. On Chat Completions, earlier reasoning that an agent sends back in OpenRouter’s reasoning or reasoning_details fields is read as the model’s thinking."],["cost","Cache, cost and credits","Claude’s prompt cache. On Chat Completions, a relay that serves both APIs drops cache_control, and every turn is billed uncached. So magpie asks Claude models on OpenRouter’s Messages endpoint, from any agent, with the cache breakpoints the translation adds. Cache tokens. magpie reads cache reads and OpenRouter’s cache_write_tokens from each reply, so the Usage tab counts cache hits and writes apart from the rest. Cost. The Usage tab prices each call with OpenRouter’s prices from models.dev, or the model maker’s list price when the catalog has none. A model listed at $0, such as one ending in :free, shows free beside it in magpie’s pickers. Which provider answered. OpenRouter names the provider that served each reply. magpie keeps it, and the call’s details in the Usage tab show it as Upstream provider. Credits. The OpenRouter row shows what is left on the account, in dollars: total credits less total usage, read from /api/v1/credits. It’s the whole account’s figure, so each key of one account shows the same."],["keys","Several keys and free models","One OpenRouter provider can hold several keys: press Add another key under it, or paste several at once. Requests go to the first key that’s on, and when it runs out or is rate limited the next one takes over. The provider’s routing can also rotate, weight or drain them instead. Adding the preset again makes a second OpenRouter provider; to spread requests over several keys, add them all to the one provider. Spend caps. spend-cap stops a key at a dollar amount a day, a month or in all, as the Usage tab prices its calls; routing then goes on to the other keys and the fallbacks. Fallbacks. fallback names where requests go when OpenRouter is out of quota or down: another provider’s model or a routing group. Free models. OpenRouter’s free models take 20 requests a minute. rpm holds each key to a rate: one request more waits for room, up to 2 minutes, then gets a 429 with a Retry-After. Free-model 429s. When a free model is refused by the shared pool of the provider serving it, magpie rests that model only and keeps the other free models in use. Any other 429 on a free model is OpenRouter’s account-wide free limit, and the key rests. A pool of free models. A routing group can take every free model OpenRouter lists with the pattern openrouter/*:free, today’s and those it lists later. magpie provider rpm openrouter 20 magpie provider spend-cap openrouter 20 month magpie provider fallback openrouter deepseek/deepseek-v4-pro magpie group add my-free-pool models='openrouter/*:free' routing=order magpie group set opus-anywhere stays=session models+=openrouter/anthropic/claude-opus-5.5"],["trouble","Troubleshooting","The model list has only anthropic/ ids, or fails to load. A provider given only https://openrouter.ai/api gets OpenRouter’s catalog under anthropic/ names it doesn’t serve. Give it the Chat Completions base, https://openrouter.ai/api/v1, or use the OpenRouter preset, which has both. “Mid-conversation reasoning effort (configuration_update) is not supported”. OpenRouter says this about Claude Code’s per-turn effort on models such as DeepSeek and GLM. magpie asks again at once without the effort, so the agent gets its answer, and stops sending it to OpenRouter until magpie restarts. 402 with “can only afford” or “fewer max_tokens”. OpenRouter refused the request’s size or its in-flight budget, not because the balance is spent. magpie rests the key for half an hour and tries it again then; unlike a key out of credit, its rest doesn’t grow with each refusal. Web search asks a model you didn’t pick. It doesn’t: when OpenRouter answers magpie’s web search, magpie asks one of the OpenRouter models you have picked, since OpenRouter can refuse others for your region. For that search magpie turns on OpenRouter’s own web plugin, which works with any of its models. Checking a key. magpie provider test openrouter sends a tiny request through each endpoint, or to each model you name. Add --as codex or --as claude-code to send it the way that agent would. Vercel AI Gateway in Claude Code, Codex and other agents API relays in Claude Code, Codex and other agents"],["faq","FAQ","How do I use OpenRouter in Claude Code? Add your OpenRouter key in magpie (Providers, Add provider, OpenRouter), then pick a model such as anthropic/claude-opus-5.5 on Claude Code’s row, or run magpie claude openrouter/anthropic/claude-opus-5.5. magpie writes Claude Code’s settings.json and passes its requests on to OpenRouter’s Anthropic endpoint as they are. Can Codex use OpenRouter models? Yes. Codex speaks only the Responses API, which magpie doesn’t use at OpenRouter. magpie translates each Codex request: a Claude model goes to OpenRouter’s Anthropic endpoint and every other model to Chat Completions, and the reply comes back to Codex as Responses. Can Gemini CLI and OpenCode use OpenRouter? Yes. Gemini CLI’s requests are translated the same way as Codex’s. OpenCode speaks Chat Completions, so its requests go to OpenRouter as they are, except for Claude models, which magpie sends to the Anthropic endpoint so the prompt cache works. How do I use only OpenRouter’s free models? Make a routing group from the pattern openrouter/*:free, for example magpie group add my-free-pool models='openrouter/*:free' routing=order. It takes every free model OpenRouter lists, including ones it lists later. Models priced at $0 show free in magpie’s pickers. Why do OpenRouter’s free models answer 429? OpenRouter’s free models take 20 requests a minute. Set magpie provider rpm openrouter 20 and magpie holds requests back to that rate. When the 429 comes from the shared pool of the provider serving one free model, magpie rests only that model and keeps the other free models in use. Does magpie show my OpenRouter credits? Yes. magpie reads OpenRouter’s credits endpoint and shows what is left in dollars: total credits less total usage. The figure is for the whole account, so every key of one account shows the same. Why does magpie fetch OpenRouter’s model list from /api/v1? Asked at the Anthropic base, OpenRouter answers with its catalog under anthropic/ names it doesn’t serve. magpie fetches the list from the Chat Completions base, https://openrouter.ai/api/v1, and a provider given only OpenRouter’s Anthropic base is told to add that Chat base. By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Volcengine Ark · Tencent Cloud · Baidu Qianfan · SiliconFlow · ModelScope · Huawei Cloud MaaS · Xiaomi MiMo · StepFun · LongCat · Qwen · MiniMax · Anthropic · OpenAI · Gemini · Grok · Mistral · GitHub Copilot · Ollama Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. Ask on Discord if you get stuck."]]],["/docs/paimon","Paimon",[["","","Paimon (aisk/paimon, installed with uv tool install paimon) is a coding agent in the terminal, built on pydantic-ai. Its settings are one JSON file: the model is provider:name, and each provider keeps its own address and key. magpie adds a provider at the gateway, so Paimon runs on any model in magpie: DeepSeek, GLM, Kimi, Qwen, Claude or a ChatGPT subscription."],["on","Set up Paimon","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Pick a model for Paimon on the Agents page Pick a model via magpie. Restart Paimon Paimon reads its settings when it starts, so a running one keeps its model until it starts again. magpie paimon deepseek/deepseek-v4-pro"],["file","config.json","The file is $PAIMON_CONFIG_HOME/config.json, else ~/.config/paimon/config.json (on Windows too). magpie changes three things: { \"model\": \"litellm:deepseek/deepseek-v4-pro\", \"providers\": { \"litellm\": { \"api_base\": \"http://127.0.0.1:3425/v1\", \"api_key\": \"\" } }, \"compaction\": { \"context_window\": 1000000 } } A model is sent with its own provider's key only. The rest of the file is left alone; with no file, magpie makes one readable by you alone (it holds keys), as Paimon makes it. Paimon in a WSL distro is set up the same way."],["litellm","Why litellm","magpie uses pydantic-ai's litellm provider, an OpenAI-compatible proxy that profiles a vendor/model name by its vendor, as magpie's ids are spelled. Paimon's login doesn't offer it, so it is almost never one of your own. The gateway knows the provider for magpie's by magpie's own key for Paimon."],["window","Context window and compaction","For a name genai-prices doesn't know, which magpie's ids aren't, Paimon compacts against compaction.context_window only, and doesn't compact at all without it. So magpie writes the window it knows the model to take; for a model whose window it doesn't know, your own value, never the last model's."],["off","Switching back","When it first steps in, magpie stashes the model, providers.litellm and compaction.context_window you had. Switching back puts all three back, takes out the empty objects it left, and removes a file it made once nothing is left in it. A model you picked in Paimon since, on a provider of your own, counts as yours and is the one put back. magpie paimon default"],["faq","FAQ","Can Paimon run on DeepSeek, GLM or a ChatGPT subscription? Yes. Pick a via-magpie model for Paimon on magpie's Agents page, then restart Paimon. Why does the model in config.json start with litellm:? magpie goes through pydantic-ai's litellm provider, an OpenAI-compatible proxy that reads magpie's vendor/model ids. Does Paimon still compact its context? Yes. magpie writes the model's context window, which Paimon compacts against; without it Paimon doesn't compact. Does switching back restore my settings? Yes. magpie stashed the model, litellm provider and context window you had and puts them back; the rest of the file was never touched. More agents on the same models: Muse Code on any model, Prime Agent on any model, Pi on any model and PenguinHarness on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/paseo","Paseo",[["","","Paseo (getpaseo/paseo) is an app that runs Claude Code, Codex and others for you. It starts the same Claude Code, so a Claude Code connected to magpie goes through magpie in Paseo too. But Paseo lists models itself, and most of the models magpie serves aren't in its picker. magpie writes them into Paseo's own additionalModels, so Paseo's Claude model picker offers every model you have in magpie: DeepSeek, GLM, Kimi, Qwen, GPT or a ChatGPT subscription."],["on","Set up Paseo","Connect Claude Code to magpie first On magpie's Agents page, pick a magpie model for Claude Code. The ids Paseo lists are served by a Claude Code that is on magpie. Switch Paseo's row on With a ~/.paseo folder, magpie has a Paseo row. Pick magpie: every magpie model in Paseo's Claude model picker. Restart Paseo's daemon Paseo reads its model list when its daemon starts; after a restart magpie's models are there. magpie claude deepseek/deepseek-v4-pro # Claude Code on magpie first magpie paseo magpie # every magpie model in Paseo's picker"],["why","Why Paseo needs its own switch","Claude Code's own /model reads modelPicker in ~/.claude/settings.json, where magpie writes every model when it connects Claude Code. Paseo never reads modelPicker: its list is its own first-party models plus settings.json's model and a few ANTHROPIC_*_MODEL tier variables. So with only Claude Code connected, magpie's models other than the main one and the tiers aren't in Paseo's picker. Paseo also appends agents.providers.claude.additionalModels from its own config, each id passed to Claude Code as written, and that is where magpie writes."],["files","What magpie writes","Paseo's folder is PASEO_HOME, else ~/.paseo. In config.json magpie adds one {id, label, description} entry per model to agents.providers.claude.additionalModels: the same ids, [1m] marks and names as Claude Code's /model, with a description ending via magpie, which is how magpie knows its own entries. // ~/.paseo/config.json {\"agents\": {\"providers\": {\"claude\": {\"additionalModels\": [ {\"id\": \"my-own-model\", \"label\": \"…\", \"description\": \"…\"}, {\"id\": \"…\", \"label\": \"…\", \"description\": \"via magpie\"}, {\"id\": \"…\", \"label\": \"…\", \"description\": \"1M context · via magpie\"} ]}}}} Your own entries keep their place and come first. An id you listed yourself stays yours, and magpie doesn't add it again. A list magpie can't read is left as it is. When magpie's models change, magpie updates its entries."],["restart","When it takes effect","Paseo reads its model list when its daemon starts, so restart Paseo's daemon to see magpie's models; magpie says so while Paseo is running. Claude Code itself must be connected to magpie too, for those ids to be served."],["off","Switching back","Set Paseo's row back to default in magpie: magpie takes out only the entries whose description ends via magpie, and yours stay; with none left, additionalModels goes. magpie paseo default"],["faq","FAQ","Why doesn't Paseo's model picker show magpie's models? Paseo doesn't read Claude Code's modelPicker; it lists its own models, settings.json's model and a few ANTHROPIC_*_MODEL variables. Switch Paseo's row on in magpie and magpie writes every model into Paseo's additionalModels. Does Claude Code need to be connected first? Yes. Paseo passes those ids as written to the Claude Code it starts, and magpie serves them once Claude Code is connected to magpie. I switched it on and still see nothing. Why? Paseo reads its model list when its daemon starts. Restart Paseo's daemon. Will my own additionalModels be changed? No. magpie adds and removes only entries whose description ends via magpie; yours come first and keep their place. More agents on the same models: Models in Claude Code, T3 Code on any model and Craft Agents on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/pencil","Pencil",[["","","Pencil (pen.dev) is a design canvas whose agent runs models. It takes custom providers of your own in ~/.pencil/models.json, in Pi's format. magpie adds a provider named magpie there, so Pencil's model picker lists DeepSeek, GLM, Kimi, Qwen, Claude, a ChatGPT subscription or any other model in magpie."],["on","Set up Pencil","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Set Pencil's provider to magpie on the Agents page Pencil's model picker then lists the models magpie picked for it. Restart Pencil and pick the model in its agent composer Pencil reads its custom models at start-up, so restart it once. The model is picked in Pencil's agent composer, not in a file magpie reads. How magpie finds Pencil: the ~/.pencil folder, there once the app or pen.dev's CLI has run; on a Mac, an app installed and never opened is found as Pencil.app or pen.dev.app."],["file","models.json","Pencil's settings offer a custom provider on OpenAI Completions, OpenAI Responses or Anthropic Messages, set for the provider as a whole. magpie's provider is on OpenAI Completions (Pi's openai-completions) at the gateway's /v1, which the gateway takes for every model: // ~/.pencil/models.json { \"providers\": { \"magpie\": { \"name\": \"magpie\", \"baseUrl\": \"http://127.0.0.1:3425/v1\", \"api\": \"openai-completions\", \"apiKey\": \"\", \"models\": [ { \"id\": \"deepseek/deepseek-v4-pro\", \"name\": \"…\", \"reasoning\": …, \"input\": [\"text\", …], \"cost\": { \"input\": 0, \"output\": 0, \"cacheRead\": 0, \"cacheWrite\": 0 }, \"contextWindow\": …, \"maxTokens\": …, \"compat\": {} } ] } } } Pencil's requests carry magpie's key for Pencil, which is how magpie tells them apart, as Pencil's User-Agent isn't known."],["models","Model fields","Each model carries every field Pencil writes for one. Where magpie knows no better it uses Pi's defaults: a 128K window and 16K out. Every cost is 0, as magpie counts the spend itself. A model's own api and baseUrl are left out: Pi reads them, but Pencil's own editor never writes them."],["yours","Your providers stay","The other providers you set up in Pencil stay as they are. A key in magpie's provider that magpie doesn't write, such as a setting another tool added, stays too. The model list is magpie's alone, so a model gone from the catalog leaves it."],["off","Switching back","When you switch Pencil off in magpie, magpie deletes the magpie provider from models.json and leaves your other providers as they were."],["faq","FAQ","Can Pencil use DeepSeek or GLM? Yes. magpie adds a magpie provider to ~/.pencil/models.json; restart Pencil and pick the model in its agent composer. Why don't magpie's models show in Pencil? Pencil reads its custom models at start-up. Restart Pencil. Which protocol does magpie's provider use? OpenAI Completions, at the gateway's /v1, for every model. Does magpie change my other Pencil providers? No. magpie writes only its own magpie provider. More agents on the same models: OpenPencil on any model, WorkBuddy on any model, Pi on any model and Mistral Vibe on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/penguin","PenguinHarness",[["","","PenguinHarness (Prism-Shadow/penguin-harness, the penguin command, npm @prismshadow/penguin-cli, and a desktop app) keeps each Project's models in one TOML file. magpie adds a provider named magpie and its models there, so PenguinHarness runs on any model in magpie: DeepSeek, GLM, Kimi, Qwen, Claude or a ChatGPT subscription. The CLI and the desktop app read the same file."],["on","Set up PenguinHarness","Add a provider in magpie Add an API key on the Providers page, or sign in to a subscription. Pick a model for PenguinHarness on the Agents page Pick a model via magpie. A running PenguinHarness moves to it at once, with no restart. magpie penguin deepseek/deepseek-v4-pro"],["file",".project_config.toml","The file is under the data root: $PENGUIN_HOME, else ~/.penguin/data on every system. The CLI works in the Project $PENGUIN_PROJECT_ID, else default_project, so the file is ~/.penguin/data/default_project/.project_config.toml. What magpie writes: default_model = { provider = \"magpie\", model_id = \"deepseek/deepseek-v4-pro\" } [providers.magpie] base_url = \"http://127.0.0.1:3425/v1\" client_type = \"openai-responses\" api_key = \"\" [[models]] provider = \"magpie\" model_id = \"deepseek/deepseek-v4-pro\" display_name = \"…\" context_window = … vision = … max_tokens = … [models.pricing] unit = \"usd_per_mtok\" cache_read = … cache_write = … output = … A model is the pair of provider and model_id, and one without an address or key of its own takes its provider's. magpie uses the openai-responses client: requests go to base_url plus /responses, with the thinking level as reasoning.effort, which the openai-chat client leaves out. Your own providers and models stay as they are. With no file, magpie makes one readable by you alone (it holds keys), as PenguinHarness makes it. PenguinHarness in a WSL distro is set up the same way, in ~/.penguin/data there."],["models","The model list","Each of magpie's models is one [[models]] entry, with what PenguinHarness's own Models page records for one: the display name, context window, cap on a reply, whether it reads images, and its price per million tokens. vision is always written, since PenguinHarness takes a model to read images unless told not. PenguinHarness refuses a default_model naming no entry, so magpie writes the entries before the default, and on the way back changes the default before taking them out."],["reload","No restart","PenguinHarness's server reads the file again whenever its modification time moves, so a change needs no restart. Its own Models page and penguin config model … write the whole file back, and every key magpie writes is one it knows, so none is lost. A sync with nothing new leaves the file, and its time, alone."],["off","Switching back","When it first steps in, magpie stashes the default_model you had. Switching back picks it again if PenguinHarness still has it, takes out a vision_model picked among magpie's, then removes magpie's models and [providers.magpie]. A file magpie made is removed once nothing is left in it. magpie penguin default"],["faq","FAQ","Can PenguinHarness run on DeepSeek, GLM or a ChatGPT subscription? Yes. Pick a via-magpie model for PenguinHarness on magpie's Agents page; the CLI and the desktop app both use it. Which file does magpie change? The current Project's .project_config.toml under the data root ($PENGUIN_HOME, else ~/.penguin/data). The default Project is default_project. Do I need to restart PenguinHarness? No. It reads its settings again whenever the file's modification time moves. Does switching back restore my model? Yes. magpie stashed the default_model you had, picks it again if PenguinHarness still has it, and removes the provider and models it added. More agents on the same models: Paimon on any model, Muse Code on any model, Prime Agent on any model and MothX on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/pi","Pi",[["","","Pi, the pi coding agent, takes providers of your own in its models.json. magpie adds itself there, so pi can run on any model you have in magpie: DeepSeek, GLM, Qwen, an OpenAI or Anthropic key, or a ChatGPT or Copilot subscription, with no key pasted into pi. Pi keeps its settings in ~/.pi/agent, or in the folder $PI_CODING_AGENT_DIR names. magpie adds a provider named magpie to models.json, with the gateway’s address, a key of its own and the models you have in magpie, so they join pi’s model picker. Then it sets defaultProvider and defaultModel in settings.json to your pick. A Pi in WSL is set up the same way."],["on","Connect Pi","Add providers in magpie In the Providers tab, add an API key or sign in to a subscription. Pick a model on Pi’s row In the Agents tab, choose a model under magpie. Run pi It starts on that model, and every model of magpie’s is in its model picker. magpie pi deepseek/deepseek-v4-pro # Pi on DeepSeek magpie pi # what Pi runs on now"],["models","What each model gets","Its own API Each model is asked on its provider’s native API: GPT and ChatGPT models on Responses, Claude on Messages, the rest on Chat Completions. A Claude model that thinks only adaptively gets forceAdaptiveThinking. Name, context and replies The name pi shows, reasoning for models that think, contextWindow, image input where the model takes images, and maxTokens. A maxTokens you typed in yourself stays. Thinking level The level you pick in magpie goes in defaultThinkingLevel, held to the levels Pi offers. Pi sends its session with each request (sendSessionAffinityHeaders), so magpie’s usage shows each pi session and Record gateway conversations keeps them. A value you set there yourself stays."],["cycle","The Ctrl+P list","Pi cycles models with Ctrl+P through enabledModels, the list /scoped-models edits. If you have such a list, magpie adds the model you picked to it. If you don’t, magpie never makes one, so Ctrl+P keeps cycling every model."],["ext","Decision and image models","magpie also puts an extension, extensions/magpie.ts, in Pi’s folder. It adds magpie’s decision models and image models, for codemode. It is there while the magpie provider is, and goes with it."],["own","Your own files","Before its first write, magpie copies settings.json and models.json to .before-magpie files beside them. Your own providers and settings stay as they are, and Pi’s row lists your models beside magpie’s."],["off","Switch back","Pick one of your own models on the row, take the row off magpie, or run magpie pi default. If you changed nothing since, magpie puts both files back byte for byte. Otherwise it removes only its own provider and keeps your changes."],["faq","FAQ","Can Pi run on DeepSeek or GLM? Yes. Any model you have in magpie is in pi’s model picker: DeepSeek, GLM, Qwen, GPT, Claude and more. Can Pi use my ChatGPT subscription? Yes. Sign in to ChatGPT in magpie and pick a GPT model under magpie on Pi’s row. pi sends its requests to magpie, which uses the subscription on the Responses API. Where does magpie write if I set PI_CODING_AGENT_DIR? In that folder, with ~ expanded. A relative path is ignored, and magpie uses ~/.pi/agent. Does it work with Pi in WSL? Yes. magpie sets up a Pi in a WSL distro too, its provider pointing at the gateway as the distro reaches it. More agents on the same models: Models in OpenCode, Models in Claude Code, Kimi Code on any model, Cursor Private Inference on any model and Prime Agent on any model. Something fails? See Fixing common errors, or ask on Discord."]]],["/docs/plugins","Plugins",[["","","A plugin signs in to a service and makes its requests. magpie turns it into a provider that every agent can use, with several accounts, failover, usage and the rest. magpie runs OpenCode’s provider plugins, so a plugin written for OpenCode works here unchanged, and it runs pi’s packages that register a provider too (see pi packages). This page covers what a plugin author needs: the hooks magpie calls, what it does with their answers, and how to test, publish and list a plugin. In one paragraph. A plugin is an npm package, a git repository or a folder. Its module exports an async function in OpenCode’s v1 plugin shape. magpie loads every plugin into one Bun process, the plugin host. The function returns hooks: config declares the provider and its default models. auth gives the sign-in methods, plus a loader whose fetch makes each request. provider.models lists the models one account has. auth.usage says how much of the plan is used. It is magpie’s own hook, and OpenCode ignores it. auth.refresh renews an account’s token before it runs out, once at a time. It is magpie’s own hook too. auth.checkin presses the vendor’s daily check-in for an account. It is magpie’s own hook too. An agent can send in any API. The gateway translates the request into the API the model speaks (chat completions, Responses, Anthropic Messages or Gemini), hands it to the plugin’s fetch, and streams the answer back."],["quick","A plugin in five minutes","This example signs in to Acme, a made-up coding plan. Acme takes an API key, has an OpenAI-compatible endpoint, and reports each account’s models and usage. A real plugin differs mainly in how it signs in and signs its requests. This whole example was run against magpie v0.1.676 and a local stand-in for Acme’s API. { \"name\": \"opencode-acme-auth\", \"version\": \"0.1.0\", \"description\": \"OpenCode provider plugin: Acme Coding Plan\", \"type\": \"module\", \"main\": \"./index.mjs\", \"files\": [\"index.mjs\", \"README.md\"], \"keywords\": [\"opencode\", \"opencode-plugin\", \"acme\"], \"license\": \"MIT\", \"magpie\": { \"maxConcurrency\": 4 } } const PROVIDER = \"acme\" const BASE = \"https://api.acme.example/v1\" export const AcmeAuthPlugin = async ({ client }) => ({ // the provider and the models it has before anyone signs in config: async (cfg) => { cfg.provider ??= {} cfg.provider[PROVIDER] ??= { name: \"Acme\", npm: \"@ai-sdk/openai-compatible\", // chat completions api: BASE, models: { \"acme-coder\": { name: \"Acme Coder\", limit: { context: 200000, output: 32000 }, tool_call: true }, }, } }, auth: { provider: PROVIDER, methods: [{ type: \"api\", label: \"Acme API key\", placeholder: \"acme-…\" }], // what every request of this account is sent with async loader(getAuth) { const auth = await getAuth() if (auth?.type !== \"api\") return {} return { baseURL: BASE, async fetch(input, init) { const headers = new Headers(init?.headers) headers.set(\"authorization\", `Bearer ${auth.key}`) headers.set(\"x-acme-client\", \"opencode-acme-auth/0.1.0\") return fetch(input, { ...init, headers }) }, } }, // magpie's own hook: how much of the plan is used async usage(getAuth) { const auth = await getAuth() const res = await fetch(`${BASE}/usage`, { headers: { authorization: `Bearer ${auth.key}` } }) if (!res.ok) return { error: `Acme answered ${res.status}`, windows: [] } const u = await res.json() return { plan: u.plan, windows: [{ name: \"5 hours\", used: u.percent, resetsAt: u.resets_at, span: 5 * 3600 }], } }, }, // the models this account has, asked of Acme provider: { id: PROVIDER, async models(provider, { auth } = {}) { if (auth?.type !== \"api\") return provider.models const res = await fetch(`${BASE}/models`, { headers: { authorization: `Bearer ${auth.key}` } }) if (!res.ok) return provider.models // magpie keeps the list it had const { data } = await res.json() const base = provider.models[\"acme-coder\"] return Object.fromEntries(data.map((m) => [m.id, { ...base, id: m.id, name: m.name ?? m.id }])) }, }, }) Add the folder to magpie, sign in, and try it: magpie plugin add ./opencode-acme-auth # a folder is loaded where it is; nothing is installed magpie plugin login acme # asks for the key magpie plugin # acme (Acme, 2 models) signed in magpie provider test acme # ✓ chat 7 ms · acme-coder magpie quota # acme · Pro · 5h 37% ↻59m Agents now reach its models as acme/acme-coder, the same way as any other provider’s. In the app, open Plugins, click Add a plugin and give it the folder. Then sign in from the provider’s row. Try it in a sandbox. A plugin you are writing should never touch your real magpie. Run magpie with a HOME of its own, as Testing shows."],["run","How magpie runs plugins","Bun. magpie downloads Bun the first time a plugin is added, and runs every plugin on it. Bun runs TypeScript as is, so an entry can be index.ts. One host process. Every plugin that is on loads into one Bun process, started the first time one is needed. magpie and the host talk over stdin and stdout, one JSON message a line. Anything a plugin prints, console.log and process.stdout included, is sent to stderr. magpie logs it as plugin: …. Installing. An npm package is installed with bun add, with its install scripts left unrun, as OpenCode installs plugins. A dependency that needs a postinstall build won’t work. Packages come from the npm registry you already use: the registry= in your ~/.npmrc, install.registry in ~/.bunfig.toml, or NPM_CONFIG_REGISTRY / BUN_CONFIG_REGISTRY in your shell, before the Mirrors in China switch. A token your .npmrc keeps for that registry is sent to it alone. To use another, change npm registry on Plugins → Discover, or run magpie plugin registry (default goes back). A git repository is fetched by Bun: github:owner/repo[#ref], git+https://… or owner/repo. A path to a folder or file is loaded where it is. Restarts. Adding, removing, updating or turning a plugin on or off restarts the host. A reply still streaming through the old host finishes first. Each magpie command in a terminal starts a host of its own, so it always loads a folder plugin as it is now. In the app, turn the plugin off and on to load your edits. Proxy. Every fetch a plugin makes for a provider or an account goes through the proxy the user set for that provider or account. Otherwise it goes through magpie’s own proxy, unless the setting is direct. Loopback addresses never go through a proxy. A fetch that passes its own proxy option is left alone. Updates. The community’s packages (@magpie-community/*) update by themselves a little after magpie starts, then every hour. Any other package with a newer version shows a dot on Plugins, and in the sidebar Installed reads “1 update”. Plugins then opens on Installed, which names the plugins with a newer version at the top beside Update all; the user updates them with a click or magpie plugin update. A spec pinned to a version (name@1.2.3) stays on it until the user updates it: Update to …, Update all and magpie plugin update install the newest version and unpin it. A git repository has no version to compare. It shows an update when its branch or tag (the default branch without #ref) is at another commit than the one Bun installed: GitHub is asked through its API, any other host with git ls-remote, at most every ten minutes, and the hourly check asks again. A spec pinned to a commit never has one. The row shows the commit installed. What magpie keeps, in its config folder (~/.config/magpie, or $XDG_CONFIG_HOME/magpie): File What it holds plugins.json The plugins added: {\"plugins\": [{\"spec\", \"off\"?, \"options\"?}], \"config\"?}. options is the plugin’s second argument, as OpenCode’s [\"name\", {…}] gives it. config is the OpenCode config the plugins are handed. plugins/ The installed npm and git packages, a Bun project of their own. plugin-auth.json The sign-ins (mode 600), in the same shape as OpenCode’s auth.json, so a sign-in can be moved between the two. plugin-providers.json The providers and models the plugins listed last, so magpie can start without asking them."],["package","The package","Where magpie loads it from magpie looks for the server side of a plugin in the same places OpenCode does, and loads the first file that exports a plugin: exports[\"./server\"], then main, then exports[\".\"] (or exports when it is a string), in package.json. Otherwise index.ts, index.tsx, index.js, index.mjs or index.cjs. A path to a single file loads that file. What the module exports export default { id, server } (OpenCode v1): server is the plugin. Otherwise, every function the module exports is called as a plugin, as is every exported { server } object. So don’t export helper functions from the entry file. Put what your tests need on an object instead, as the community plugins do with export const _internal = { … }. The function async (input, options) => hooks // input: { client, project, directory, worktree, serverUrl, $, experimental_workspace } // options: the entry's \"options\" in plugins.json, else undefined // hooks: { config?, auth?, provider?, \"chat.headers\"? } A plugin may return more than one provider by exporting more than one function. Each one’s hooks are separate. When two plugins have an auth hook for the same provider, the one loaded last wins, as in OpenCode. magpie’s fields in package.json OpenCode ignores the magpie object, so these are safe to add to an OpenCode plugin. Field Meaning magpie.icon The plugin’s picture, on its card in Discover (read from npm, or from the repository for one on GitHub) and its row in Installed, and the picture of each of its providers that doesn’t give its own: an https:// URL or a data:image/… URI, at most 1 MB. SVG, PNG and the like. magpie.name The plugin’s name on its row in Installed, and on its sidebar tab when its page gives no title, for a plugin the community’s list doesn’t name (the list’s name wins). The package’s npm name has to be ASCII, so a name like 华为云 HUAWEI goes here. One line, at most 80 bytes; anything else is ignored. It is never shown as reviewed, and never used to find a plugin by name. A repository tagged magpie-plugin shows it on its card under Discover → Unofficial, on GitHub too, in place of the repository’s name. magpie.summary Its card’s line under Discover → Unofficial, on GitHub, by language: { \"en\": \"…\", \"zh\": \"…\" }, in the window’s language (zh-TW reads zh), else English, else GitHub’s description. One line of at most 300 bytes a language; anything else is ignored. A card showing a name or summary of the package’s own says “Its own words”: nobody reviewed them. magpie.maxConcurrency How many requests each account takes at once, a whole number from 1 to 1000. A limit the user sets on the provider wins over it. The same fields can be set on the auth hook (auth.icon, auth.maxConcurrency), where they win over package.json. A plugin that signs in to several providers can give each its own auth.icon and keep magpie.icon for the plugin itself."],["provider","Provider and models","Declaring the provider The provider’s id is auth.provider. If models.dev lists that id, magpie starts from its entry, as OpenCode does. Otherwise, declare the provider in a config hook. Use ??=, so a provider the user configured in plugins.json isn’t written over: config: async (cfg) => { cfg.provider ??= {} cfg.provider[\"acme\"] ??= { name: \"Acme\", npm: \"@ai-sdk/anthropic\", // the API its models speak (table below) api: \"https://api.acme.example/v1\", // where requests go, unless the loader says otherwise models: { \"acme-large\": { name: \"Acme Large\", id: \"acme-large-2026-09\", // the id the API takes, when it isn't the key limit: { context: 400000, output: 64000 }, reasoning: true, tool_call: true, modalities: { input: [\"text\", \"image\"] }, cost: { input: 3, output: 15, cache_read: 0.3 }, // US$ per million tokens; leave out for a plan variants: { low: {}, medium: {}, high: {} }, // reasoning levels }, }, } } A model can also say provider: { npm, api } to use another API or address than the provider’s, headers, options, and disabled: true to hide it. In front of a vendor magpie knows When the provider’s api is the API of a vendor magpie has a preset for (https://api.mistral.ai/v1, https://api.deepseek.com/v1, https://openrouter.ai/api/v1, …), magpie shapes requests to your provider as it does for that vendor before they reach your fetch: Mistral’s thinking parts in place of reasoning_content, DeepSeek’s and xAI’s schema rules, OpenRouter’s free pool, and the rest. There is nothing to add; the base URL you already give is what it reads, even when your loader’s baseURL sends elsewhere. A base on no preset’s host, on localhost or on your network gets no vendor’s handling. An upstream that searches the web When your plugin sits in front of Anthropic’s or OpenAI’s own API, which runs the hosted web search tool itself, set searches: true on the provider in the config hook. A client’s web search (Claude Code’s WebSearch, Codex’s web_search) then reaches your fetch as it was sent, on the provider’s Anthropic or Responses models, rather than going through magpie’s own search. Its Chat models are unaffected. magpie doesn’t search with it for other models by itself, but it can be named as the searcher in Settings. A decision API (System One) A plugin can serve TypeSafe’s System One API for its provider, so its models can be a routing group’s classifier. Set decide: true on the provider in the config hook, and decides: true on each model that answers questions rather than a conversation, in the config hook or on the models hook’s list. magpie then posts each question as POST {baseURL}/systemone through your loader’s fetch, with the account’s sign-in, as it sends any other request. The body is {\"model\", \"questions\", \"state\"}; answer {\"model\", \"answers\": {\"\": {\"choice\", \"score\", \"confidence\"}}}. A marked model, and one named jev-*, is offered as a classifier and kept from agents: a chat request to it is refused. Without decide: true on the provider, decides is ignored and every model stays one to chat with. The API a model speaks The AI SDK package named by npm, on the model or on the provider, decides the API. That decides the shape of the request your fetch receives. Whatever the agent sent, magpie’s gateway has already translated it: npm API Path after the base @ai-sdk/anthropic, @ai-sdk/google-vertex/anthropic Anthropic Messages /messages @ai-sdk/openai, @ai-sdk/azure OpenAI Responses /responses @ai-sdk/google Gemini /models/:streamGenerateContent?alt=sse @ai-sdk/github-copilot Responses for GPT-5 and later (not gpt-5-mini), chat completions for the rest /responses or /chat/completions anything else (@ai-sdk/openai-compatible, xai, groq, deepseek, …) Chat completions /chat/completions The base is chosen in this order: the loader’s baseURL; the model’s provider.api; the provider’s api; the AI SDK package’s own default (https://api.anthropic.com/v1, https://api.openai.com/v1, …). The body’s model is the model’s API id: its id, else its key. Each account’s models When the models depend on the account, add a provider hook: provider: { id: \"acme\", async models(provider, { auth }) { // provider.models: what models.dev and the config hook give, keyed by id // auth: this account's sign-in, as plugin-auth.json keeps it return { \"acme-large\": { ...provider.models[\"acme-large\"], name: \"Acme Large\" } } }, } magpie calls it once for each account, in that account’s scope and through its proxy. Each account serves only the models listed for it, so an account on a smaller plan isn’t sent a model it doesn’t have. A model is OpenCode’s Model: id, name; api: {id, url, npm}; limit: {context, input?, output}; capabilities: {reasoning, toolcall, attachment, input: {text, image, …}}; cost: {input, output, cache: {read, write}}; variants, release_date, status. Spreading a model from provider.models and changing a few fields is the easy way. A model whose status is \"deprecated\" isn’t shown. magpie also reads these fields on a model, which OpenCode ignores: free: true: the plan serves it at no cost to its allowance. Only this flag makes a model free, and magpie never reads it from rate: set it from the vendor’s own word (its list marks the model free, or prices it at $0), not from a rate you worked out. rate: the credits a request costs, as a multiple, given as a number (0.5) or as the vendor writes it (\"x0.5\"). 0 reads as no rate given, not as free. rateWas: the rate before a discount that is running now. Model pickers show them. serviceTiers, on a model the models hook gives: the service tiers its vendor serves it at, as ids, such as [\"priority\", \"ultrafast\"]. Codex is offered them in its model list (priority as Fast), and a Chat or Responses request that asks for one of them reaches your fetch with its service_tier. A tier the model doesn’t list isn’t sent where magpie translates the request. The keys of variants become the model’s reasoning levels when it reasons. When the vendor can’t be reached magpie keeps the list it already had, as it does for a built-in subscription whose list couldn’t be fetched, when the hook does any of these: returns provider.models unchanged after a fetch that failed; throws; returns a list of its own with list[Symbol.for(\"magpie.fellBack\")] = true. If what failed was the sign-in, throw an error with signIn: \"expired\" on it. The account is then marked as needing a new sign-in (see Sign-in state)."],["signin","Signing in","The auth hook is { provider, methods, loader, usage?, refresh?, refreshLead?, checkin?, icon?, maxConcurrency? }. Each method is a way to sign in that the user can pick. In the app the methods are buttons; in a terminal, magpie plugin login [] asks which one. An API key { type: \"api\", label: \"Acme API key\", placeholder: \"acme-…\" } label titles the key’s field. A label that only says “API key” is shown as “Acme API key”. placeholder is magpie’s own field, a hint inside the field. Without an authorize function, the key is saved as is: {type: \"api\", key, metadata?}. Answers to prompts go in metadata. With authorize(inputs), the plugin checks or exchanges the key itself. It returns {type: \"success\", key, metadata?} or {type: \"failed\", error?}. A browser or device sign-in { type: \"oauth\", label: \"Sign in with Acme\", async authorize(inputs) { const d = await startDeviceCode() return { url: d.verification_uri, // magpie opens it instructions: `Enter the code ${d.user_code}`, // and shows this method: \"auto\", // \"auto\": callback() resolves on its own async callback() { // \"code\": callback(code), the code the user pastes const t = await pollForToken(d) if (!t) return { type: \"failed\", error: \"The code expired\" } return { type: \"success\", refresh: t.refresh_token, access: t.access_token, expires: Date.now() + t.expires_in * 1000, accountId: t.email } }, } }, } A success with refresh is saved as {type: \"oauth\", refresh, access, expires, …}, with every other field you return kept beside them (accountId, enterpriseUrl, your own). A success with key is saved as an API key. provider: \"other-id\" on the result saves the sign-in to another provider the plugin signs in to. error on a failure is magpie’s own field: the user sees why (up to 500 characters). Without it, they see only that the sign-in failed. When authorize can’t start the sign-in, throw, or return {type: \"failed\", error} with no callback: the user sees that reason. A sign-in the user cancels, or that times out, is over: whatever callback returns after it is dropped, and the fetches it makes for it fail. magpie also passes the sign-in’s AbortSignal as callback(code, { signal }) (and authorize(inputs, { signal })), so a callback that waits a long time can stop when it aborts. inputs is passed only to a method with prompts. A method without prompts gets undefined, as OpenCode’s TUI calls it. An empty object is how OpenCode’s CLI calls, and some plugins then ask on the terminal. Questions before signing in A method’s prompts are asked in order before authorize, each only when its condition holds: prompts: [ { type: \"select\", key: \"region\", message: \"Region\", options: [{ label: \"Global\", value: \"global\" }, { label: \"China\", value: \"cn\", hint: \"acme.cn\" }] }, { type: \"text\", key: \"team\", message: \"Team id\", placeholder: \"t-…\", when: { key: \"region\", op: \"eq\", value: \"global\" }, // or condition: (inputs) => boolean validate: (v) => (/^t-/.test(v) ? undefined : \"Starts with t-\") }, ] A type: \"password\" question is a text one typed unseen: a masked field in the app, and no echo in magpie plugin login on a terminal. Use it for a token or a personal access token. It is magpie’s own type: OpenCode’s are text and select. Accounts Where they are kept. A provider can be signed in to more than once. The first account is kept under the provider’s id, as OpenCode keeps it. Others are kept under id#xxxxxx. How the user tells them apart. magpie names an account by accountId, else metadata.email, else email. Save one of them, an email where you have one. Signing in again. A new sign-in replaces an existing account when both have the same accountId. Where both also have a uid (the vendor’s own id, for vendors whose names can repeat), it must match too. Without an id, the same secret matches. Otherwise the sign-in becomes a new account. Scope. Every call magpie makes for an account runs in that account’s scope: getAuth() returns that account. client.auth.set({ path: { id: \"acme\" }, body }) saves to that account. So keep per-account state by the auth you were given, not in a module variable keyed by the provider. Refreshing. Give auth.refresh and magpie renews the token for you (see Renewing a sign-in). Otherwise, when a token runs out, refresh it in fetch and save the whole object with client.auth.set. What you give replaces what was kept; nothing is merged. Renewing a sign-in From magpie 0.1.684, a plugin can leave renewing its tokens to magpie with auth.refresh, magpie’s own hook (OpenCode ignores it): auth: { provider: \"acme\", methods: [ … ], // optional: how long before expires to renew (ms), 5 minutes by default refreshLead: 5 * 60 * 1000, async refresh(auth, provider) { // auth is the account's saved sign-in const t = await exchange(auth.refresh) if (t.error === \"invalid_grant\") throw Object.assign(new Error(\"Acme refused the sign-in\"), { signIn: \"expired\" }) return { access: t.access_token, refresh: t.refresh_token ?? auth.refresh, expires: Date.now() + t.expires_in * 1000 } }, loader: async (getAuth) => ({ … }), // getAuth() already gives the renewed token } When it runs. For an OAuth account whose expires is less than refreshLead away, before the account’s loader, provider.models, auth.usage or a request. An account with expires 0 or none is never renewed. Once at a time. Requests that find the token due wait for one renewal, so a vendor that spends a refresh token once never sees it twice. They wait up to 15 seconds; a renewal that takes longer is still saved when it ends. What is saved. The fields you return are kept over the account’s old ones (merged, unlike client.auth.set), and the account’s mark is cleared. Return nothing when there is nothing to renew. When it fails. The account is left as it was and the request goes on with the old token, for the vendor’s answer to tell. An error with signIn: \"expired\" marks the account (see Sign-in state), and magpie doesn’t try again until it is signed in again. Any other error is tried again after 30 seconds. OpenCode and older magpie. They ignore the hook. Keep the check in your fetch too if the plugin runs there: under magpie it finds the token fresh and does nothing."],["requests","Requests","loader(getAuth, provider) runs once per account and is run again after its sign-in changes. It returns what OpenCode would give the AI SDK: Field What magpie does with it baseURL Where requests go, ahead of the model’s and provider’s api. apiKey Sent as the AI SDK package sends it: x-api-key for Anthropic, x-goog-api-key for Google, Authorization: Bearer otherwise. For an API-key sign-in, it defaults to the saved key. headers Added to every request. fetch Makes the request. Without it, magpie’s host uses the standard fetch. The request your fetch(input, init) receives: input is the full URL: the base plus the path for the model’s API. init.method is usually POST. init.headers are set in this order, each overriding the one before: the key header from apiKey; the loader’s headers; the gateway’s request headers; what chat.headers hooks add. init.body is the JSON string in that API’s shape (bytes when it isn’t UTF-8 text). model in it is the API id, and stream is whatever the agent asked for. init.signal aborts when the agent gives up on the request. Return a Response. Its status, headers and body go back as they come, streamed chunk by chunk. If you rewrite a streaming body, drop content-length and content-encoding from the headers. Failures and failover A non-2xx response is the vendor’s answer. The gateway handles it as it would any provider’s: a rate limit or a server error moves the request to the next account or model, and a 401 marks the account (see Sign-in state). Answer a model the account may not use with 403 or 404 and the vendor’s words, not 401: the gateway reads that as the model refused, not the sign-in. A thrown error fails the request, and failover moves on. Answer in the API’s own error shape where you can, so the agent shows the vendor’s message. chat.headers OpenCode’s chat.headers hook runs for every request. Its input.sessionID is magpie’s conversation id, which stays the same across a conversation’s turns. Use it for a vendor’s session or cache header: \"chat.headers\": async (input, output) => { if (input.model.providerID === \"acme\") output.headers[\"x-acme-session\"] = input.sessionID }"],["signin-state","Sign-in state","magpie marks an account whose sign-in the vendor refused. It shows the mark to the user and stops sending to the account until it works again. By default a 401 marks the account and a success clears the mark. A plugin can say more precisely what an answer means with the X-Magpie-Sign-In response header, which magpie removes before the answer goes on: Value Meaning expired The sign-in was refused, whatever the status (a vendor that answers 403 or 502 for it). kept Leave the account as it is (a 401 that is about something else). renewed The sign-in renewed: clear the mark, whatever the request then met. A 401 without the header whose body says only that the model isn’t served (“model … not available”, model_not_found, “模型不支持”) and nothing of a token, key, session or sign-in is read as kept. Before, it marked every account the request failed over to as needing a new sign-in. A 401 that names the model and also says the token is invalid still marks the account. From fetch or provider.models, throw an error with signIn: \"expired\" on it for the same effect: throw Object.assign(new Error(\"Acme refused the sign-in; sign in again\"), { signIn: \"expired\" })"],["usage","Usage","auth.usage(getAuth, provider) is magpie’s own hook. It says how much of an account’s allowance is used. It runs in the account’s scope, so a token it refreshes is saved to that account. magpie shows its answer on the account in Providers, in magpie quota and at GET /v1/magpie/quotas on the gateway. Every field is optional: { plan: \"Pro\", user: \"ada@example.com\", // the account as the vendor names it until: \"2026-11-01T00:00:00Z\", // the plan's end renew: \"auto\", // or \"off\" balance: \"$12.40\", error: \"\", // shown in place of the windows windows: [{ name: \"5 hours\", used: 37, // percent; past 100 when overspent resetsAt: \"2026-10-03T18:00:00Z\", // or resetSecs: 3600 span: 18000, // seconds the window runs display: \"370 / 1000 credits\", amount: 370, limit: 1000, unit: \"credits\", // its own count, when it counts amounts model: \"opus\", // counts only models whose ids hold this word models: [], notModels: [], // or exactly these ids, or all but these family: \"Gemini\", pool: \"Gemini\", // a model's family, and the group sharing its allowance: the card shows a pool's own windows (no model, no family) in place of its models' aside: false, // true: using it up doesn't stop the account runsOutAt: \"2026-10-05T00:00:00Z\", runsOut: 120, // when the soonest credits left are lost, and how many balance: 6291, // a prepaid wallet: what is left, in unit; no used or limit }], resets: { count: 2, until: \"…\", byWindow: false, fiveHour: 1, weekly: 1 }, // resets the account may spend signIn: \"kept\", // as X-Magpie-Sign-In } Times are ISO strings or epoch numbers, in seconds or in milliseconds. Without signIn, an error that says to sign in again marks the account, and a clean read clears the mark. Leave used out when the vendor doesn’t tell it, never send 0 for “not known”. Left out with amount and limit, the share is theirs (370 of 1000 is 37 used). Left out with no count, the window is its display alone: routing doesn’t read it, and an account whose windows all say nothing is weighed as one never read, not as the one with the most left. A window with aside: true is shown on the account’s card, with its share and count, and in GET /v1/magpie/quotas, but routing never reads it: using it up doesn’t stop the account or weigh it against the others, whatever amount and limit say. Leave aside off a window the account really stops at."],["checkin","Check-in","A vendor that gives credits for a daily check-in can have the plugin press it with auth.checkin, magpie’s own hook (OpenCode ignores it). magpie runs it for each signed-in account once a Beijing day while the user has check-in on for the provider, and shows what came of it on the account’s Usage card and in Settings. auth: { provider: \"acme\", async checkin(getAuth, provider) { const auth = await getAuth() const r = await claim(auth.access) if (r.already) return { outcome: \"done\" } return { outcome: \"claimed\", credit: r.points, streak: r.days, message: r.text } }, } It answers { outcome, credit?, streak?, message? }: outcome Meaning claimed Checked in now. credit is what it gave. done Checked in already today. A vendor that answers 2xx with nothing left to claim is done, not failed. ineligible The account can’t take part. inactive No check-in is running. captcha The vendor asks for a captcha. Never solve it: the user checks in in the vendor’s own app. failed It didn’t work. magpie asks again later that day. streak is the days in a row, and message is shown as it is. A hook that throws, or answers no outcome above, is failed. It runs in the account’s scope, so a token it renews with client.auth.set is saved to that account."],["load","Model load","A vendor that queues requests to a busy model can have the plugin say how busy each model is, with input.magpie.load(provider, loads), magpie’s own (OpenCode has none). loads maps a model id to a percent from 0 up, or to null to say it isn’t known any more. The plugin calls it whenever it likes, from its own timer: magpie doesn’t ask for it. export default async (input) => { const report = async () => { const r = await fetch(`${BASE}/load`).then((r) => r.json()).catch(() => null) if (r) input.magpie?.load?.(\"acme\", { \"acme-large\": r.large, \"acme-small\": r.small }) } report() setInterval(report, 60_000) // within five minutes, or the load is unknown again return { auth: { /* … */ } } } Values. 100 is as busy as the vendor serves at once; a vendor that queues reports past it (200 is twice that). A number below 0 counts as 0, and one past 10000 as 10000, a sanity cap. Anything else (a string, NaN) is dropped. Model ids match whatever their case, and model@256k has its model’s load unless reported itself. One call takes up to 1000 models and returns how many it took. A provider that isn’t a string, or a loads that isn’t an object, throws a TypeError. Freshness. Each model’s load counts for five minutes from the call that reported it. After that it is unknown, never 0: a plugin that stops calling leaves its models where they were. A model a call doesn’t name keeps its last load until its own five minutes run out. Where it shows. The provider editor shows it by the model, a small grey number. Routing. With Settings › Models › Routing › Busy models last set (Off by default; over 50, 70, 80 or 90%, or Custom… for any number from 1 to 9999, such as 150 for a vendor that queues), a model reported busier than that goes behind every other candidate a request could go to, ahead of those resting after a failure. A conversation it answered moves to the one that leads at its next turn; within a turn it stays. A model with no load known keeps its place. The Routing trace says busy with the load. A plugin written for older hosts checks input.magpie?.load first, as above."],["input","What a plugin is given","magpie hands a plugin what OpenCode’s PluginInput has, as far as it has meaning without an OpenCode server: Field In magpie client.auth.set / .remove Saves or forgets the sign-in of the account in scope. client.app.log Writes to magpie’s log as plugin [level]: [service] message. client.tui.showToast Written to magpie’s log. client.config.get The config after every plugin’s config hook. any other client.* Answers { data: undefined }. directory, worktree magpie’s config folder, a place to keep files. project { id: \"magpie\", worktree }. $ Bun’s shell. serverUrl A placeholder; no OpenCode server is behind it. magpie.option, .options, .load magpie’s own: the plugin’s options as the user set them, and its models’ load. The hooks magpie calls are config, auth (its methods, loader, usage, refresh and checkin), provider.models and chat.headers. A plugin’s other hooks (tool, event, chat.params, …) are not called. The agent runs its own tools."],["ids","Provider ids","Agents name a plugin’s model as /, where the id is the plugin’s auth.provider. When the id is taken in magpie, by a built-in subscription, a preset (google, openai, anthropic, …) or magpie itself, the plugin’s provider is named -plugin. Pick an id that is only yours. The community’s plugins for magpie’s deprecated built-in subscriptions are the exception. They use the built-in’s id (cursor, zed, …) and take it over once the user moves onto the plugin, so agents keep working unchanged. When two installed plugins sign in to the same id, such as a published plugin and your own copy of it, one of them serves it: the one picked for it, otherwise the one added last. Both stay in Plugins → Installed, and each row says which one serves the provider. Use for … on the other row, or magpie plugin use , makes the pick."],["test","Testing","Run magpie in a sandbox, so your own magpie, its agents and sign-ins are never touched: sb=$(mktemp -d) m() { env HOME=$sb XDG_CONFIG_HOME=$sb/.config XDG_CACHE_HOME=$sb/.cache MAGPIE_ADDR=127.0.0.1:3499 magpie \"$@\"; } m plugin add ./opencode-acme-auth runs it in a sandbox like the one above."],["publish","Publishing and listing","npm. Publish the package as usual. Users add it by name (magpie plugin add opencode-acme-auth), by a version (…@0.2.0), from git, or from a folder. Search. The search on Plugins asks npm for opencode. It shows a package whose name or keywords hold opencode and one of auth, plugin or provider. Keywords like [\"opencode\", \"opencode-plugin\", \"\"] do it. It also asks for keywords:pi-package and shows a pi package whose name or keywords mention auth or provider. README. A plugin’s page in magpie shows its npm README. Say what it signs in to, how, where the sign-in is kept, and which models it has. The list. Plugins suggests the plugins in registry.json of the community repository. magpie fetches it at most every six hours and builds in a copy for when it can’t. To be listed, open a pull request adding an entry: { \"package\": \"opencode-acme-auth\", \"name\": \"Acme\", \"icon\": \"https://acme.example/icon.svg\", \"providers\": [\"acme\"], \"summary\": { \"en\": \"Your Acme Coding Plan.\", \"zh\": \"使用你的 Acme Coding Plan。\" } } A middleware’s entry has \"kind\": \"middleware\" and no providers; it is listed under Gateway middleware. The other kinds are listed the same way: \"kind\": \"tools\" under Tools for agents, \"kind\": \"page\" under Pages and \"kind\": \"agent\" under Agents. Those sections hold the community’s own packages, whose entries have \"community\": true. A package published from your own repository leaves that out: it isn’t in the sections, the search on Plugins finds it by its name, summary or publisher, and its card shows its npm publisher, not the magpie community badge. MAGPIE_PLUGIN_MARKET= points magpie at another list, which is useful to check yours, and off keeps to the built-in copy. A GitHub topic. A repository tagged magpie-plugin on GitHub is shown under Plugins → Discover → Unofficial, on GitHub, the most starred first, marked as reviewed by no one. Keep package.json at the repository’s root. Published to npm with repository naming the repository, it is installed from npm; otherwise from the repository as it stands, so the file it loads must be committed: one whose dist is built only to publish is left out. Forks, archived repositories and magpie-community’s own are left out too. magpie asks GitHub at most every ten minutes, so a repository shows within minutes of being tagged. Its card shows the icon \"magpie\": { \"icon\": \"…\" } in its package.json gives, else a puzzle piece. Its licence is the one GitHub reads from the repository’s LICENSE file; when GitHub can’t match the file to a licence (it says NOASSERTION, as for MIT’s text with a line added) or there is none, the card shows package.json’s license. A plugin installed from npm shows package.json’s. The community packages. To contribute one to magpie-community/plugins: Put it under packages/, named @magpie-community/opencode--auth (a provider) , @magpie-community/middleware- (middleware or a routing strategy), @magpie-community/tools- (tools), @magpie-community/page- (a page) or @magpie-community/agent- (an agent), with no runtime dependencies unless one is really needed. Pushing a version bump to main publishes it. These packages update by themselves in every magpie."],["gateway-request","Async gateway request hooks","A plugin can await I/O before an agent request is routed, for example to recall project context. Declare \"magpie\": { \"hooks\": \"./hooks.js\" } in package.json, or add a *.hooks.js / .mjs / .ts / .mts file (Bun runs TypeScript without a build step). Export a named async onRequest(body, ctx). A gateway-only package needs no OpenCode main/exports. Optional async onResponse(reply, ctx) receives a best-effort completion notification after output finishes. It cannot change the reply and never holds the live stream. Client tool declarations and tool loops stay with the client. Optional async onSignIn(event, ctx) hears of a subscription account that has to be signed in again: event is {provider, providerName, account, state, endsAt?}, state signed-out, or ending for a Claude sign-in within three days of its end. It is told once until the account works again, and carries no token. A hooks file may export only onSignIn. It runs in Bun once per agent request, before the JS gateway middleware, for every provider, Codex's own ChatGPT sign-in included. body is the agent API object. ctx contains protocol, model, stream, path, agent, session, cwd, query, options and signal. The query is the latest user text, excluding tool results and images. Missing identity fields are empty; authorization headers are never included. Return an object to replace the request, or undefined to keep it. A hook that changes the model, streaming, the client's tools or its tool choice is rolled back, as a failure, and gets no onResponse for that request. Each hook receives a clone; mutations from failed or undefined hooks are discarded. Successful changes follow enabled plugin order. Each hook defaults to one second; gatewayTimeoutMs accepts integers from 100 to 30000 milliseconds; a value outside that range is clamped to the nearer bound. The chain sums budgets, clamped to 2–10 seconds, or takes the longest hook's own timeout when that is longer; host startup is bounded to 11 seconds, and startup plus RPC to the chain budget plus one second (at least 11 seconds). Settings → Plugins offers JSON options and call, latency, failure and outcome diagnostics. ctx.report(code, bytes) accepts ready/empty/unbound/unauthorized/unavailable/invalid/skipped and byte counts only. Statistics reset on reload and retain no private text. Use ctx.signal with fetch. Errors, invalid returns, timeouts and a host busy starting keep the request. Bun plugins have host privileges; install trusted code. Install with magpie plugin add ./my-plugin; save options with magpie plugin options my-plugin '{\"serverUrl\":\"http://127.0.0.1:8000\"}'. On/off and options changes reload the host; source-only edits need a configuration reload. Internal title/classifier requests skip the hook."],["middleware","Gateway middleware","A plugin can also be gateway middleware: code that magpie’s gateway runs on every request an agent sends it, before the request is routed, and on the reply on its way back. It can give a model another name, add to the system prompt, turn a request away, change or hide what the model says, or keep its own count of what goes through. It works with every provider, a plugin’s or not. // alias.middleware.js export const events = [\"message_start\"] export function onRequest(body, ctx) { ctx.state.asked = body.model if (body.model === \"fast\") body.model = \"deepseek/deepseek-chat\" if ((ctx.options.blocked ?? []).includes(body.model)) return ctx.reject(403, \"not this model\") return body } export function onEvent(ev, ctx) { ev.message.model = ctx.state.asked // the agent sees the name it asked for return ev } magpie plugin add ./alias.middleware.js # or a package whose package.json has \"magpie\": { \"middleware\": \"./mw.js\" } Ready-made middleware The community repository has middleware ready to add, most of it what New API does for its channels, taking the same JSON. They are under Plugins → Discover → Gateway middleware, and every card there says whether it is a provider or middleware. Package What it does param-override New API’s param_override: set, delete, move, copy or rewrite fields of the request, for some models or under conditions, or turn a request away. A param_override copied from New API works unchanged. model-map New API’s model_mapping: send a model under another name, by name or /pattern/. Replies name the model the agent asked for. system-prompt A system prompt of yours on every request, or only some agents’ or models’, in each API’s own place. A request with its own keeps it unless override is on. word-guard New API’s sensitive-word filter: turn away or mask words and patterns in what users send, and in replies if you like. think-tags Take a … block out of the start of a reply’s text, or put a Chat reply’s reasoning_content into it (New API’s thinking_to_content). antigravity-cloak Breaks up the words Antigravity turns Claude Code’s and the Agent SDK’s system prompts away for, in what it sends Antigravity only. Other providers are sent the prompt as it was. magpie plugin add @magpie-community/middleware-model-map magpie plugin options model-map '{\"mapping\": {\"fast\": \"deepseek/deepseek-chat\"}}' Options A middleware reads its settings from ctx.options, which are its entry’s options in plugins.json. Set them in Plugins → Installed with the middleware’s Options button, which edits them as JSON in its row, or with magpie plugin options '' (off clears them). The name can be the package’s, its spec, or its short name: model-map for @magpie-community/middleware-model-map. They apply from the next request on. A package can suggest options with \"magpie\": { \"options\": { … } } in its package.json: the editor starts from those when none are set, but a middleware runs with no options until you save some. A key that a provider plugin declares as a switch (its editor’s Plugin options, such as Cursor’s wire_trace) is saved as that switch: magpie plugin options cursor '{\"wire_trace\": true}' turns it on, and off puts every switch back to the plugin’s default. How it runs Middleware isn’t run on Bun. It runs inside the gateway’s own process, in moejs, a JavaScript engine written in Go, because a reply streams thousands of events and each one waits for it. A hook on one event costs about a microsecond; a round trip to Bun would cost tens. Each middleware is compiled once, and each request gets a runtime of its own, so requests run in parallel and a request’s hooks share ctx.state. Declaring it. \"magpie\": { \"middleware\": \"./mw.js\" } in package.json, or a single file named *.middleware.js (or .mjs). A package with no main and no exports is only middleware, and the plugin host leaves it alone; one with both is a provider plugin and middleware at once. Imports. Only files inside the plugin, by relative path. There is no node_modules here: bundle what you import into the file. What it has. Standard JavaScript and console.log (into magpie’s log, at most 60 lines a minute). There are no timers, no fetch and no Node APIs. A hook may be async, but there is nothing for it to wait on. Changes. magpie looks at the files and plugins.json once a second, and loads a middleware again when they changed. The hooks Each is a named export or a member of export default { … }. Bodies and events are in the agent’s own API (ctx.protocol), not the provider’s. Return the object to send on, or nothing to send it on as it was. Hook Is given Returns onRequest(body, ctx) The request body, before routing: a new model routes it elsewhere. The body, or nothing. ctx.reject(status, message) turns the request away with that error, in the agent’s API (403 when no status is given). onAccount(account, ctx) The subscription account a try is about to go to, before anything is sent: account has ref, provider, name, kind (such as codex or claude) and model. ref stands for the account without naming it: 32 hex characters, the same on every request and after magpie restarts, and different for each middleware, so a middleware can remember an account without ever being told its email or id. A new plan gives the account a new ref. Not called for an API key. ctx.account is the same object in the hooks after it for that try. {skip: true} passes the account over for this request: the next account or key is tried, and the account isn’t rested or held against. When every one is passed over, the agent gets the usual error that none is ready, and nothing is sent. Anything else, or nothing, uses the account. onProvider(body, ctx) The request body as it is about to go to one provider; ctx.provider has its id, name, account (the subscription’s kind, such as claude or antigravity; absent for an API key) and model. It is called again for each provider a request is tried on, each time with the body onRequest left, so a change for one provider reaches no other. The body, or nothing. The request is routed by now: it can’t be turned away or sent elsewhere. onEvent(event, ctx) Each event of a streamed reply: its data: JSON. The event, nothing, or null to leave the event out. onResponse(body, ctx) A reply that isn’t streamed, whole; ctx.status is its status. The body, or nothing. export const events = [\"content_block_delta\"] calls onEvent only for events of those names (Anthropic Messages and Responses name theirs). Chat Completions and Gemini events have no name, so leave events out for them. An event holds a piece of the reply, so a word can be split over two events. A data: [DONE] line and comments pass by unseen. A compressed reply passes as it is. ctx has protocol (anthropic, chat, responses or gemini), model and stream as the agent asked, path, agent when magpie knows it, options (the plugin’s options) and state, an object of the request’s own. When a hook fails A hook has 250 ms for a request, a provider’s try or a whole reply and 50 ms for an event; loading has a second. A hook that throws, runs out of time or returns something else goes on as if it weren’t there: the request or the event is sent as it was. Settings → Plugins shows each middleware’s hooks, how many calls it had, the average time each took and how many failed, with the last error. The hooks see what the agent sent and gets back, before magpie’s redaction on the way out and after it on the way back. magpie’s own requests (thread titles, the router’s classifier, the web searches and image descriptions it makes for an agent’s request) don’t go through middleware. Routings and usage rows The same module can also export strategies and onUsage. Such a file can be named *.gateway.js, and a package can say \"magpie\": { \"gateway\": \"./gw.js\" }. Routings. Each strategies[name] is a routing named / (the package’s short name, or the file’s name without .gateway.js), offered in every routing picker of a provider, a pool and a group while the plugin is on. It is a function (pool, seats, options), or an object with order, and returns the order to try the seats in, as indexes. Each seat has key, account, known, learns, used, soon (when its windows renew, in ms), pace, weight, resting and tokens (what it was sent lately). It has 20 ms; if it throws, takes longer or returns something else, the seats are tried in their listed order. Off, a provider or group routed by it is too. Usage. onUsage(row, options) gets each request’s usage row after it ends: provider, account and key, model, tokens, ms, ttftMs, status, error type and cost, never a body, prompt or error text. It runs on its own, so a request never waits for it; rows that come while it is busy past a queue are dropped and counted. It has 250 ms. // spread.gateway.js export const strategies = { \"fewest-tokens\": (pool, seats) => seats.map((_, i) => i).sort((a, b) => (seats[a].resting - seats[b].resting) || (seats[a].tokens - seats[b].tokens)), } let slow = 0 export function onUsage(row, options) { if (row.ms > (options.slowMs ?? 30000)) { slow++ console.log(`slow: ${row.provider} ${row.model} ${row.ms} ms (${slow} so far)`) } } magpie plugin add ./spread.gateway.js magpie group set fast routing=spread/fewest-tokens"],["tools","Tools for every agent","A plugin can give tools, with OpenCode’s tool hook, and magpie offers them to every agent, not only OpenCode: they are an MCP server of magpie’s own at /mcp/magpie/tools (Streamable HTTP). Add that address to any agent that takes an MCP server, and its model can call every tool your plugins that are on give. Each is named _, the plugin’s short name first: weather-tools_now below. import { tool } from \"@opencode-ai/plugin\" export const WeatherTools = async () => ({ tool: { now: tool({ description: \"The weather now in a city.\", args: { city: tool.schema.string().describe(\"A city, e.g. Berlin\") }, async execute({ city }, ctx) { const r = await fetch(`https://wttr.in/${encodeURIComponent(city)}?format=3`, { signal: ctx.abort }) return await r.text() // text; an object is sent as its JSON }, }), }, }) magpie plugin add ./weather-tools claude mcp add --transport http magpie-tools http://127.0.0.1:3425/mcp/magpie/tools # Claude Code; other agents take the same address Settings → Plugins lists each plugin’s tools by these names and copies the server’s address. args is a zod shape (tool.schema is zod), a zod object or a JSON Schema object. The agent is shown it, and magpie checks a call’s arguments against it before execute runs; a wrong argument is answered as an error naming it. ctx is OpenCode’s, with agent the agent that called. A tool has 55 seconds, and ctx.abort fires when they are up. The built-in plugin Plugin tools serves the server. It stays on while a plugin that is on gives a tool; off, no tool is listed and a call says so. A call made with a gateway key counts against that key’s limits. A tool runs in the plugin host with your rights, as a provider plugin does, and its answer goes only to the agent that called it. Each plugin that gives tools is also a server of its own in the Library’s MCP tab, named by the plugin’s short name (search1api), so you don’t have to add the address by hand. With the MCP router on, its tools are in the router of every agent the router is given, as search1api__search; switch it on or off per agent, or turn single tools off, as with any Library server. Removed, it comes back only when you remove the plugin and add it again. To keep a plugin for its providers but give its tools to no agent, press Hide from agents on its tools line under Plugins › Installed. Its server is then given to no agent, nor to an app at the router’s address, through updates, the plugin off and on, and restarts. Give to agents gives it back to the agents it had."],["agents","Agent plugins","A plugin can also add an agent: one magpie has no setup of its own for. It says where the agent keeps its model and what else to write there for the agent to use magpie’s gateway. The agent is then on the Agents page like magpie’s own: pick one of magpie’s models in its row and magpie writes it into the agent’s config, with the gateway’s address and a key of the agent’s own; switch it off and everything goes back to how the user had it. The example below adds Aider. // agent.js, named by \"magpie\": { \"agent\": \"./agent.js\" } in package.json export const agent = { id: \"aider\", name: \"Aider\", bin: \"aider\", config: \"~/.aider.conf.yml\", // the file magpie edits model: \"model\", // the key of the model in it prefix: \"openai/\", // written before magpie's model id ua: [\"aider\", \"litellm\"], notice: \"Aider reads its settings when it starts: restart it to use the new model.\", } export function connect({ gateway, model }) { return { \"openai-api-base\": gateway.v1, \"openai-api-key\": gateway.key, \"show-model-warnings\": false, } } magpie plugin add ./agent-aider # or a single *.agent.js file The agent export Field What it says id Its id, as the Agents page, usage and the CLI name it: lower-case letters, digits, ., _ and -. One of magpie’s own agents’ ids (codex, claude, …) is refused: a plugin adds an agent, it doesn’t replace one. name What the page calls it. The id when left out. config The file magpie edits. ~ and $VAR are expanded. It is made when it isn’t there. format json, yaml or env, when the file’s name doesn’t say it (.json/.jsonc, .yaml/.yml, .env). TOML isn’t supported yet. model The key of the model in the file, as a dotted path for JSON and YAML (llm.model). Leave it out for an agent whose model is picked in the agent itself, among the models connect writes (Raycast): the row is then a switch with no model picker, and connect, which such a plugin must have, is called without model. startup For an agent that keeps the model a session starts on in another file than the one connect writes, in place of model: config and format of that file, model the key of the model in it, and keys written beside the model as they are. PiG keeps its providers in models.json and its default in settings.json: startup: { config: \"~/.pig/agent/settings.json\", model: \"defaultModel\", keys: { defaultProvider: \"magpie\" } }. The row then picks the model, and each file is put back as it was. A magpie older than v0.1.3008 reads such a plugin as one with no model. prefix Written before magpie’s model id: openai/ for an agent that reaches OpenAI-compatible endpoints through LiteLLM. The id itself is /, as the gateway takes it. bin, dir The command on PATH and the folder that say the agent is installed. ua Words of the agent’s User-Agent, to name its requests in Usage when they come without its key. icon A picture for its row: an icon name, an https:// or data: URL. The plugin’s own icon, else a generic one, when left out. notice Said after its model is changed, as for magpie’s own agents. library Where the agent reads what the Library gives: instructions (a Markdown file it reads before every conversation), mcp (its MCP servers file) with mcpFormat, the agent whose file it is shaped like (alma, antigravity, claude, cline, codex, commandcode, copilot, crush, cursor, devin, gemini, goose, grok, hermes, kimi, omp, opencode, zed; claude is {\"mcpServers\": {…}}), and skills (a folder of SKILL.md folders). Each is optional, with ~ and $VAR expanded: library: { instructions: \"~/.toy/AGENTS.md\", mcp: \"~/.toy/mcp.json\", mcpFormat: \"claude\", skills: \"~/.toy/skills\" }. Without it the agent is given nothing from the Library, and giving it an item is refused, naming the key its plugin would set. launch For an agent that takes the gateway only from how it is started: env, the variables it is started with, each {key}, {url} or {v1} with a path after the address at most, and model, the flag that names the model. While it is on one of magpie’s models, magpie puts a function named after its bin in the user’s shells (zsh, bash, fish, PowerShell), which runs magpie run to start it on the gateway: launch: { env: { GEMINI_API_KEY: \"{key}\", GOOGLE_GEMINI_BASE_URL: \"{url}\" }, model: \"--model\" }. Its own model takes the function out. args are flags put before the user’s arguments, each {config}, the config’s path: args: { \"--settings\": \"{config}\" }. plain are arguments, a subcommand or a flag, that start the agent as it is, never on the gateway: plain: [\"remote-control\"]. base For an agent handed its config by launch.args, so that the config is magpie’s own file: the agent’s own settings file. connect and own get it parsed as base, the user’s own model is written there, and stepping out takes the config away whole: base: \"~/.gemini/antigravity-cli/settings.json\". merge For a json config: key paths whose object connect returns magpie’s members of, written beside the user’s own and taken out alone: merge: [\"customModelsConfig.customModels\"]. effort, wsl, aliases effort: true gives the agent the Effort field; wsl: true lists it in WSL distros too; aliases are other names magpie takes. connect connect(input) returns the other keys to write beside the model, by key path, each with its value; it may be async. It is given gateway (url, v1 — the URL ending in /v1 — and key, the agent’s own key, which counts its requests under its id), model (id, name, context, output, images, efforts, and as /v1/models names them native_endpoints, the gateway paths a request for it goes on untranslated such as [\"/v1/chat/completions\"], and pricing, USD a token as decimal strings: prompt, completion, input_cache_read, input_cache_write; each left out when not known, never empty or 0), models (every model magpie offers the agent, the same way), decisionModels (magpie’s decision models — Jev, Clef, a model a plugin marks decides — and the routing groups of them, kept out of models and /v1/models, each id, name, provider or group: true, and endpoints, the paths it is asked on: [\"/v1/systemone\", \"/v1/decisions\"]; [] for none) and agent (id, config). A plugin without connect writes only the model. It is called again when magpie’s models change, so a list it writes stays current. own({ config, base, model }), when exported, gives the agent’s own models for the row’s picker: it gets the config file parsed ({} for none), base too when the agent has one, and the model the agent is on, and returns a list of { value, model, direct }, value what is written as the model, model its name at the vendor and direct the vendor it goes to (Google, OpenAI, Anthropic). Without it the picker lists the model the agent is on. What magpie does with it Writing. Each key is set in place, the user’s comments and other keys kept. Before the first write, what each key held is kept aside, typed (a number stays a number). The way back. Picking the agent’s own model again, or switching it off, puts every key back as it was and takes out the keys that weren’t there. The file is never written over whole. Connected or not. The row says connected while the key that holds magpie’s key still holds it. A key changed by hand afterwards is said in the row, as for magpie’s own agents. How it runs. As middleware does: in moejs, in magpie’s own process, with imports inside the plugin only, no Node APIs and console.log into magpie’s log. Loading and connect each have a second. A plugin whose module doesn’t load, or whose connect throws, says why in its row on the Plugins page and writes nothing. The Library. With library, the agent is one of the Library’s agents: its instructions go between magpie’s marker lines in the file, its MCP servers into the file beside the user’s own (whose other fields are kept), and its skills linked or copied into the folder. Taking one off takes away only what magpie wrote there, and what a file held before is kept in magpie’s backups. An mcpFormat that isn’t one of the list, or an mcp without one, keeps the plugin from loading. Declaring it. \"magpie\": { \"agent\": \"./agent.js\" } in package.json, or a single file named *.agent.js (or .mjs). A package can be a provider, middleware and an agent at once. In the plugin market an agent’s entry has \"kind\": \"agent\" and is listed under Agents; a community one is named @magpie-community/agent-. An agent that needs a runtime. The agent file stays a moejs module, with no timers and nothing imported from outside the plugin. When the agent needs more (a timer, a file watched, a value carried over into the app’s own config), the package can also have a Bun module as its main, run as a provider plugin’s is. It is still an agent plugin: a package that declares magpie.agent is listed under Agents, on GitHub too, with a main or without, and its row in Installed wears the Agent chip, and the Provider chip only when its module serves a provider."],["pages","Pages in the window","A plugin can add a page of its own to magpie’s window. Once it is on, the page has a tab in the sidebar’s Plugins group, after magpie’s own pages. The page is plain HTML, CSS and JavaScript in the plugin’s folder, and needs no Bun and no build step. The example below shows today’s usage. { \"name\": \"magpie-usage-glance\", \"version\": \"0.1.0\", \"magpie\": { \"page\": { \"title\": \"Usage glance\", \"file\": \"page/index.html\", \"icon\": \"page/icon.svg\", \"titles\": { \"zh\": \"用量速览\", \"ja\": \"使用量の概要\" } }, \"permissions\": [\"usage:summary\"] } }

…

await magpie.ready // the window's theme, painted const s = await magpie.read(\"usage:summary\", { period: \"today\" }) document.getElementById(\"calls\").textContent = `${s.calls} calls` const opts = await magpie.options.get() // this plugin's own options await magpie.options.set({ ...opts, hideCost: true }) The Plugins page shows the page, and what it may read, on the plugin’s row before it is turned on. page.file and page.icon are paths inside the plugin. The page’s files are what sits in file’s folder; a path out of it, or a link that leads out, isn’t served. A package can be a page and a provider, middleware or an agent too. A plugin that is only a page doesn’t start the plugin host. page.titles (and a panel’s titles) names the tab in other languages, by language code (zh, zh-TW, ja, de); title is used for any other. What the page leaves unstyled already looks like magpie: the bridge adds a stylesheet for the font, colours, headings, buttons, fields and tables, with no weight (:where()), so any rule of the page’s own wins. Use the --magpie-* variables to match the window in your own styles. What the page can ask Field / call What it gives magpie.ready A promise of the window’s theme. It resolves once the window has answered. Until then the page has said nothing to magpie, and a page that doesn’t say it in 10 seconds is shown as not answering. magpie.theme, magpie.onTheme(fn) { dark, lang, tokens }. The bridge also sets data-theme, lang, color-scheme and --magpie-bg, --magpie-fg, --magpie-accent and so on on , and again on each change. magpie.options.get(), .set(o) The plugin’s own options in plugins.json, never another plugin’s. set takes an object and answers with the options saved. It can be called at most once a second. magpie.read(name, params) A read that magpie.permissions declares. Anything else is refused, by the window and again by magpie. usage:summary (period: today, 7d or 30d) gives calls, errors, tokens and cost, with the top 20 models. providers:list gives each provider’s id and name. No read gives keys, accounts, sign-ins or request bodies. What the page can’t do The page runs in a frame sandboxed to scripts alone (sandbox=\"allow-scripts\", and the same in its Content-Security-Policy), in an origin of its own. It can’t reach the window, magpie’s cookie or the window’s storage. Its policy allows its own files and nothing else: connect-src 'none', so no fetch, WebSocket or beacon, and no forms or frames. Scripts must be files (

…

await magpie.ready // the window's theme, painted const s = await magpie.read(\"usage:summary\", { period: \"today\" }) document.getElementById(\"calls\").textContent = `${s.calls} calls` const opts = await magpie.options.get() // this plugin's own options await magpie.options.set({ ...opts, hideCost: true }) The Plugins page shows the page, and what it may read, on the plugin’s row before it is turned on. page.file and page.icon are paths inside the plugin. The page’s files are what sits in file’s folder; a path out of it, or a link that leads out, isn’t served. A package can be a page and a provider, middleware or an agent too. A plugin that is only a page doesn’t start the plugin host. page.titles (and a panel’s titles) names the tab in other languages, by language code (zh, zh-TW, ja, de); title is used for any other. What the page leaves unstyled already looks like magpie: the bridge adds a stylesheet for the font, colours, headings, buttons, fields and tables, with no weight (:where()), so any rule of the page’s own wins. Use the --magpie-* variables to match the window in your own styles. What the page can ask Field / call What it gives magpie.ready A promise of the window’s theme. It resolves once the window has answered. Until then the page has said nothing to magpie, and a page that doesn’t say it in 10 seconds is shown as not answering. magpie.theme, magpie.onTheme(fn) { dark, lang, tokens }. The bridge also sets data-theme, lang, color-scheme and --magpie-bg, --magpie-fg, --magpie-accent and so on on , and again on each change. magpie.options.get(), .set(o) The plugin’s own options in plugins.json, never another plugin’s. set takes an object and answers with the options saved. It can be called at most once a second. magpie.read(name, params) A read that magpie.permissions declares. Anything else is refused, by the window and again by magpie. usage:summary (period: today, 7d or 30d) gives calls, errors, tokens and cost, with the top 20 models. providers:list gives each provider’s id and name. No read gives keys, accounts, sign-ins or request bodies. What the page can’t do The page runs in a frame sandboxed to scripts alone (sandbox=\"allow-scripts\", and the same in its Content-Security-Policy), in an origin of its own. It can’t reach the window, magpie’s cookie or the window’s storage. Its policy allows its own files and nothing else: connect-src 'none', so no fetch, WebSocket or beacon, and no forms or frames. Scripts must be files (

…

await magpie.ready // the window's theme, painted const s = await magpie.read(\"usage:summary\", { period: \"today\" }) document.getElementById(\"calls\").textContent = `${s.calls} calls` const opts = await magpie.options.get() // this plugin's own options await magpie.options.set({ ...opts, hideCost: true }) プラグインページの行には、オンにする前からページと読めるものが表示されます。page.file と page.icon はプラグイン内のパスです。ページのファイルは file のフォルダにあるものだけで、外を指すパスやリンクは配信されません。1 つのパッケージがページとプロバイダ、ミドルウェア、エージェントを兼ねることもできます。ページだけのプラグインはプラグインホストを起動しません。page.titles(パネルでは titles)は、言語コード(zh、zh-TW、ja、de)ごとのタブ名です。ほかの言語では title を使います。 ページがスタイルを付けていないところは、最初から magpie の見た目になります。bridge がフォント、色、見出し、ボタン、入力欄、表のスタイルシートを重みなし(:where())で加えるので、ページ自身のルールが常に勝ちます。自分のスタイルでは --magpie-* 変数を使うとウィンドウに揃います。 ページが頼めること フィールド / 呼び出し 返すもの magpie.ready ウィンドウが応答すると、ウィンドウのテーマが得られます。それまでページは magpie と何も話していません。10 秒以内に話さないページは応答なしと表示されます。 magpie.theme, magpie.onTheme(fn) { dark, lang, tokens }。bridge は に data-theme、lang、color-scheme と --magpie-bg、--magpie-fg、--magpie-accent なども設定し、変わるたびに設定し直します。 magpie.options.get(), .set(o) plugins.json にあるそのプラグイン自身のオプションです。ほかのプラグインのものは扱えません。set はオブジェクトを受け取り、保存されたオプションを返します。呼べるのは 1 秒に 1 回までです。 magpie.read(name, params) magpie.permissions で宣言した読み取りです。それ以外はウィンドウが拒否し、magpie ももう一度拒否します。usage:summary(period:today、7d、30d)は呼び出し数、エラー数、トークン、費用と上位 20 モデルを、providers:list は各プロバイダの id と名前を返します。キー、アカウント、サインイン、リクエスト本文を返す読み取りはありません。 ページにできないこと ページはスクリプトだけを許したサンドボックスのフレーム(sandbox=\"allow-scripts\"、Content-Security-Policy でも同じ)で、独自のオリジンで動きます。ウィンドウにも、magpie の cookie にも、ウィンドウのストレージにも届きません。 ポリシーで読み込めるのは自分のファイルだけです。connect-src 'none' なので fetch、WebSocket、beacon は使えず、フォームやフレームもありません。スクリプトはファイル(

…

await magpie.ready // the window's theme, painted const s = await magpie.read(\"usage:summary\", { period: \"today\" }) document.getElementById(\"calls\").textContent = `${s.calls} calls` const opts = await magpie.options.get() // this plugin's own options await magpie.options.set({ ...opts, hideCost: true }) プラグインページの行には、オンにする前からページと読めるものが表示されます。page.file と page.icon はプラグイン内のパスです。ページのファイルは file のフォルダにあるものだけで、外を指すパスやリンクは配信されません。1 つのパッケージがページとプロバイダ、ミドルウェア、エージェントを兼ねることもできます。ページだけのプラグインはプラグインホストを起動しません。page.titles(パネルでは titles)は、言語コード(zh、zh-TW、ja、de)ごとのタブ名です。ほかの言語では title を使います。 ページがスタイルを付けていないところは、最初から magpie の見た目になります。bridge がフォント、色、見出し、ボタン、入力欄、表のスタイルシートを重みなし(:where())で加えるので、ページ自身のルールが常に勝ちます。自分のスタイルでは --magpie-* 変数を使うとウィンドウに揃います。 ページが頼めること フィールド / 呼び出し 返すもの magpie.ready ウィンドウが応答すると、ウィンドウのテーマが得られます。それまでページは magpie と何も話していません。10 秒以内に話さないページは応答なしと表示されます。 magpie.theme, magpie.onTheme(fn) { dark, lang, tokens }。bridge は に data-theme、lang、color-scheme と --magpie-bg、--magpie-fg、--magpie-accent なども設定し、変わるたびに設定し直します。 magpie.options.get(), .set(o) plugins.json にあるそのプラグイン自身のオプションです。ほかのプラグインのものは扱えません。set はオブジェクトを受け取り、保存されたオプションを返します。呼べるのは 1 秒に 1 回までです。 magpie.read(name, params) magpie.permissions で宣言した読み取りです。それ以外はウィンドウが拒否し、magpie ももう一度拒否します。usage:summary(period:today、7d、30d)は呼び出し数、エラー数、トークン、費用と上位 20 モデルを、providers:list は各プロバイダの id と名前を返します。キー、アカウント、サインイン、リクエスト本文を返す読み取りはありません。 ページにできないこと ページはスクリプトだけを許したサンドボックスのフレーム(sandbox=\"allow-scripts\"、Content-Security-Policy でも同じ)で、独自のオリジンで動きます。ウィンドウにも、magpie の cookie にも、ウィンドウのストレージにも届きません。 ポリシーで読み込めるのは自分のファイルだけです。connect-src 'none' なので fetch、WebSocket、beacon は使えず、フォームやフレームもありません。スクリプトはファイル(