magpie WSL setup and Windows install: where to run it (November 2026)
As of 2026-11-10, magpie's README says that on Windows, agents inside WSL distros are wired too. So magpie can run on Windows while Claude Code and Codex stay in WSL, each listed as an entry of its own on the Agents page. The Windows file is magpie-windows-amd64.exe (ARM: magpie-windows-arm64.exe), and magpie.exe takes the same commands as on other systems; the official reference adds that magpie daemon works inside WSL as on Linux. With QCode, the three provider addresses are the same wherever magpie runs.
Updated 2026-11-10
Point this tool at the QCode endpoint — one key for Claude, GPT and Chinese models.
- Billed per token — live rates on /models
- Pay by card (Visa / Mastercard), Apple Pay, Google Pay or crypto
- Self-service: top up and activate instantly
Four points from the official sources
Windows: app file and magpie.exe
The GitHub release lists magpie-windows-amd64.exe (ARM: magpie-windows-arm64.exe) for Windows and magpie-cli-windows-amd64.exe as the terminal-only build; the site says Windows 10 or later. magpie.exe takes the same commands as on other systems.
Agents in WSL are wired by magpie on Windows
The README: on Windows, agents inside WSL distros are wired too, and their sessions counted. The official wiring notes add that each agent found there becomes an entry of its own, whose config files are edited through the distro's \\wsl.localhost share.
Inside WSL: daemon and web
The reference says magpie daemon works inside WSL as on Linux once systemd is on ([boot] systemd=true in /etc/wsl.conf), and lists magpie web, the app's window in a browser, for WSL and servers reached over SSH.
QCode addresses stay the same
QCode's magpie guide lists anthropic https://api.qcode.cc/api, chat https://api.qcode.cc/openai/v1 and responses https://api.qcode.cc/openai. Use these three whether magpie runs on Windows or in WSL.
What is magpie, and where does WSL fit?
As of 2026-11-10, magpie (GitHub repository yetone/magpie, MIT License) runs a gateway on your machine and picks every agent's model in one place; the repository description reads "Every agent's model. One place." Its README puts the gateway at 127.0.0.1:3425, speaking OpenAI Chat, OpenAI Responses, Anthropic Messages and Gemini, and says that on Windows, agents inside WSL distros are wired too. The official agent wiring notes explain how: magpie scans each running distro once without starting a stopped one, finds an agent by its folder under the distro's home or by its command there, and edits its files through \\wsl.localhost; the gateway address and key follow the distro's networking, mirrored or NAT. While the gateway listens on loopback alone, under NAT it is also served at the Windows address on the WSL network.
2026-10-27: maintainer merges the fix for Codex-in-WSL 404s
On 2026-10-27 the maintainer, yetone, wrote on issue #2198 that the fix is merged and ships in v0.1.1763. With it, when the Windows Codex's config.toml gives no stand-in model, magpie looks in the running distros where it found Codex for the first config.toml with model_provider = "magpie" and takes its model; stopped distros are not opened. He also wrote that a real Codex in a real distro had not been tried, and kept the issue open until someone with a real WSL setup confirms it.
Timeline
Issue #2198 is filed: Codex in WSL gets a 404 for a model name magpie does not serve.
yetone merges the #2198 fix; the issue stays open for a real-WSL check.
Rechecked on GitHub and in the official docs on 2026-11-10: #2198, #3333, #3689 and #4453 are open; #3175 was closed by its reporter.
What magpie documents, and what it has not stated yet
Stated in magpie's docs and by its maintainer
① Windows files: magpie-windows-amd64.exe, magpie-windows-arm64.exe and the terminal-only magpie-cli-windows-amd64.exe; Windows 10 or later. ② README: on Windows, agents inside WSL distros are wired too, and their sessions counted. ③ Wiring notes: each WSL agent is an entry of its own, edited through \\wsl.localhost; listing never starts a stopped distro, but changing one of its fields writes its files, which starts it; with Detect agents in WSL off in Settings, magpie starts no wsl.exe at all. ④ The gateway address and key follow the distro's networking, mirrored or NAT; under NAT the gateway is also served at the Windows address on the WSL network, Windows' firewall decides whether WSL gets in, and a distro that cannot connect is shown the firewall rule that lets it in. ⑤ Start guide: magpie keeps its own settings, providers and usage in .config\magpie under your Windows user folder. ⑥ The maintainer, yetone, on #2198 (Codex in WSL, 404): the fix is merged; the issue stays open until a real WSL setup confirms it.
What magpie has not stated yet
As of 2026-11-10: ① Where to install: there is no step-by-step WSL install guide, and no word on whether Windows or WSL is the better place; install.sh has macOS and Linux branches, and the reference covers magpie daemon and magpie web inside WSL. ② WSL1 (#3333, open). Observation from an issue contributor: WSL 1 shares Windows' network stack, so Claude Code should get 127.0.0.1; he published a patch and notes he did not test it on a real WSL1 distro. No maintainer reply yet. ③ VS Code opened in WSL under NAT (#3689, open). Observation from an issue contributor: the reporter writes that Mirrored networking works and NAT does not. No maintainer reply yet. ④ #3175 beside the docs: #3175 reported magpie.exe calling wsl.exe about every 60 seconds after wsl --shutdown, and its reporter closed it as completed on 2026-10-22 with no comment; today's wiring notes say only running distros are scanned and a stopped one is never started. How the two relate is not stated officially. ⑤ Claude Desktop over SSH (#4453, open): a contributor writes that which address to write is a product decision, left to the maintainer.
Two places to run magpie
magpie on Windows, agents in WSL
Install the Windows app, or the terminal-only magpie-cli-windows-amd64.exe. Per the README, agents inside running WSL distros are wired too and show up on the Agents page as entries of their own. On Windows magpie is not a service; the reference gives magpie autostart on, which opens magpie, and with it the gateway, when you log in.
magpie inside WSL
Run the official installer in the distro: curl -fsSL https://usemagpie.ai/install.sh | sh. The script has a Linux branch, and on Linux with no desktop it installs the terminal build. Once systemd is on, magpie daemon install keeps the gateway running, or magpie web opens the app's window in a browser; the reference describes both inside WSL.
How to set up magpie with WSL and QCode
① On Windows, download magpie-windows-amd64.exe (ARM: magpie-windows-arm64.exe) from usemagpie.ai or GitHub Releases; the reference notes that SmartScreen may ask before the first run. ② Add QCode under Providers → Add provider, or in a terminal: magpie provider add QCode anthropic=https://api.qcode.cc/api url=https://api.qcode.cc/openai/v1 responses=https://api.qcode.cc/openai key=cr_xxx (as of 2026-11-10, tested with the Linux terminal build of magpie 0.1.3533: the command adds the provider). anthropic is the root, without /v1; url is the chat address, ending in /v1. ③ Start your WSL distro and open the Agents page: magpie lists Claude Code, Codex and others found in running distros, each as an entry of its own. Pick qcode/claude-sonnet-5-5 for Claude Code and qcode/gpt-6.1-sol for Codex. ④ If an agent is missing, check that Detect agents in WSL is on in Settings; the wiring notes say the scan runs sh -l (it reads ~/.profile, not ~/.bashrc) and looks for commands where nvm, fnm, volta, pnpm, bun and ~/.local/bin keep them. ⑤ If a distro cannot reach the gateway under NAT, allow it with the firewall rule magpie shows. ⑥ To run magpie inside WSL, run curl -fsSL https://usemagpie.ai/install.sh | sh in the distro, turn on systemd ([boot] systemd=true in /etc/wsl.conf), then run magpie daemon install. ⑦ Without magpie, set ANTHROPIC_BASE_URL=https://api.qcode.cc/api and ANTHROPIC_AUTH_TOKEN=cr_xxx in the WSL shell, as on QCode's environment variables page.
Using QCode with magpie on Windows or in WSL
As of 2026-11-10, one QCode API key serves both Anthropic- and OpenAI-compatible APIs, and QCode's magpie guide lists three addresses: anthropic https://api.qcode.cc/api (the root, without /v1), chat https://api.qcode.cc/openai/v1 and responses https://api.qcode.cc/openai. They are the same whether magpie runs on Windows or inside WSL. Claude goes only through /api, GPT uses the two OpenAI addresses, and Chinese models work on both chat and anthropic. Billing is per token, with per-model rates on /models. Three steps: ① register and top up (Alipay and other major payment methods); ② buy a Personal Plan or a Pay-as-you-go Pack and copy your API key, which starts with cr_; ③ add QCode in magpie as in https://docs.qcode.cc/en/docs/ide/magpie. Not ready for a monthly plan? Pay-as-you-go Packs start at $4 for a one-time quota you use within 7 days; if you already have a Personal Plan, add a booster pack when you need more quota.
Frequently asked questions
Does magpie work with WSL?
Yes. As of 2026-11-10 the README says that on Windows, agents inside WSL distros are wired too, and their sessions counted. magpie scans only running distros and never starts a stopped one when listing; with Detect agents in WSL off in Settings, magpie starts no wsl.exe at all. The reference also describes magpie daemon and magpie web working inside WSL.
Codex in WSL returns a 404 for a model name. How do I fix it?
The maintainer, yetone, wrote on issue #2198 that the fix is merged and ships in v0.1.1763, so first make sure magpie on Windows is on that version or later. #2198 describes a Codex wired inside a WSL distro that asks for a model magpie does not serve and gets a 404. With the fix, when the Windows Codex gives no stand-in model, magpie reads the first running distro whose config.toml has model_provider = "magpie" and uses its model. The issue is still open (reopened): yetone wrote that a real Codex in a real distro had not been tried, and the issue waits for someone with a real WSL setup.
Why does my WSL distro start again after wsl --shutdown?
To have magpie start no wsl.exe at all, the official docs give a switch: turn off Detect agents in WSL in Settings, which also stops it looking for agents in WSL. The behavior is the subject of issue #3175: on 2026-10-21 its reporter wrote that after wsl --shutdown, magpie.exe called wsl.exe about every 60 seconds and the distro came back to Running, and asked for a switch or a lower frequency; on 2026-10-22 he closed it himself as completed, with no comment. Today's wiring notes say each running distro is scanned once and a stopped one is never started. How the two relate is not stated officially.
VS Code opened in WSL can't use magpie (ECONNREFUSED 127.0.0.1:3425)?
That is issue #3689, open as of 2026-11-10, with no maintainer reply or official procedure yet. Observations from an issue contributor: the reporter's Copilot model address in VS Code was 127.0.0.1:3425, and the VS Code server in WSL failed with connect ECONNREFUSED 127.0.0.1:3425; he later wrote that Mirrored networking works and NAT does not, and that turning on magpie's local network sharing and entering the Windows host's IP and a gateway key in VS Code by hand worked, but the reconnect button in the Agents panel writes VS Code's old settings back. For NAT, the official docs say the WSL agents magpie wires use Windows' address on the WSL network, and Windows' firewall decides whether they get in.
Which address does Claude Code use under WSL1?
As of 2026-11-10 the official docs give the addresses for mirrored, NAT and bridged networking; WSL1 is still under discussion in issue #3333 (open), with no maintainer reply yet. The reporter could reach curl http://127.0.0.1:3425/v1/models from WSL1, but magpie wrote a non-loopback address into Claude Code's ANTHROPIC_BASE_URL. Observation from an issue contributor: WSL 1 shares Windows' network stack, so the address should be 127.0.0.1; he published a patch and notes he did not test it on a real WSL1 distro.
Can magpie installed in WSL use QCode?
Yes. Add QCode as a provider with the three addresses from QCode's magpie guide: anthropic https://api.qcode.cc/api, chat https://api.qcode.cc/openai/v1 and responses https://api.qcode.cc/openai; Claude goes only through /api. The addresses are the same whether magpie runs on Windows or inside WSL. To skip magpie, QCode's environment variables page at https://docs.qcode.cc/en/docs/getting-started/environment shows ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN for Claude Code.
Sources
magpie README, reference, install.sh, the agent wiring and gateway routing notes, usemagpie.ai pages (home, docs/start, docs/remote, docs/docker), the GitHub Releases API and issues #2198, #3175, #3333, #3689 and #4453 with their comments in the yetone/magpie repository (main branch), all read on 2026-11-10. QCode: the magpie and Environment Variables pages on docs.qcode.cc, qcode.cc/models, /pay-as-you-go and /pricing, retrieved on 2026-11-10.
Connect QCode to magpie on Windows or in WSL
One QCode API key for Claude Code, Codex and more, billed per token; per-model rates are on /models.
Related reading
Pay-as-you-go Packs
One-time quota packs valid for 7 days, no subscription; per-model rates are on /models.
magpie Claude Code setup: local gateway for Claude Code and Codex (2026-11)
magpie setup: install and uninstall commands, three ways to add a provider, picking models for Claude Code and Codex, and QCode's three addresses.
magpie not working: 401 and 405 errors and fixes (2026-11)
The official cause and fix for common magpie errors: a switch that does not apply, 401 in Docker, ZCode 405, the 400 in provider test and missing models.
Crypto payment guide
Nine coins, 56 networks, zero platform fee for AI coding API credits.
Statements on this page were checked on 2026-11-10 against the magpie repository and site; the official pages prevail. magpie ships several builds a day, so menu names and behavior follow the version you install, and open issues may change. QCode model availability follows /models.