Docs · Help

Fixing common errors: 401, 429, 502, 504 and more

An error from magpie’s gateway says what went wrong in its own words. This page lists the common ones, what causes them, and the fix.

Every request is listed on magpie’s Routing page, with which provider and account it went to and how each try ended. Copy Report on a request copies what you need to ask for help.

401 and 403: a key or sign-in refused

From the vendor. The provider turned down the key or sign-in magpie sent. magpie sets that key or account aside and tries the next one, so you see the error only when none is left. A sign-in that has run out says so, for example “the ChatGPT sign-in has expired — sign in again”.

From magpie itself. magpie answers 403 on its own in a few cases, before anything is sent:

ErrorCauseFix
model disabledYou turned the model off in magpie.Turn it on again on its provider.
model not allowed for the gateway keyThe gateway key is held to some models.magpie gateway-key models <id> lists or changes them.
magpie doesn’t answer the web page …A web page called the gateway from a browser.List it in Settings › Network and sharing › Web pages, and send a gateway key.

429 and rest periods

A 429 means the provider is out of quota, out of credit or rate limiting you. magpie rests the key or account that was refused and sends the request to the next account, the next member of a routing group, or the provider’s Fallback. The provider’s row shows Resting · {why} · back at {time}.

Refused forRests
Quota, with a reset timeUntil the reset
Rate limit, with Retry-AfterUntil then
Credit30 minutes, then 2 hours, 8 hours, a day, 3 days and a week if it is refused again
A ChatGPT account out of creditsUntil the reset its refusal names, else until its full window renews, else 5 hours
Any other failureA minute, doubling on repeats up to 10 minutes (30 for a rate limit)

Rests are kept across restarts, so quitting magpie doesn’t bring a resting account back early.

502: the provider didn’t answer

A 502 means magpie couldn’t get an API reply from the provider. What follows the provider’s name says which case it is:

A 502, 503, 504, 529 or Cloudflare’s 520 to 524 counts as busy: magpie asks again or moves to a routing group’s next member before the agent sees it.

504: no answer in time

Model not found (404)

The error reads magpie knows no model “…”, often with did you mean …? and the list of your provider ids.

The agent doesn’t show the model

Port 3425 is in use

The gateway listens on 127.0.0.1:3425. To move it, open Settings › Network and sharing › Gateway address. Only the port is set there, 1024 to 65535, and the agents magpie connected move with it.

magpie saysFix
Port … is in use by another program: pick another onePick a free port.
Another magpie serves the gateway at …: set its port there, or quit it firstTwo copies of magpie are running. Quit one.
Port … is taken by another program, magpie web perhaps: magpie tries again every few secondsFind what holds the port, or move the gateway to another.
MAGPIE_ADDR=… sets the gateway’s whole address, host:port: unset it to set the port hereUnset MAGPIE_ADDR, or change it.

Agents in WSL

On Windows, magpie looks in running WSL distros for agents such as Claude Code, Codex, OpenCode, Kimi Code and Qwen Code. Each one it finds gets a row of its own on the Agents page, and magpie sets it up as it does on Windows. It never starts a stopped distro.

From another computer on the network

By default the gateway answers only this computer. To use it from another: Settings › Network and sharing › Share on local network. The other computer sends a gateway key from the Gateway page’s Gateway keys.

Don’t open the port to the internet; use a VPN between your computers. The full setup, another magpie included, is in Remote magpie.

A subscription moved to a plugin isn’t served

Command Code, Cursor, Devin, Factory, Grok, Kiro, Xiaomi MiMo, Qoder, WorkBuddy, ZCode and Zed are no longer built into magpie. Each is served by a community plugin that does the same job. Accounts added before still need to move to the plugin, and nothing serves them until they do.

An error after the move comes from the plugin, which does the sign-in, models and requests.

FAQ

Why does magpie answer 502 when the provider is up?

The provider answered with something that isn’t an API reply, such as a web page or an empty body. The base URL usually points at the vendor’s web site instead of its API.

Why does an account stay unused after a 429?

magpie rests it until the reset the vendor named, or for a while if none was named. The provider’s row says when it is back, and Try now ends the rest.

What does “magpie knows no model” mean?

No provider serves a model by that name. Name it as provider/model, as magpie models lists it, or switch its provider on again.

How do I change magpie’s port?

Settings › Network and sharing › Gateway address. The agents magpie connected move with it.

Can an agent in WSL use magpie on Windows?

Yes. magpie finds agents in running WSL distros and sets each up with an address it can reach. Under NAT networking, Windows’ firewall must let WSL’s connection through.

Can I use magpie from another computer?

Yes. Turn on Settings › Network and sharing › Share on local network, and send a gateway key from the other computer. Don’t open the port to the internet.

Still stuck? Copy the request’s report from the Routing page and ask on Discord.