site: docs pages for ChatGPT in Claude Code and fixing common errors

New /docs/claude-code-chatgpt and /docs/troubleshooting in en, zh and
ja, aimed at queries Search Console shows with impressions and no page
for them ("claude code use chatgpt subscription", "opencode 502",
"workbuddy wsl", "局域网远程"). The first walks through signing in to
ChatGPT, picking a codex/... model for Claude Code, tier mapping,
effort, usage windows, several accounts and switching back. The second
covers 401/403, 429 and rests, 502/504, unknown models, a model the
agent doesn't list, port 3425, WSL, the LAN and moved subscriptions.
Claims were checked against internal/gateway, internal/provider,
internal/agent, internal/agentenv and i18n.js; unsupported ones were
dropped (WorkBuddy is not a WSL agent, no ChatGPT Business). Linked
from subscriptions, claude-code-models and start in each language,
sitemap.xml, llms.txt and the rebuilt llms-full.txt.

Run (mote): node --test worker.test.mjs install.test.mjs: 71 pass,
0 fail. Each new page's JSON-LD parsed with node.
Not tried: the pages in a real browser beyond the deployed 200 check.
This commit is contained in:
yetone
2026-11-11 04:48:31 +08:00
parent 5068e46fb6
commit d2a80b3173
18 changed files with 2234 additions and 12 deletions
+308
View File
@@ -0,0 +1,308 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Use your ChatGPT Plus or Pro subscription in Claude Code · magpie</title>
<meta name="description" content="Sign in to ChatGPT once in magpie and run Claude Code on the GPT models of your ChatGPT plan: how the Opus, Sonnet and Haiku tiers map, reasoning effort, usage limits, several accounts, and how to switch back. No OpenAI API key.">
<meta name="color-scheme" content="light dark">
<meta name="theme-color" content="#fafafa">
<script>
(() => {
let mode = "system";
try { mode = localStorage.getItem("theme") || "system"; } catch {}
const q = matchMedia("(prefers-color-scheme: dark)");
const apply = () => {
const t = mode === "system" ? (q.matches ? "dark" : "light") : mode;
document.documentElement.dataset.theme = t;
document.querySelector('meta[name="theme-color"]').content = t === "dark" ? "#0b0b0c" : "#fafafa";
document.querySelectorAll("button.theme").forEach((b) => { b.dataset.mode = mode; b.title = "Theme: " + mode; });
};
q.addEventListener("change", () => mode === "system" && apply());
window.setTheme = (m) => { mode = m; try { m === "system" ? localStorage.removeItem("theme") : localStorage.setItem("theme", m); } catch {} apply(); };
window.themeMode = () => mode;
apply();
})();
</script>
<script>try{if(/Linux/.test(navigator.userAgent)&&!/Android/.test(navigator.userAgent)||localStorage.getItem("omarchy")||/[?&]omarchy=/.test(location.search))document.write('<script src="/omarchy.js"><\/script>')}catch(e){}</script>
<link rel="icon" href="/favicon.png" type="image/png">
<link rel="apple-touch-icon" href="/img/icon-256.png">
<link rel="alternate" hreflang="en" href="https://usemagpie.ai/docs/claude-code-chatgpt">
<link rel="alternate" hreflang="zh" href="https://usemagpie.ai/docs/zh/claude-code-chatgpt">
<link rel="alternate" hreflang="ja" href="https://usemagpie.ai/docs/ja/claude-code-chatgpt">
<link rel="alternate" hreflang="x-default" href="https://usemagpie.ai/docs/claude-code-chatgpt">
<link rel="canonical" href="https://usemagpie.ai/docs/claude-code-chatgpt">
<link rel="stylesheet" href="/docs.css">
<meta property="og:site_name" content="magpie">
<meta property="og:title" content="Use your ChatGPT Plus or Pro subscription in Claude Code">
<meta property="og:description" content="Sign in to ChatGPT once in magpie and run Claude Code on the GPT models of your ChatGPT plan: how the Opus, Sonnet and Haiku tiers map, reasoning effort, usage limits, several accounts, and how to switch back. No OpenAI API key.">
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
<meta property="og:url" content="https://usemagpie.ai/docs/claude-code-chatgpt">
<meta name="twitter:card" content="summary_large_image">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "TechArticle",
"headline": "Use your ChatGPT Plus or Pro subscription in Claude Code",
"description": "Sign in to ChatGPT once in magpie and run Claude Code on the GPT models of your ChatGPT plan: how the Opus, Sonnet and Haiku tiers map, reasoning effort, usage limits, several accounts, and how to switch back. No OpenAI API key.",
"inLanguage": "en",
"url": "https://usemagpie.ai/docs/claude-code-chatgpt",
"about": {
"@type": "SoftwareApplication",
"name": "magpie",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "macOS, Windows, Linux"
},
"publisher": {
"@type": "Organization",
"name": "magpie",
"url": "https://usemagpie.ai/"
}
},
{
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "Can I use my ChatGPT Plus or Pro subscription in Claude Code?",
"acceptedAnswer": {
"@type": "Answer",
"text": "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."
}
},
{
"@type": "Question",
"name": "Do I need an OpenAI API key?",
"acceptedAnswer": {
"@type": "Answer",
"text": "No. magpie signs in on OpenAI’s own page, and Claude Code gets the gateway’s key. Your sign-in stays in magpie."
}
},
{
"@type": "Question",
"name": "Does it use my ChatGPT plan’s limits?",
"acceptedAnswer": {
"@type": "Answer",
"text": "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."
}
},
{
"@type": "Question",
"name": "Which model do Claude Code’s Haiku requests use?",
"acceptedAnswer": {
"@type": "Answer",
"text": "The GPT model you picked, unless you give the haiku tier a model of its own with magpie claude haiku <model>."
}
},
{
"@type": "Question",
"name": "How do I go back to Claude’s own models?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Run magpie claude default, or pick one of Claude Code’s own models on its row in magpie."
}
},
{
"@type": "Question",
"name": "Do my requests go through a magpie server?",
"acceptedAnswer": {
"@type": "Answer",
"text": "No. The gateway runs on your computer. Requests go from it to OpenAI; magpie has no server of its own in that path."
}
}
]
}
]
}
</script>
</head>
<body>
<nav><div class="wrap">
<a class="brand" href="/"><img class="bird" src="/img/magpie-small.svg" alt="">magpie <small>Docs</small></a>
<div class="links">
<a href="/">Home</a>
<a href="/docs/start">Get started</a>
<a href="/docs/intent">Intent routing</a>
<a href="/docs/plugins">Plugins</a>
<a class="toc-only" href="/docs/remote">Remote magpie</a>
<a class="toc-only" href="/docs/docker">Docker</a>
<a class="toc-only" href="/docs/privacy">Privacy</a>
<a class="toc-only" href="/docs/masking">Privacy masking</a>
<a class="toc-only" href="/docs/mcp-router">MCP router</a>
<a class="toc-only" href="/docs/library">Library</a>
<a class="toc-only" href="/docs/claude-code-models">Models in Claude Code</a>
<a class="toc-only" href="/docs/codex-models">Models in Codex</a>
<a class="toc-only" href="/docs/gemini-cli-models">Models in Gemini CLI</a>
<a class="toc-only" href="/docs/subscriptions">Subscriptions in any agent</a>
<a class="toc-only" href="/docs/local-models">Local models</a>
<a class="toc-only" href="/docs/opencode-models">Models in OpenCode</a>
<a class="toc-only" href="/docs/alternatives">magpie vs CC Switch vs CCR</a>
<a href="/docs/import">Add to magpie</a>
<a href="/docs/integrate">Integrate</a>
<a href="https://github.com/yetone/magpie-releases/releases">Releases</a>
</div>
<div class="langs">
<button class="icon-btn lang" type="button" aria-label="Language" title="Language" aria-haspopup="true" aria-expanded="false" aria-controls="langs"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><circle cx="8" cy="8" r="6.25"/><path d="M1.75 8h12.5M8 1.75c1.7 1.75 2.55 3.83 2.55 6.25S9.7 12.5 8 14.25M8 1.75C6.3 3.5 5.45 5.58 5.45 8S6.3 12.5 8 14.25"/></svg></button>
<div class="lang-menu" id="langs" hidden>
<a href="/docs/claude-code-chatgpt" hreflang="en" lang="en">English</a>
<a href="/docs/zh/claude-code-chatgpt" hreflang="zh" lang="zh">中文</a>
<a href="/docs/ja/claude-code-chatgpt" hreflang="ja" lang="ja">日本語</a>
</div>
</div>
<a class="icon-btn" href="https://discord.gg/vGSnD3ZKQF" aria-label="magpie on Discord" title="Join us on Discord"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/></svg></a>
<a class="icon-btn" href="https://github.com/yetone/magpie" aria-label="magpie on GitHub" title="Source on GitHub"><svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg></a>
<button class="icon-btn theme" type="button" aria-label="Theme" title="Theme: system"><svg class="i-system" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1.75" y="2.75" width="12.5" height="8.5" rx="1.5"/><path d="M5.5 14h5M8 11.25V14"/></svg><svg class="i-light" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><circle cx="8" cy="8" r="3"/><path d="M8 1v1.5M8 13.5V15M1 8h1.5M13.5 8H15M3 3l1 1M12 12l1 1M3 13l1-1M12 4l1-1"/></svg><svg class="i-dark" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"><path d="M13.5 9.5A5.5 5.5 0 0 1 6.5 2.5a5.5 5.5 0 1 0 7 7Z"/></svg></button>
<a class="btn small" href="/#get">Download</a>
</div></nav>
<main class="wrap doc">
<aside class="toc">
<p>ChatGPT in Claude Code</p>
<a href="#overview">How it works</a>
<a href="#signin">Sign in to ChatGPT</a>
<a href="#pick">Pick a GPT model</a>
<a href="#tiers">Opus, Sonnet and Haiku</a>
<a href="#effort">Reasoning effort</a>
<a href="#limits">Limits and usage</a>
<a href="#accounts">Several accounts</a>
<a href="#back">Switch back</a>
<a href="#reverse">The other way round</a>
<a href="#faq">FAQ</a>
</aside>
<article>
<p class="eyebrow" id="overview">Docs · Guide</p>
<h1>Use your ChatGPT Plus or Pro subscription in Claude Code</h1>
<p class="lede">Claude Code can run on the GPT models of your ChatGPT Plus or Pro plan. Sign in to ChatGPT in magpie, pick a <code>codex/…</code> model for Claude Code, and keep working as before. No OpenAI API key.</p>
<p>Claude Code speaks Anthropic’s Messages API. magpie runs a gateway on your computer, at <code>127.0.0.1:3425</code>, 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 <code>settings.json</code>, and your ChatGPT sign-in stays in magpie.</p>
<h2 id="signin"><a class="anchor" href="#signin">Sign in to ChatGPT</a></h2>
<ol class="steps">
<li><b>Open Add provider</b>In magpie’s <span class="ui">Providers</span> tab, press <span class="ui">+ Add provider</span>.</li>
<li><b>Click the ChatGPT tile</b>magpie opens OpenAI’s own sign-in page in your browser. The account shows up as soon as you finish.</li>
</ol>
<p>Or from a terminal:</p>
<div class="code"><span class="lang">Terminal</span><button class="copy" data-copy="cg-signin">Copy</button><pre id="cg-signin">magpie accounts add codex # sign in to a ChatGPT account</pre></div>
<p>The account’s models are <code>codex/…</code>.</p>
<h2 id="pick"><a class="anchor" href="#pick">Pick a GPT model for Claude Code</a></h2>
<p>In the <span class="ui">Agents</span> tab, click the model on Claude Code’s row and choose a <code>codex/…</code> model. From a terminal:</p>
<div class="code"><span class="lang">Terminal</span><button class="copy" data-copy="cg-pick">Copy</button><pre id="cg-pick">magpie models # every model, as provider/model
magpie claude codex/gpt-5.5</pre></div>
<p>Inside Claude Code, <code>/model</code> lists magpie’s models too, marked “via magpie”, so you can switch there.</p>
<div class="callout"><b>Only some sessions on GPT?</b> Leave Claude Code unconnected in magpie and run <code>claude-magpie</code> when you want it on a GPT model. It starts the same <code>claude</code> with magpie’s settings for that session only, and <code>settings.json</code> is not rewritten.</div>
<h2 id="tiers"><a class="anchor" href="#tiers">How Opus, Sonnet and Haiku map</a></h2>
<p>Claude Code asks for models by tier: <code>opus</code>, <code>sonnet</code>, <code>haiku</code> and <code>fable</code>. 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:</p>
<div class="table-wrap"><table>
<tr><th>Tier</th><th>Variable in <code>env</code></th><th>By default</th></tr>
<tr><td>opus</td><td><code>ANTHROPIC_DEFAULT_OPUS_MODEL</code></td><td>The GPT model you picked</td></tr>
<tr><td>sonnet</td><td><code>ANTHROPIC_DEFAULT_SONNET_MODEL</code></td><td>The GPT model you picked</td></tr>
<tr><td>haiku</td><td><code>ANTHROPIC_DEFAULT_HAIKU_MODEL</code>, <code>ANTHROPIC_SMALL_FAST_MODEL</code></td><td>The GPT model you picked</td></tr>
<tr><td>fable</td><td><code>ANTHROPIC_DEFAULT_FABLE_MODEL</code></td><td>Left unset</td></tr>
</table></div>
<p>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:</p>
<div class="code"><span class="lang">Terminal</span><button class="copy" data-copy="cg-tier">Copy</button><pre id="cg-tier">magpie claude haiku codex/… # one tier on its own model
magpie claude haiku "" # back to the main model</pre></div>
<h2 id="effort"><a class="anchor" href="#effort">Reasoning effort</a></h2>
<p>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.</p>
<p>To hold one effort whatever Claude Code asks, set <span class="ui">effort</span> on Claude Code’s row. <span class="ui">opus effort</span>, <span class="ui">sonnet effort</span>, <span class="ui">haiku effort</span>, <span class="ui">fable effort</span> and <span class="ui">subagent effort</span> set it per tier. Each starts at <span class="ui">the effort Claude Code asks for</span>. An open Claude Code session keeps the effort it started with, so restart it to use a new one.</p>
<h2 id="limits"><a class="anchor" href="#limits">Limits and usage</a></h2>
<p>Requests are served on your ChatGPT account, so they count toward your plan’s usage limits, as Codex’s own requests do.</p>
<ul>
<li><b>See what’s used.</b> Turn on <span class="ui">status line</span> on Claude Code’s row: it shows the 5h and 7d use of the accounts magpie serves, under Claude Code’s prompt. <code>magpie accounts</code> lists each account and how much of its allowance is used. The <span class="ui">Usage</span> tab has the history.</li>
<li><b>When an account runs out.</b> 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 <span class="ui">Fallback</span>. The account comes back on its own once its window renews.</li>
</ul>
<h2 id="accounts"><a class="anchor" href="#accounts">Several accounts and failover</a></h2>
<ul>
<li><b>Add another account.</b> Click the ChatGPT tile again, or run <code>magpie accounts add codex</code> again. Each account is listed under the provider.</li>
<li><b>Spread requests over them.</b> Open the provider’s row and tick every account to use. <span class="ui">Smart</span> routing, the default, sends requests to the account with quota to spare whose allowance renews soonest.</li>
<li><b>Fall back to another model.</b> The provider’s <span class="ui">Fallback</span> lists models to use when every account is out, rate limited or down, a model from another subscription or an API key included.</li>
</ul>
<p>The routing modes are in <a href="/docs/start#routing">Get started</a>.</p>
<h2 id="back"><a class="anchor" href="#back">Switch back</a></h2>
<p>Pick one of Claude Code’s own models on its row, or run:</p>
<div class="code"><span class="lang">Terminal</span><button class="copy" data-copy="cg-back">Copy</button><pre id="cg-back">magpie claude default</pre></div>
<p>That takes magpie’s wiring out of Claude Code and puts back what it had. <span class="ui">Disconnect</span> on Claude Code’s row does the same.</p>
<div class="callout"><b>Your claude.ai sign-in.</b> On a magpie model, Claude Code’s <span class="ui">sign-in</span> setting is <span class="ui">magpie’s key</span> by default: claude.ai is signed out for it, so <code>/usage</code> plan limits, connectors, voice and <code>/teleport</code> are off. Set it to <span class="ui">claude.ai</span> to keep them.</div>
<h2 id="reverse"><a class="anchor" href="#reverse">The other way round: Claude in Codex</a></h2>
<p>A Claude Pro or Max subscription works in Codex the same way. Sign in to Claude in magpie and pick a <code>claude/…</code> model for Codex. Requests on a Claude subscription run through the Claude Code installed on your computer, so keep it installed.</p>
<div class="code"><span class="lang">Terminal</span><button class="copy" data-copy="cg-rev">Copy</button><pre id="cg-rev">magpie accounts add claude
magpie codex claude/claude-opus-5-5</pre></div>
<p>See <a href="/docs/codex-models">Models in Codex</a> and <a href="/docs/subscriptions">Subscriptions in any agent</a>.</p>
<h2 id="faq"><a class="anchor" href="#faq">FAQ</a></h2>
<h3>Can I use my ChatGPT Plus or Pro subscription in Claude Code?</h3>
<p>Yes. Sign in to ChatGPT in magpie and pick a <code>codex/…</code> model on Claude Code’s row, or run <code>magpie claude codex/gpt-5.5</code>. magpie translates Claude Code’s requests for the GPT model and the replies back, tool calls included.</p>
<h3>Do I need an OpenAI API key?</h3>
<p>No. magpie signs in on OpenAI’s own page, and Claude Code gets the gateway’s key. Your sign-in stays in magpie.</p>
<h3>Does it use my ChatGPT plan’s limits?</h3>
<p>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.</p>
<h3>Which model do Claude Code’s Haiku requests use?</h3>
<p>The GPT model you picked, unless you give the haiku tier a model of its own with <code>magpie claude haiku &lt;model&gt;</code>.</p>
<h3>How do I go back to Claude’s own models?</h3>
<p>Run <code>magpie claude default</code>, or pick one of Claude Code’s own models on its row in magpie.</p>
<h3>Do my requests go through a magpie server?</h3>
<p>No. The gateway runs on your computer. Requests go from it to OpenAI; magpie has no server of its own in that path.</p>
<p style="margin-top:48px">Using an API key instead? See <a href="/docs/claude-code-models">Models in Claude Code</a>. Something fails? See <a href="/docs/troubleshooting">Fixing common errors</a>, or ask on <a href="https://discord.gg/vGSnD3ZKQF">Discord</a>.</p>
</article>
</main>
<footer><div class="wrap">
<span>© 2026 magpie · MIT</span>
<div class="links">
<a href="/">Home</a>
<a href="/docs/intent">Intent routing</a>
<a href="/docs/plugins">Plugins</a>
<a href="/docs/remote">Remote magpie</a>
<a href="/docs/docker">Docker</a>
<a href="/docs/privacy">Privacy</a>
<a href="/docs/masking">Privacy masking</a>
<a href="/docs/mcp-router">MCP router</a>
<a href="/docs/library">Library</a>
<a href="/docs/claude-code-models">Models in Claude Code</a>
<a href="/docs/codex-models">Models in Codex</a>
<a href="/docs/gemini-cli-models">Models in Gemini CLI</a>
<a href="/docs/subscriptions">Subscriptions in any agent</a>
<a href="/docs/local-models">Local models</a>
<a href="/docs/opencode-models">Models in OpenCode</a>
<a href="/docs/alternatives">magpie vs CC Switch vs CCR</a>
<a href="/docs/import">Add to magpie</a>
<a href="/docs/integrate">Integrate</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
<a href="https://discord.gg/vGSnD3ZKQF">Discord</a>
<a href="/docs/contributors">Contributors</a>
<a href="https://github.com/yetone/magpie-releases/releases">Releases</a>
</div>
</div></footer>
<script>
(() => {
const next = { system: "light", light: "dark", dark: "system" };
document.querySelectorAll("button.theme").forEach((b) => {
b.dataset.mode = themeMode();
b.title = "Theme: " + themeMode();
b.addEventListener("click", () => setTheme(next[themeMode()]));
});
document.querySelectorAll(".copy").forEach((b) => b.addEventListener("click", async () => {
try {
await navigator.clipboard.writeText(document.getElementById(b.dataset.copy).textContent);
b.textContent = "Copied"; setTimeout(() => (b.textContent = "Copy"), 1400);
} catch {}
}));
})();
</script>
<script src="/docs.js"></script>
</body>
</html>
+1 -1
View File
@@ -240,7 +240,7 @@ magpie claude haiku "" # back to the main model</pre><
<p>Sign in to the subscription in magpie: <span class="ui">+ Add provider</span>, 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 <code>codex/…</code> or <code>copilot/…</code>.</p>
<div class="code"><span class="lang">Terminal</span><button class="copy" data-copy="ex-cc-gpt">Copy</button><pre id="ex-cc-gpt">magpie accounts add codex # sign in to a ChatGPT account
magpie claude codex/gpt-5.5</pre></div>
<p>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 <code>antigravity/…</code>.</p>
<p>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 <code>antigravity/…</code>. For a ChatGPT plan in full, tiers, effort and limits included, see <a href="/docs/claude-code-chatgpt">ChatGPT in Claude Code</a>.</p>
<h2 id="routing"><a class="anchor" href="#routing">Routing over several keys</a></h2>
<p>With several keys or accounts, magpie can spread Claude Code’s requests over them and move on when one runs out.</p>
@@ -0,0 +1,308 @@
<!doctype html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ChatGPT Plus/Pro のサブスクを Claude Code で使う · magpie</title>
<meta name="description" content="magpie で ChatGPT に一度サインインすれば、Claude Code を ChatGPT プランの GPT モデルで動かせます。Opus・Sonnet・Haiku の対応、推論レベル、使用量の上限、複数アカウント、元に戻す方法まで。OpenAI の API キーは不要です。">
<meta name="color-scheme" content="light dark">
<meta name="theme-color" content="#fafafa">
<script>
(() => {
let mode = "system";
try { mode = localStorage.getItem("theme") || "system"; } catch {}
const q = matchMedia("(prefers-color-scheme: dark)");
const apply = () => {
const t = mode === "system" ? (q.matches ? "dark" : "light") : mode;
document.documentElement.dataset.theme = t;
document.querySelector('meta[name="theme-color"]').content = t === "dark" ? "#0b0b0c" : "#fafafa";
document.querySelectorAll("button.theme").forEach((b) => { b.dataset.mode = mode; b.title = "Theme: " + mode; });
};
q.addEventListener("change", () => mode === "system" && apply());
window.setTheme = (m) => { mode = m; try { m === "system" ? localStorage.removeItem("theme") : localStorage.setItem("theme", m); } catch {} apply(); };
window.themeMode = () => mode;
apply();
})();
</script>
<script>try{if(/Linux/.test(navigator.userAgent)&&!/Android/.test(navigator.userAgent)||localStorage.getItem("omarchy")||/[?&]omarchy=/.test(location.search))document.write('<script src="/omarchy.js"><\/script>')}catch(e){}</script>
<link rel="icon" href="/favicon.png" type="image/png">
<link rel="apple-touch-icon" href="/img/icon-256.png">
<link rel="alternate" hreflang="en" href="https://usemagpie.ai/docs/claude-code-chatgpt">
<link rel="alternate" hreflang="zh" href="https://usemagpie.ai/docs/zh/claude-code-chatgpt">
<link rel="alternate" hreflang="ja" href="https://usemagpie.ai/docs/ja/claude-code-chatgpt">
<link rel="alternate" hreflang="x-default" href="https://usemagpie.ai/docs/claude-code-chatgpt">
<link rel="canonical" href="https://usemagpie.ai/docs/ja/claude-code-chatgpt">
<link rel="stylesheet" href="/docs.css">
<meta property="og:site_name" content="magpie">
<meta property="og:title" content="ChatGPT Plus/Pro のサブスクを Claude Code で使う">
<meta property="og:description" content="magpie で ChatGPT に一度サインインすれば、Claude Code を ChatGPT プランの GPT モデルで動かせます。Opus・Sonnet・Haiku の対応、推論レベル、使用量の上限、複数アカウント、元に戻す方法まで。OpenAI の API キーは不要です。">
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
<meta property="og:url" content="https://usemagpie.ai/docs/ja/claude-code-chatgpt">
<meta name="twitter:card" content="summary_large_image">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "TechArticle",
"headline": "ChatGPT Plus/Pro のサブスクを Claude Code で使う",
"description": "magpie で ChatGPT に一度サインインすれば、Claude Code を ChatGPT プランの GPT モデルで動かせます。Opus・Sonnet・Haiku の対応、推論レベル、使用量の上限、複数アカウント、元に戻す方法まで。OpenAI の API キーは不要です。",
"inLanguage": "ja",
"url": "https://usemagpie.ai/docs/ja/claude-code-chatgpt",
"about": {
"@type": "SoftwareApplication",
"name": "magpie",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "macOS, Windows, Linux"
},
"publisher": {
"@type": "Organization",
"name": "magpie",
"url": "https://usemagpie.ai/"
}
},
{
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "ChatGPT Plus や Pro のサブスクを Claude Code で使えますか?",
"acceptedAnswer": {
"@type": "Answer",
"text": "使えます。magpie で ChatGPT にサインインし、Claude Code の行で codex/… のモデルを選ぶか、magpie claude codex/gpt-5.5 を実行します。magpie が Claude Code のリクエストを GPT モデル向けに、返答を元の形に変換します。ツール呼び出しも含みます。"
}
},
{
"@type": "Question",
"name": "OpenAI の API キーは必要ですか?",
"acceptedAnswer": {
"@type": "Answer",
"text": "不要です。magpie は OpenAI 自身のページでサインインし、Claude Code にはゲートウェイのキーが渡されます。サインインは magpie の中だけに置かれます。"
}
},
{
"@type": "Question",
"name": "ChatGPT プランの上限は消費されますか?",
"acceptedAnswer": {
"@type": "Answer",
"text": "はい。リクエストはあなたの ChatGPT アカウントで処理され、その使用量上限に数えられます。magpie のステータスラインは、Claude Code の入力欄の下に各アカウントの 5 時間と 7 日の使用量を表示します。"
}
},
{
"@type": "Question",
"name": "Claude Code の Haiku のリクエストはどのモデルを使いますか?",
"acceptedAnswer": {
"@type": "Answer",
"text": "選んだ GPT モデルです。magpie claude haiku <model> で haiku ティアに別のモデルを設定することもできます。"
}
},
{
"@type": "Question",
"name": "Claude 自身のモデルに戻すには?",
"acceptedAnswer": {
"@type": "Answer",
"text": "magpie claude default を実行するか、magpie の Claude Code の行で Claude Code 自身のモデルを選びます。"
}
},
{
"@type": "Question",
"name": "リクエストは magpie のサーバーを通りますか?",
"acceptedAnswer": {
"@type": "Answer",
"text": "通りません。ゲートウェイはお使いのコンピュータ上で動き、リクエストはそこから OpenAI に直接送られます。間に magpie のサーバーはありません。"
}
}
]
}
]
}
</script>
</head>
<body>
<nav><div class="wrap">
<a class="brand" href="/ja/"><img class="bird" src="/img/magpie-small.svg" alt="">magpie <small>ドキュメント</small></a>
<div class="links">
<a href="/ja/">ホーム</a>
<a href="/docs/ja/start">はじめに</a>
<a href="/docs/ja/intent">インテントルーティング</a>
<a href="/docs/ja/plugins">プラグイン</a>
<a class="toc-only" href="/docs/ja/remote">リモート magpie</a>
<a class="toc-only" href="/docs/ja/docker">Docker</a>
<a class="toc-only" href="/docs/ja/privacy">プライバシー</a>
<a class="toc-only" href="/docs/ja/masking">プライバシーマスキング</a>
<a class="toc-only" href="/docs/ja/mcp-router">MCP ルーター</a>
<a class="toc-only" href="/docs/ja/library">ライブラリ</a>
<a class="toc-only" href="/docs/ja/claude-code-models">Claude Code で他のモデル</a>
<a class="toc-only" href="/docs/ja/codex-models">Codex で他のモデル</a>
<a class="toc-only" href="/docs/ja/gemini-cli-models">Gemini CLI で他のモデル</a>
<a class="toc-only" href="/docs/ja/subscriptions">サブスクを任意のエージェントで</a>
<a class="toc-only" href="/docs/ja/local-models">ローカルモデル</a>
<a class="toc-only" href="/docs/ja/opencode-models">OpenCode で他のモデル</a>
<a class="toc-only" href="/docs/ja/alternatives">CC Switch・CCR との比較</a>
<a href="/docs/ja/import">magpie に追加</a>
<a href="/docs/integrate">アプリ連携</a>
<a href="https://github.com/yetone/magpie-releases/releases">リリース</a>
</div>
<div class="langs">
<button class="icon-btn lang" type="button" aria-label="言語" title="言語" aria-haspopup="true" aria-expanded="false" aria-controls="langs"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><circle cx="8" cy="8" r="6.25"/><path d="M1.75 8h12.5M8 1.75c1.7 1.75 2.55 3.83 2.55 6.25S9.7 12.5 8 14.25M8 1.75C6.3 3.5 5.45 5.58 5.45 8S6.3 12.5 8 14.25"/></svg></button>
<div class="lang-menu" id="langs" hidden>
<a href="/docs/claude-code-chatgpt" hreflang="en" lang="en">English</a>
<a href="/docs/zh/claude-code-chatgpt" hreflang="zh" lang="zh">中文</a>
<a href="/docs/ja/claude-code-chatgpt" hreflang="ja" lang="ja">日本語</a>
</div>
</div>
<a class="icon-btn" href="https://discord.gg/vGSnD3ZKQF" aria-label="Discord の magpie" title="Discord に参加"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/></svg></a>
<a class="icon-btn" href="https://github.com/yetone/magpie" aria-label="GitHub の magpie" title="GitHub のソースコード"><svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg></a>
<button class="icon-btn theme" type="button" aria-label="Theme" title="Theme: system"><svg class="i-system" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1.75" y="2.75" width="12.5" height="8.5" rx="1.5"/><path d="M5.5 14h5M8 11.25V14"/></svg><svg class="i-light" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><circle cx="8" cy="8" r="3"/><path d="M8 1v1.5M8 13.5V15M1 8h1.5M13.5 8H15M3 3l1 1M12 12l1 1M3 13l1-1M12 4l1-1"/></svg><svg class="i-dark" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"><path d="M13.5 9.5A5.5 5.5 0 0 1 6.5 2.5a5.5 5.5 0 1 0 7 7Z"/></svg></button>
<a class="btn small" href="/#get">ダウンロード</a>
</div></nav>
<main class="wrap doc">
<aside class="toc">
<p>Claude Code で ChatGPT</p>
<a href="#overview">仕組み</a>
<a href="#signin">ChatGPT にサインイン</a>
<a href="#pick">GPT モデルを選ぶ</a>
<a href="#tiers">Opus・Sonnet・Haiku</a>
<a href="#effort">推論レベル</a>
<a href="#limits">上限と使用量</a>
<a href="#accounts">複数のアカウント</a>
<a href="#back">元に戻す</a>
<a href="#reverse">逆の使い方</a>
<a href="#faq">よくある質問</a>
</aside>
<article>
<p class="eyebrow" id="overview">ドキュメント · ガイド</p>
<h1>ChatGPT Plus/Pro のサブスクを Claude Code で使う</h1>
<p class="lede">Claude Code は ChatGPT Plus・Pro プランの GPT モデルで動かせます。magpie で ChatGPT にサインインし、Claude Code に <code>codex/…</code> のモデルを選べば、あとはいつもどおり使えます。OpenAI の API キーは要りません。</p>
<p>Claude Code は Anthropic の Messages API で話します。magpie はお使いのコンピュータ上でゲートウェイ(<code>127.0.0.1:3425</code>)を動かし、Claude Code のリクエストを GPT モデル向けに、返答を Claude Code 向けに変換します。ストリーミングとツール呼び出しも含みます。magpie はゲートウェイのアドレスとキーを Claude Code の <code>settings.json</code> に書き込み、ChatGPT のサインインは magpie の中だけに置かれます。</p>
<h2 id="signin"><a class="anchor" href="#signin">ChatGPT にサインイン</a></h2>
<ol class="steps">
<li><b>プロバイダの追加を開く</b>magpie の <span class="ui">プロバイダ</span> タブで <span class="ui">+ プロバイダを追加</span> を押します。</li>
<li><b>ChatGPT のタイルをクリック</b>ブラウザで OpenAI 自身のサインインページが開きます。終わるとすぐにアカウントが表示されます。</li>
</ol>
<p>ターミナルからでも追加できます。</p>
<div class="code"><span class="lang">ターミナル</span><button class="copy" data-copy="cg-signin">コピー</button><pre id="cg-signin">magpie accounts add codex # ChatGPT アカウントにサインイン</pre></div>
<p>このアカウントのモデルは <code>codex/…</code> です。</p>
<h2 id="pick"><a class="anchor" href="#pick">Claude Code に GPT モデルを選ぶ</a></h2>
<p><span class="ui">エージェント</span> タブで Claude Code の行のモデルをクリックし、<code>codex/…</code> のモデルを選びます。ターミナルからは:</p>
<div class="code"><span class="lang">ターミナル</span><button class="copy" data-copy="cg-pick">コピー</button><pre id="cg-pick">magpie models # すべてのモデルを provider/model で表示
magpie claude codex/gpt-5.5</pre></div>
<p>Claude Code の中でも、<code>/model</code> に magpie のモデルが “via magpie” 付きで並ぶので、そこで切り替えられます。</p>
<div class="callout"><b>一部のセッションだけ GPT にしたいとき。</b>magpie で Claude Code を接続せず、必要なときに <code>claude-magpie</code> を実行します。同じ <code>claude</code> をそのセッションだけ magpie の設定で起動し、<code>settings.json</code> は書き換えません。</div>
<h2 id="tiers"><a class="anchor" href="#tiers">Opus・Sonnet・Haiku の対応</a></h2>
<p>Claude Code はティアでモデルを求めます:<code>opus</code>、<code>sonnet</code>、<code>haiku</code>、<code>fable</code>。セッションのタイトルや Explore サブエージェントなどの小さな仕事は haiku ティアに行きます。メインモデルが GPT モデルのときは:</p>
<div class="table-wrap"><table>
<tr><th>ティア</th><th><code>env</code> の変数</th><th>既定</th></tr>
<tr><td>opus</td><td><code>ANTHROPIC_DEFAULT_OPUS_MODEL</code></td><td>選んだ GPT モデル</td></tr>
<tr><td>sonnet</td><td><code>ANTHROPIC_DEFAULT_SONNET_MODEL</code></td><td>選んだ GPT モデル</td></tr>
<tr><td>haiku</td><td><code>ANTHROPIC_DEFAULT_HAIKU_MODEL</code>、<code>ANTHROPIC_SMALL_FAST_MODEL</code></td><td>選んだ GPT モデル</td></tr>
<tr><td>fable</td><td><code>ANTHROPIC_DEFAULT_FABLE_MODEL</code></td><td>設定しない</td></tr>
</table></div>
<p>ティアに別のモデルを使うには(haiku を小さいモデルにするなど)、magpie の Claude Code の行で設定するか、ターミナルから:</p>
<div class="code"><span class="lang">ターミナル</span><button class="copy" data-copy="cg-tier">コピー</button><pre id="cg-tier">magpie claude haiku codex/… # 1 つのティアだけ別のモデルに
magpie claude haiku "" # メインモデルに戻す</pre></div>
<h2 id="effort"><a class="anchor" href="#effort">推論レベル</a></h2>
<p>Claude Code が thinking を有効にしたリクエストでは、Claude Code が求める推論レベルがそのまま GPT モデルの推論レベルになります。magpie は各モデルが持つ推論レベルも Claude Code に伝えます。</p>
<p>Claude Code の求めに関わらず固定したいときは、Claude Code の行で <span class="ui">推論レベル</span> を設定します。<span class="ui">opus の推論レベル</span> などはティアごと、<span class="ui">サブエージェントの推論レベル</span> はサブエージェントの設定です。どれも既定は <span class="ui">Claude Code が要求する推論レベル</span> です。開いている Claude Code セッションは起動時の推論レベルのままなので、反映するには再起動してください。</p>
<h2 id="limits"><a class="anchor" href="#limits">上限と使用量</a></h2>
<p>リクエストはあなたの ChatGPT アカウントで処理されるので、Codex 自身のリクエストと同じくプランの使用量上限に数えられます。</p>
<ul>
<li><b>使用量を見る。</b>Claude Code の行の <span class="ui">ステータスライン</span> をオンにすると、Claude Code の入力欄の下に、magpie が使うアカウントの 5 時間と 7 日の使用量を表示します。<code>magpie accounts</code> は各アカウントの使用済みの割合を表示します。履歴は <span class="ui">使用量</span> タブにあります。</li>
<li><b>アカウントを使い切ったとき。</b>magpie はそのアカウントを、OpenAI の拒否が示すリセット時刻まで、示されなければ枠全体が更新されるまで、それも分からなければ 5 時間休ませ、その間のリクエストを次のアカウントかプロバイダの <span class="ui">フォールバック</span> に送ります。枠が更新されるとアカウントは自動で戻ります。</li>
</ul>
<h2 id="accounts"><a class="anchor" href="#accounts">複数のアカウントとフェイルオーバー</a></h2>
<ul>
<li><b>アカウントを増やす。</b>ChatGPT のタイルをもう一度クリックするか、<code>magpie accounts add codex</code> をもう一度実行します。各アカウントはプロバイダの下に並びます。</li>
<li><b>リクエストを分散する。</b>プロバイダの行を開き、使うアカウントにチェックを入れます。既定の <span class="ui">スマート</span> ルーティングは、クォータに余裕があり、最も早く更新されるアカウントに送ります。</li>
<li><b>別のモデルに切り替える。</b>プロバイダの <span class="ui">フォールバック</span> には、すべてのアカウントが切れたり、レート制限やエラーになったときに使うモデルを並べます。別のサブスクや API キーのモデルも選べます。</li>
</ul>
<p>ルーティングの種類は <a href="/docs/ja/start#routing">はじめに</a> にあります。</p>
<h2 id="back"><a class="anchor" href="#back">元に戻す</a></h2>
<p>Claude Code の行で Claude Code 自身のモデルを選ぶか、次を実行します。</p>
<div class="code"><span class="lang">ターミナル</span><button class="copy" data-copy="cg-back">コピー</button><pre id="cg-back">magpie claude default</pre></div>
<p>magpie による接続を外し、元の設定に戻します。Claude Code の行の <span class="ui">切断</span> も同じです。</p>
<div class="callout"><b>claude.ai のサインイン。</b>magpie のモデルを使うとき、Claude Code の <span class="ui">サインイン</span> の既定は <span class="ui">magpie のキー</span> です。claude.ai からはサインアウトされ、<code>/usage</code> のプラン上限、コネクタ、音声、<code>/teleport</code> は使えません。残したいときは <span class="ui">claude.ai</span> にします。</div>
<h2 id="reverse"><a class="anchor" href="#reverse">逆の使い方:Codex で Claude</a></h2>
<p>Claude Pro や Max のサブスクも同じように Codex で使えます。magpie で Claude にサインインし、Codex に <code>claude/…</code> のモデルを選びます。Claude サブスクのリクエストはコンピュータにインストールされた Claude Code を通るので、アンインストールしないでください。</p>
<div class="code"><span class="lang">ターミナル</span><button class="copy" data-copy="cg-rev">コピー</button><pre id="cg-rev">magpie accounts add claude
magpie codex claude/claude-opus-5-5</pre></div>
<p><a href="/docs/ja/codex-models">Codex で他のモデル</a>と<a href="/docs/ja/subscriptions">サブスクを任意のエージェントで</a>も参照してください。</p>
<h2 id="faq"><a class="anchor" href="#faq">よくある質問</a></h2>
<h3>ChatGPT Plus や Pro のサブスクを Claude Code で使えますか?</h3>
<p>使えます。magpie で ChatGPT にサインインし、Claude Code の行で <code>codex/…</code> のモデルを選ぶか、<code>magpie claude codex/gpt-5.5</code> を実行します。magpie が Claude Code のリクエストを GPT モデル向けに、返答を元の形に変換します。ツール呼び出しも含みます。</p>
<h3>OpenAI の API キーは必要ですか?</h3>
<p>不要です。magpie は OpenAI 自身のページでサインインし、Claude Code にはゲートウェイのキーが渡されます。サインインは magpie の中だけに置かれます。</p>
<h3>ChatGPT プランの上限は消費されますか?</h3>
<p>はい。リクエストはあなたの ChatGPT アカウントで処理され、その使用量上限に数えられます。magpie のステータスラインは、Claude Code の入力欄の下に各アカウントの 5 時間と 7 日の使用量を表示します。</p>
<h3>Claude Code の Haiku のリクエストはどのモデルを使いますか?</h3>
<p>選んだ GPT モデルです。<code>magpie claude haiku &lt;model&gt;</code> で haiku ティアに別のモデルを設定することもできます。</p>
<h3>Claude 自身のモデルに戻すには?</h3>
<p><code>magpie claude default</code> を実行するか、magpie の Claude Code の行で Claude Code 自身のモデルを選びます。</p>
<h3>リクエストは magpie のサーバーを通りますか?</h3>
<p>通りません。ゲートウェイはお使いのコンピュータ上で動き、リクエストはそこから OpenAI に直接送られます。間に magpie のサーバーはありません。</p>
<p style="margin-top:48px">API キーを使う場合は <a href="/docs/ja/claude-code-models">Claude Code で他のモデル</a>を参照してください。エラーが出るときは <a href="/docs/ja/troubleshooting">よくあるエラーの直し方</a>、または <a href="https://discord.gg/vGSnD3ZKQF">Discord</a> で質問してください。</p>
</article>
</main>
<footer><div class="wrap">
<span>© 2026 magpie · MIT</span>
<div class="links">
<a href="/ja/">ホーム</a>
<a href="/docs/ja/intent">インテントルーティング</a>
<a href="/docs/ja/plugins">プラグイン</a>
<a href="/docs/ja/remote">リモート magpie</a>
<a href="/docs/ja/docker">Docker</a>
<a href="/docs/ja/privacy">プライバシー</a>
<a href="/docs/ja/masking">プライバシーマスキング</a>
<a href="/docs/ja/mcp-router">MCP ルーター</a>
<a href="/docs/ja/library">ライブラリ</a>
<a href="/docs/ja/claude-code-models">Claude Code で他のモデル</a>
<a href="/docs/ja/codex-models">Codex で他のモデル</a>
<a href="/docs/ja/gemini-cli-models">Gemini CLI で他のモデル</a>
<a href="/docs/ja/subscriptions">サブスクを任意のエージェントで</a>
<a href="/docs/ja/local-models">ローカルモデル</a>
<a href="/docs/ja/opencode-models">OpenCode で他のモデル</a>
<a href="/docs/ja/alternatives">CC Switch・CCR との比較</a>
<a href="/docs/ja/import">magpie に追加</a>
<a href="/docs/integrate">アプリ連携</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
<a href="https://discord.gg/vGSnD3ZKQF">Discord</a>
<a href="/docs/ja/contributors">コントリビューター</a>
<a href="https://github.com/yetone/magpie-releases/releases">リリース</a>
</div>
</div></footer>
<script>
(() => {
const next = { system: "light", light: "dark", dark: "system" };
document.querySelectorAll("button.theme").forEach((b) => {
b.dataset.mode = themeMode();
b.title = "Theme: " + themeMode();
b.addEventListener("click", () => setTheme(next[themeMode()]));
});
document.querySelectorAll(".copy").forEach((b) => b.addEventListener("click", async () => {
try {
await navigator.clipboard.writeText(document.getElementById(b.dataset.copy).textContent);
b.textContent = "コピーしました"; setTimeout(() => (b.textContent = "コピー"), 1400);
} catch {}
}));
})();
</script>
<script src="/docs.js"></script>
</body>
</html>
+1 -1
View File
@@ -240,7 +240,7 @@ magpie claude haiku "" # メインのモデルに戻
<p>magpie でサブスクリプションにサインインします:<span class="ui">+ Add provider</span> から ChatGPT または Copilot のタイルを選ぶと、magpie がベンダー自身のサインインページを開きます。するとそのアカウントのモデルが、Claude Code のピッカーに <code>codex/…</code> または <code>copilot/…</code> として表示されます。</p>
<div class="code"><span class="lang">ターミナル</span><button class="copy" data-copy="ex-cc-gpt">コピー</button><pre id="ex-cc-gpt">magpie accounts add codex # ChatGPT アカウントにサインイン
magpie claude codex/gpt-5.5</pre></div>
<p>Claude Code が話すのはあくまで Anthropic Messages です。magpie が各リクエストを GPT モデル向けに変換し、応答を戻します。ツール呼び出しも含みます。Antigravity アカウントも同じように <code>antigravity/…</code> として使えます。</p>
<p>Claude Code が話すのはあくまで Anthropic Messages です。magpie が各リクエストを GPT モデル向けに変換し、応答を戻します。ツール呼び出しも含みます。Antigravity アカウントも同じように <code>antigravity/…</code> として使えます。ティア、推論レベル、上限を含む ChatGPT プランの使い方は <a href="/docs/ja/claude-code-chatgpt">Claude Code で ChatGPT</a> にあります。</p>
<h2 id="routing"><a class="anchor" href="#routing">複数のキーでルーティング</a></h2>
<p>キーやアカウントが複数あれば、magpie は Claude Code のリクエストをそれらに分散し、1 つが使い切られたら次へ移れます。</p>
+1 -1
View File
@@ -362,7 +362,7 @@ IP-CIDR6,::1/128,DIRECT,no-resolve</pre>
</ol>
<p>モデル id は magpie のもの(<code>magpie models</code>)です。共有をオンにすると、同じネットワークのほかのコンピューターもゲートウェイキーで接続できます。<a href="/docs/ja/remote#share">リモート magpie</a> を参照してください。</p>
<p style="margin-top:48px">困ったときや、共有したい構成があるときは <a href="https://discord.gg/vGSnD3ZKQF">Discord</a> でどうぞ。ユーザーにすぐ使えるプロバイダを配りたいベンダーの方は <a href="/docs/ja/import">magpie に追加</a> をご覧ください。</p>
<p style="margin-top:48px">ゲートウェイのエラーは <a href="/docs/ja/troubleshooting">よくあるエラーの直し方</a> を参照してください。困ったときや、共有したい構成があるときは <a href="https://discord.gg/vGSnD3ZKQF">Discord</a> でどうぞ。ユーザーにすぐ使えるプロバイダを配りたいベンダーの方は <a href="/docs/ja/import">magpie に追加</a> をご覧ください。</p>
</article>
</main>
+1 -1
View File
@@ -236,7 +236,7 @@
<h2 id="faq"><a class="anchor" href="#faq">よくある質問</a></h2>
<h3>ChatGPT Plus や Pro のサブスクリプションを Claude Code で使えますか?</h3>
<p>はい。magpie で ChatGPT にサインインし、Claude Code の行で <code>codex/…</code> のモデルを選ぶか、<code>magpie claude codex/gpt-5.5</code> を実行します。magpie が Claude Code の Anthropic リクエストを GPT モデル向けに変換し、応答を戻します。ツール呼び出しも含みます。</p>
<p>はい。magpie で ChatGPT にサインインし、Claude Code の行で <code>codex/…</code> のモデルを選ぶか、<code>magpie claude codex/gpt-5.5</code> を実行します。magpie が Claude Code の Anthropic リクエストを GPT モデル向けに変換し、応答を戻します。ツール呼び出しも含みます。ティアや推論レベルを含む設定の全体は <a href="/docs/ja/claude-code-chatgpt">Claude Code で ChatGPT</a> にあります。</p>
<h3>Claude Pro や Max のサブスクリプションを Codex や OpenCode で使えますか?</h3>
<p>はい。magpie で Claude にサインインし、エージェントの行で <code>claude/…</code> のモデルを選びます。Claude サブスクリプションでのリクエストは、コンピューターにインストールされた Claude Code を通じて送られるので、Claude Code はインストールしたままにしてください。</p>
<h3>GitHub Copilot のモデルを VS Code の外で使えますか?</h3>
+342
View File
@@ -0,0 +1,342 @@
<!doctype html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>よくあるエラーの直し方:401・429・502・504 など · magpie</title>
<meta name="description" content="magpie のゲートウェイのエラーの意味と直し方:401 と 403、429 と休止、502 と 504、モデルが見つからない、エージェントにモデルが出ない、ポート 3425 が使用中、WSL のエージェント、別のコンピュータからの利用。">
<meta name="color-scheme" content="light dark">
<meta name="theme-color" content="#fafafa">
<script>
(() => {
let mode = "system";
try { mode = localStorage.getItem("theme") || "system"; } catch {}
const q = matchMedia("(prefers-color-scheme: dark)");
const apply = () => {
const t = mode === "system" ? (q.matches ? "dark" : "light") : mode;
document.documentElement.dataset.theme = t;
document.querySelector('meta[name="theme-color"]').content = t === "dark" ? "#0b0b0c" : "#fafafa";
document.querySelectorAll("button.theme").forEach((b) => { b.dataset.mode = mode; b.title = "Theme: " + mode; });
};
q.addEventListener("change", () => mode === "system" && apply());
window.setTheme = (m) => { mode = m; try { m === "system" ? localStorage.removeItem("theme") : localStorage.setItem("theme", m); } catch {} apply(); };
window.themeMode = () => mode;
apply();
})();
</script>
<script>try{if(/Linux/.test(navigator.userAgent)&&!/Android/.test(navigator.userAgent)||localStorage.getItem("omarchy")||/[?&]omarchy=/.test(location.search))document.write('<script src="/omarchy.js"><\/script>')}catch(e){}</script>
<link rel="icon" href="/favicon.png" type="image/png">
<link rel="apple-touch-icon" href="/img/icon-256.png">
<link rel="alternate" hreflang="en" href="https://usemagpie.ai/docs/troubleshooting">
<link rel="alternate" hreflang="zh" href="https://usemagpie.ai/docs/zh/troubleshooting">
<link rel="alternate" hreflang="ja" href="https://usemagpie.ai/docs/ja/troubleshooting">
<link rel="alternate" hreflang="x-default" href="https://usemagpie.ai/docs/troubleshooting">
<link rel="canonical" href="https://usemagpie.ai/docs/ja/troubleshooting">
<link rel="stylesheet" href="/docs.css">
<meta property="og:site_name" content="magpie">
<meta property="og:title" content="よくあるエラーの直し方:401・429・502・504 など">
<meta property="og:description" content="magpie のゲートウェイのエラーの意味と直し方:401 と 403、429 と休止、502 と 504、モデルが見つからない、エージェントにモデルが出ない、ポート 3425 が使用中、WSL のエージェント、別のコンピュータからの利用。">
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
<meta property="og:url" content="https://usemagpie.ai/docs/ja/troubleshooting">
<meta name="twitter:card" content="summary_large_image">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "TechArticle",
"headline": "よくあるエラーの直し方:401・429・502・504 など",
"description": "magpie のゲートウェイのエラーの意味と直し方:401 と 403、429 と休止、502 と 504、モデルが見つからない、エージェントにモデルが出ない、ポート 3425 が使用中、WSL のエージェント、別のコンピュータからの利用。",
"inLanguage": "ja",
"url": "https://usemagpie.ai/docs/ja/troubleshooting",
"about": {
"@type": "SoftwareApplication",
"name": "magpie",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "macOS, Windows, Linux"
},
"publisher": {
"@type": "Organization",
"name": "magpie",
"url": "https://usemagpie.ai/"
}
},
{
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "プロバイダは動いているのに、なぜ 502 になるのですか?",
"acceptedAnswer": {
"@type": "Answer",
"text": "プロバイダが Web ページや空の本文など、API の返答でないものを返しました。たいていはベース URL が API ではなくベンダーの Web サイトを指しています。"
}
},
{
"@type": "Question",
"name": "429 のあと、なぜアカウントが使われないままなのですか?",
"acceptedAnswer": {
"@type": "Answer",
"text": "magpie はベンダーが示したリセットまで、示されなければしばらくの間そのアカウントを休ませます。プロバイダの行に復帰時刻が出ており、「今すぐ試す」で休止を終えられます。"
}
},
{
"@type": "Question",
"name": "“magpie knows no model” とはどういう意味ですか?",
"acceptedAnswer": {
"@type": "Answer",
"text": "その名前のモデルを提供するプロバイダがありません。magpie models が表示する provider/model で指定するか、プロバイダをオンに戻します。"
}
},
{
"@type": "Question",
"name": "magpie のポートを変えるには?",
"acceptedAnswer": {
"@type": "Answer",
"text": "設定 › ネットワークと共有 › ゲートウェイのアドレス です。magpie が接続したエージェントも一緒に移ります。"
}
},
{
"@type": "Question",
"name": "WSL のエージェントから Windows の magpie を使えますか?",
"acceptedAnswer": {
"@type": "Answer",
"text": "使えます。magpie は実行中の WSL ディストリビューションのエージェントを見つけ、届くアドレスで設定します。NAT ネットワークでは、Windows ファイアウォールが WSL からの接続を通す必要があります。"
}
},
{
"@type": "Question",
"name": "別のコンピュータから magpie を使えますか?",
"acceptedAnswer": {
"@type": "Answer",
"text": "使えます。設定 › ネットワークと共有 › ローカルネットワークで共有 をオンにし、相手のコンピュータからゲートウェイキーを送ります。ポートはインターネットに公開しないでください。"
}
}
]
}
]
}
</script>
</head>
<body>
<nav><div class="wrap">
<a class="brand" href="/ja/"><img class="bird" src="/img/magpie-small.svg" alt="">magpie <small>ドキュメント</small></a>
<div class="links">
<a href="/ja/">ホーム</a>
<a href="/docs/ja/start">はじめに</a>
<a href="/docs/ja/intent">インテントルーティング</a>
<a href="/docs/ja/plugins">プラグイン</a>
<a class="toc-only" href="/docs/ja/remote">リモート magpie</a>
<a class="toc-only" href="/docs/ja/docker">Docker</a>
<a class="toc-only" href="/docs/ja/privacy">プライバシー</a>
<a class="toc-only" href="/docs/ja/masking">プライバシーマスキング</a>
<a class="toc-only" href="/docs/ja/mcp-router">MCP ルーター</a>
<a class="toc-only" href="/docs/ja/library">ライブラリ</a>
<a class="toc-only" href="/docs/ja/claude-code-models">Claude Code で他のモデル</a>
<a class="toc-only" href="/docs/ja/codex-models">Codex で他のモデル</a>
<a class="toc-only" href="/docs/ja/gemini-cli-models">Gemini CLI で他のモデル</a>
<a class="toc-only" href="/docs/ja/subscriptions">サブスクを任意のエージェントで</a>
<a class="toc-only" href="/docs/ja/local-models">ローカルモデル</a>
<a class="toc-only" href="/docs/ja/opencode-models">OpenCode で他のモデル</a>
<a class="toc-only" href="/docs/ja/alternatives">CC Switch・CCR との比較</a>
<a href="/docs/ja/import">magpie に追加</a>
<a href="/docs/integrate">アプリ連携</a>
<a href="https://github.com/yetone/magpie-releases/releases">リリース</a>
</div>
<div class="langs">
<button class="icon-btn lang" type="button" aria-label="言語" title="言語" aria-haspopup="true" aria-expanded="false" aria-controls="langs"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><circle cx="8" cy="8" r="6.25"/><path d="M1.75 8h12.5M8 1.75c1.7 1.75 2.55 3.83 2.55 6.25S9.7 12.5 8 14.25M8 1.75C6.3 3.5 5.45 5.58 5.45 8S6.3 12.5 8 14.25"/></svg></button>
<div class="lang-menu" id="langs" hidden>
<a href="/docs/troubleshooting" hreflang="en" lang="en">English</a>
<a href="/docs/zh/troubleshooting" hreflang="zh" lang="zh">中文</a>
<a href="/docs/ja/troubleshooting" hreflang="ja" lang="ja">日本語</a>
</div>
</div>
<a class="icon-btn" href="https://discord.gg/vGSnD3ZKQF" aria-label="Discord の magpie" title="Discord に参加"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/></svg></a>
<a class="icon-btn" href="https://github.com/yetone/magpie" aria-label="GitHub の magpie" title="GitHub のソースコード"><svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg></a>
<button class="icon-btn theme" type="button" aria-label="Theme" title="Theme: system"><svg class="i-system" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1.75" y="2.75" width="12.5" height="8.5" rx="1.5"/><path d="M5.5 14h5M8 11.25V14"/></svg><svg class="i-light" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><circle cx="8" cy="8" r="3"/><path d="M8 1v1.5M8 13.5V15M1 8h1.5M13.5 8H15M3 3l1 1M12 12l1 1M3 13l1-1M12 4l1-1"/></svg><svg class="i-dark" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"><path d="M13.5 9.5A5.5 5.5 0 0 1 6.5 2.5a5.5 5.5 0 1 0 7 7Z"/></svg></button>
<a class="btn small" href="/#get">ダウンロード</a>
</div></nav>
<main class="wrap doc">
<aside class="toc">
<p>よくあるエラー</p>
<a href="#overview">まず見る場所</a>
<a href="#auth">401 と 403</a>
<a href="#limits">429 と休止</a>
<a href="#bad-gateway">502</a>
<a href="#timeout">504</a>
<a href="#unknown-model">モデルが見つからない</a>
<a href="#not-listed">モデルが出ない</a>
<a href="#port">ポート 3425 が使用中</a>
<a href="#wsl">WSL のエージェント</a>
<a href="#lan">別のコンピュータから</a>
<a href="#plugins">プラグインへの移行</a>
<a href="#faq">よくある質問</a>
</aside>
<article>
<p class="eyebrow" id="overview">ドキュメント · ヘルプ</p>
<h1>よくあるエラーの直し方:401・429・502・504 など</h1>
<p class="lede">magpie のゲートウェイのエラーは、何が起きたかを自分の言葉で伝えます。このページでは、よくあるエラーとその原因、直し方をまとめます。</p>
<p>すべてのリクエストは magpie の <span class="ui">ルーティング</span> ページに並び、どのプロバイダとアカウントに送られ、各試行がどう終わったかが分かります。リクエストの <span class="ui">レポートをコピー</span> で、質問に必要な情報をコピーできます。</p>
<h2 id="auth"><a class="anchor" href="#auth">401 と 403:キーやサインインが拒否された</a></h2>
<p><b>ベンダーから。</b>プロバイダが magpie の送ったキーやサインインを拒否しました。magpie はそのキーやアカウントを休ませて次を試すので、エラーが見えるのは残りがないときだけです。サインインの期限切れはそう書かれます(例:“the ChatGPT sign-in has expired — sign in again”)。</p>
<ul><li><b>直し方:</b><span class="ui">+ プロバイダを追加</span>(または <code>magpie accounts add &lt;provider&gt;</code>)からサインインし直すか、プロバイダに新しいキーを設定します。</li></ul>
<p><b>magpie 自身から。</b>次の場合、magpie は何も送らずに 403 を返します。</p>
<div class="table-wrap"><table>
<tr><th>エラー</th><th>原因</th><th>直し方</th></tr>
<tr><td>model disabled</td><td>magpie でそのモデルをオフにしています。</td><td>プロバイダでオンに戻します。</td></tr>
<tr><td>model not allowed for the gateway key</td><td>ゲートウェイキーが一部のモデルに限られています。</td><td><code>magpie gateway-key models &lt;id&gt;</code> で確認・変更します。</td></tr>
<tr><td>magpie doesn’t answer the web page …</td><td>Web ページがブラウザからゲートウェイを呼びました。</td><td><span class="ui">設定</span> › <span class="ui">ネットワークと共有</span> › <span class="ui">Web ページ</span> に追加し、ゲートウェイキーを送ります。</td></tr>
</table></div>
<h2 id="limits"><a class="anchor" href="#limits">429 と休止</a></h2>
<p>429 はクォータ切れ、残高不足、レート制限のいずれかです。magpie は拒否されたキーやアカウントを休ませ、リクエストを次のアカウント、ルーティンググループの次のメンバー、またはプロバイダの <span class="ui">フォールバック</span> に送ります。プロバイダの行には <span class="ui">休止中 · {why} · {time} に復帰</span> と表示されます。</p>
<div class="table-wrap"><table>
<tr><th>拒否の理由</th><th>休止の長さ</th></tr>
<tr><td>クォータ切れ(リセット時刻あり)</td><td>リセットまで</td></tr>
<tr><td>レート制限(Retry-After あり)</td><td>その時刻まで</td></tr>
<tr><td>残高不足</td><td>30 分。再び拒否されると 2 時間、8 時間、1 日、3 日、1 週間</td></tr>
<tr><td>ChatGPT アカウントのクレジット切れ</td><td>拒否が示すリセットまで。なければ枠全体の更新まで。それも分からなければ 5 時間</td></tr>
<tr><td>その他の失敗</td><td>1 分。繰り返すと倍になり最大 10 分(レート制限は 30 分)</td></tr>
</table></div>
<ul>
<li><b>今すぐもう一度。</b><span class="ui">今すぐ試す</span> は休止を終えます。次のリクエストで再び使われ、再度拒否されれば通常どおり休止します。</li>
<li><b>休止の上限。</b><code>magpie provider rest-cap &lt;id&gt; 4h</code> でプロバイダの最長休止を設定します。<code>off</code> にすると、理由の分からない失敗では休止しません。</li>
<li><b>上限がすぐ戻る中継サービス。</b>プロバイダ編集の <span class="ui">詳細設定</span> で <span class="ui">クォータ切れやレート制限で一時的に外す</span> のチェックを外すと、429 で休止せず、次のリクエストもいつもどおり送られます。</li>
<li><b>1 つに頼らない。</b>アカウントやフォールバックのモデルをもう 1 つ追加すれば、1 つが切れてもエージェントは止まりません。<code>magpie accounts</code> で各アカウントの使用量が分かります。</li>
</ul>
<p>休止は再起動後も保たれるので、magpie を終了しても休止中のアカウントは早く戻りません。</p>
<h2 id="bad-gateway"><a class="anchor" href="#bad-gateway">502:プロバイダが応答しない</a></h2>
<p>502 は、magpie がプロバイダから API の返答を得られなかったことを示します。プロバイダ名に続く文で、どの場合かが分かります。</p>
<ul>
<li><b>“didn’t answer: …”</b>接続に失敗しました:名前が解決できない、接続が拒否された、プロキシが止まっている、など。コンピュータがまったくネットワークにつながっていないときは、magpie がそれに気づき、どのプロバイダも休ませません。</li>
<li><b>“… not an API reply”</b>プロバイダは応答しましたが、Web ページ(サインインページ、Cloudflare のチャレンジ)、空の本文、JSON でない内容でした。たいていはベース URL が API ではなく Web サイトを指しています。ベンダーのドキュメントと照らし合わせ、<code>/v1</code> で終わるべきかも確認してください。</li>
<li><b>OpenCode:“… which is no error, not an API reply”。</b>OpenCode のゲートウェイは、モデル名だけを含む 400 を返すことがあります。同じリクエストは数秒後に通るので、magpie はこれを 502 とみなし、リクエストの待ち時間内に再試行するか、グループの次のメンバーを試します。誰も休ませません。非常に大きなツール一覧を含むリクエストで起きます。</li>
</ul>
<p>502、503、504、529、Cloudflare の 520〜524 は「混雑」として扱われ、エージェントに返す前に再試行するか、ルーティンググループの次のメンバーに移ります。</p>
<h2 id="timeout"><a class="anchor" href="#timeout">504:時間内に応答がない</a></h2>
<ul>
<li><b>“&lt;provider&gt;: no first token in Ns”。</b>ルーティンググループは各メンバーに応答開始までの時間(<span class="ui">最初のトークン</span>)を与えます。それを過ぎたので次のメンバーに移りました。遅いモデルにはグループで長くします。</li>
<li><b>“no member of the group answered within its Ns budget”。</b>グループの時間内に全メンバーを試し、どれも応答しませんでした。</li>
<li><b>“magpie held this request for … without routing it to any provider”。</b>リクエストが magpie の中で待ちすぎたため、待たせ続けずに止めました。送り直してください。繰り返すときは、<span class="ui">ルーティング</span> ページでそのリクエストの <span class="ui">レポートをコピー</span> して共有してください。</li>
</ul>
<h2 id="unknown-model"><a class="anchor" href="#unknown-model">モデルが見つからない(404)</a></h2>
<p>エラーは <em>magpie knows no model “…”</em> で、<em>did you mean …?</em> とプロバイダ id の一覧が付くことがあります。</p>
<ul>
<li><b>magpie の名前で指定する。</b><code>magpie models</code> が表示する <code>provider/model</code>、ルーティンググループの id か名前、またはプレフィックスなしのモデル id を使います。</li>
<li><b>“… is switched off in Magpie, so … is not served”。</b>プロバイダかルーティンググループがオフです。プロバイダページかルーティングページでオンに戻します。</li>
<li><b>プロバイダがまだない。</b>エラーに “add a provider in magpie first” と出ます。</li>
</ul>
<h2 id="not-listed"><a class="anchor" href="#not-listed">エージェントにモデルが出ない</a></h2>
<ul>
<li><b>エージェントを再起動する。</b>多くのエージェントは起動時にだけ設定を読みます。変更後、magpie はエージェントの行でそう知らせます(例:Codex は起動時にモデル一覧を作る)。Codex アプリは app-server も動かし続けるので、案内どおりに再起動してください。</li>
<li><b>magpie が提供しているか確認する。</b><code>magpie models</code> に選べるモデルがすべて並びます。オフにしたモデルや、プロバイダがオフのモデルは出ません。</li>
<li><b>Claude Code。</b><code>/model</code> に “via magpie” 付きでモデルが並びます。シェルで <code>CLAUDE_CODE_USE_BEDROCK</code> や <code>CLAUDE_CODE_USE_VERTEX</code> が設定されていると、Claude Code は magpie ではなくそのクラウドに接続します。シェルのプロファイルから外してください。</li>
</ul>
<h2 id="port"><a class="anchor" href="#port">ポート 3425 が使用中</a></h2>
<p>ゲートウェイは <code>127.0.0.1:3425</code> で待ち受けます。変えるには <span class="ui">設定</span> › <span class="ui">ネットワークと共有</span> › <span class="ui">ゲートウェイのアドレス</span> を開きます。設定できるのはポート(1024〜65535)だけで、magpie が接続したエージェントも一緒に移ります。</p>
<div class="table-wrap"><table>
<tr><th>magpie の表示</th><th>直し方</th></tr>
<tr><td>ポート … は他のプログラムが使用中です。別のポートを選んでください</td><td>空いているポートを選びます。</td></tr>
<tr><td>別の magpie が … でゲートウェイを提供しています。そちらでポートを設定するか、先に終了してください</td><td>magpie が 2 つ動いています。1 つを終了します。</td></tr>
<tr><td>ポート … は別のプログラム(magpie web かもしれません)が使用中です:magpie が数秒ごとに再試行します</td><td>ポートを使っているものを探すか、ゲートウェイを別のポートに移します。</td></tr>
<tr><td>MAGPIE_ADDR=… がゲートウェイのアドレス全体を設定しています</td><td><code>MAGPIE_ADDR</code> を外すか変更します。</td></tr>
</table></div>
<h2 id="wsl"><a class="anchor" href="#wsl">WSL のエージェント</a></h2>
<p>Windows では、magpie は実行中の WSL ディストリビューションから Claude Code、Codex、OpenCode、Kimi Code、Qwen Code などのエージェントを探します。見つかったものはそれぞれエージェントページに自分の行を持ち、Windows と同じように設定されます。停止中のディストリビューションを起動することはありません。</p>
<ul>
<li><b>エージェントが出ない。</b>ディストリビューションを起動し、<span class="ui">設定</span> › <span class="ui">一般</span> › <span class="ui">WSL のエージェントを検出</span> がオンか確認します。</li>
<li><b>magpie に届かない。</b>WSL 既定の NAT ネットワークでは、magpie は WSL ネットワーク上の Windows のアドレスでも専用のキーでゲートウェイを提供し、そのアドレスをエージェントの設定に書き込みます。ミラーモードでは、エージェントは Windows と同じく <code>127.0.0.1</code> を使います。通すかどうかは Windows ファイアウォールが決め、WSL のネットワークは「パブリック」扱いです。接続が遮断されるときはそこで magpie を許可してください。</li>
<li><b>変更が反映されない。</b>WSL のエージェントは起動時に設定を読みます。WSL 側で再起動してください。</li>
</ul>
<h2 id="lan"><a class="anchor" href="#lan">ネットワーク上の別のコンピュータから</a></h2>
<p>既定では、ゲートウェイはこのコンピュータにだけ応答します。別のコンピュータから使うには <span class="ui">設定</span> › <span class="ui">ネットワークと共有</span> › <span class="ui">ローカルネットワークで共有</span> をオンにします。相手のコンピュータは <span class="ui">ゲートウェイ</span> ページの <span class="ui">ゲートウェイキー</span> のキーを送ります。</p>
<ul>
<li><b>“magpie isn’t shared on the local network”。</b>magpie を動かしているコンピュータで共有をオンにします。</li>
<li><b>401。</b>キーがない、オフ、または期限切れです。有効なゲートウェイキーを <code>Authorization: Bearer &lt;key&gt;</code> か <code>x-api-key</code> で送ります。</li>
<li><b>特定のモデルで 403。</b>キーが一部のモデルに限られています:<code>magpie gateway-key models &lt;id&gt;</code>。</li>
</ul>
<p>ポートをインターネットに公開しないでください。コンピュータ間は VPN を使います。別の magpie への接続を含む設定の全体は <a href="/docs/ja/remote">リモート magpie</a> にあります。</p>
<h2 id="plugins"><a class="anchor" href="#plugins">プラグインに移ったサブスクが使えない</a></h2>
<p>Command Code、Cursor、Devin、Factory、Grok、Kiro、Xiaomi MiMo、Qoder、WorkBuddy、ZCode、Zed は magpie に組み込まれなくなり、それぞれ同じ働きをするコミュニティプラグインが提供します。以前に追加したアカウントはプラグインへの移行が必要で、移行するまで使えません。</p>
<ul><li><b>直し方:</b>プロバイダ一覧の上に「… の組み込みサブスクリプションは終了しました。アカウントはまだプラグインに移行されていません」と出ます。<span class="ui">プラグインに移行</span> を押すと、magpie がプラグインをインストールし、各アカウントを確認します。移行してもアカウント、モデル、エージェントはそのままです。magpie は自動でも移行し、<span class="ui">プラグイン</span> ページからプラグインをインストールしても移行されます。</li></ul>
<p>移行後のエラーはプラグインから来ています。サインイン、モデル、リクエストはプラグインが処理します。</p>
<h2 id="faq"><a class="anchor" href="#faq">よくある質問</a></h2>
<h3>プロバイダは動いているのに、なぜ 502 になるのですか?</h3>
<p>プロバイダが Web ページや空の本文など、API の返答でないものを返しました。たいていはベース URL が API ではなくベンダーの Web サイトを指しています。</p>
<h3>429 のあと、なぜアカウントが使われないままなのですか?</h3>
<p>magpie はベンダーが示したリセットまで、示されなければしばらくの間そのアカウントを休ませます。プロバイダの行に復帰時刻が出ており、「今すぐ試す」で休止を終えられます。</p>
<h3>“magpie knows no model” とはどういう意味ですか?</h3>
<p>その名前のモデルを提供するプロバイダがありません。magpie models が表示する provider/model で指定するか、プロバイダをオンに戻します。</p>
<h3>magpie のポートを変えるには?</h3>
<p>設定 › ネットワークと共有 › ゲートウェイのアドレス です。magpie が接続したエージェントも一緒に移ります。</p>
<h3>WSL のエージェントから Windows の magpie を使えますか?</h3>
<p>使えます。magpie は実行中の WSL ディストリビューションのエージェントを見つけ、届くアドレスで設定します。NAT ネットワークでは、Windows ファイアウォールが WSL からの接続を通す必要があります。</p>
<h3>別のコンピュータから magpie を使えますか?</h3>
<p>使えます。設定 › ネットワークと共有 › ローカルネットワークで共有 をオンにし、相手のコンピュータからゲートウェイキーを送ります。ポートはインターネットに公開しないでください。</p>
<p style="margin-top:48px">解決しないときは、ルーティングページでそのリクエストのレポートをコピーして <a href="https://discord.gg/vGSnD3ZKQF">Discord</a> で質問してください。</p>
</article>
</main>
<footer><div class="wrap">
<span>© 2026 magpie · MIT</span>
<div class="links">
<a href="/ja/">ホーム</a>
<a href="/docs/ja/intent">インテントルーティング</a>
<a href="/docs/ja/plugins">プラグイン</a>
<a href="/docs/ja/remote">リモート magpie</a>
<a href="/docs/ja/docker">Docker</a>
<a href="/docs/ja/privacy">プライバシー</a>
<a href="/docs/ja/masking">プライバシーマスキング</a>
<a href="/docs/ja/mcp-router">MCP ルーター</a>
<a href="/docs/ja/library">ライブラリ</a>
<a href="/docs/ja/claude-code-models">Claude Code で他のモデル</a>
<a href="/docs/ja/codex-models">Codex で他のモデル</a>
<a href="/docs/ja/gemini-cli-models">Gemini CLI で他のモデル</a>
<a href="/docs/ja/subscriptions">サブスクを任意のエージェントで</a>
<a href="/docs/ja/local-models">ローカルモデル</a>
<a href="/docs/ja/opencode-models">OpenCode で他のモデル</a>
<a href="/docs/ja/alternatives">CC Switch・CCR との比較</a>
<a href="/docs/ja/import">magpie に追加</a>
<a href="/docs/integrate">アプリ連携</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
<a href="https://discord.gg/vGSnD3ZKQF">Discord</a>
<a href="/docs/ja/contributors">コントリビューター</a>
<a href="https://github.com/yetone/magpie-releases/releases">リリース</a>
</div>
</div></footer>
<script>
(() => {
const next = { system: "light", light: "dark", dark: "system" };
document.querySelectorAll("button.theme").forEach((b) => {
b.dataset.mode = themeMode();
b.title = "Theme: " + themeMode();
b.addEventListener("click", () => setTheme(next[themeMode()]));
});
document.querySelectorAll(".copy").forEach((b) => b.addEventListener("click", async () => {
try {
await navigator.clipboard.writeText(document.getElementById(b.dataset.copy).textContent);
b.textContent = "コピーしました"; setTimeout(() => (b.textContent = "コピー"), 1400);
} catch {}
}));
})();
</script>
<script src="/docs.js"></script>
</body>
</html>
+1 -1
View File
@@ -362,7 +362,7 @@ IP-CIDR6,::1/128,DIRECT,no-resolve</pre>
</ol>
<p>The model id is magpie’s (<code>magpie models</code>). Sharing lets other computers on your network in with a gateway key; see <a href="/docs/remote#share">Remote magpie</a>.</p>
<p style="margin-top:48px">Stuck, or have a setup worth sharing? Ask on <a href="https://discord.gg/vGSnD3ZKQF">Discord</a>. Vendors who want to hand their users a ready-made provider: see <a href="/docs/import">Add to magpie</a>.</p>
<p style="margin-top:48px">An error from the gateway? See <a href="/docs/troubleshooting">Fixing common errors</a>. Stuck, or have a setup worth sharing? Ask on <a href="https://discord.gg/vGSnD3ZKQF">Discord</a>. Vendors who want to hand their users a ready-made provider: see <a href="/docs/import">Add to magpie</a>.</p>
</article>
</main>
+1 -1
View File
@@ -236,7 +236,7 @@
<h2 id="faq"><a class="anchor" href="#faq">FAQ</a></h2>
<h3>Can I use my ChatGPT Plus or Pro subscription in Claude Code?</h3>
<p>Yes. Sign in to ChatGPT in magpie and pick a <code>codex/…</code> model on Claude Code’s row, or run <code>magpie claude codex/gpt-5.5</code>. magpie translates Claude Code’s Anthropic requests for the GPT model and the replies back, tool calls included.</p>
<p>Yes. Sign in to ChatGPT in magpie and pick a <code>codex/…</code> model on Claude Code’s row, or run <code>magpie claude codex/gpt-5.5</code>. magpie translates Claude Code’s Anthropic requests for the GPT model and the replies back, tool calls included. The whole setup, tiers and effort included, is in <a href="/docs/claude-code-chatgpt">ChatGPT in Claude Code</a>.</p>
<h3>Can I use my Claude Pro or Max subscription in Codex or OpenCode?</h3>
<p>Yes. Sign in to Claude in magpie and pick a <code>claude/…</code> model on the agent’s row. Requests on a Claude subscription run through the Claude Code installed on your computer, so keep it installed.</p>
<h3>Can I use GitHub Copilot models outside VS Code?</h3>
+342
View File
@@ -0,0 +1,342 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Fixing common errors: 401, 429, 502, 504 and more · magpie</title>
<meta name="description" content="What magpie’s gateway errors mean and how to fix them: 401 and 403, 429 and rest periods, 502 and 504, model not found, an agent that doesn’t show a model, port 3425 in use, agents in WSL, and use from another computer.">
<meta name="color-scheme" content="light dark">
<meta name="theme-color" content="#fafafa">
<script>
(() => {
let mode = "system";
try { mode = localStorage.getItem("theme") || "system"; } catch {}
const q = matchMedia("(prefers-color-scheme: dark)");
const apply = () => {
const t = mode === "system" ? (q.matches ? "dark" : "light") : mode;
document.documentElement.dataset.theme = t;
document.querySelector('meta[name="theme-color"]').content = t === "dark" ? "#0b0b0c" : "#fafafa";
document.querySelectorAll("button.theme").forEach((b) => { b.dataset.mode = mode; b.title = "Theme: " + mode; });
};
q.addEventListener("change", () => mode === "system" && apply());
window.setTheme = (m) => { mode = m; try { m === "system" ? localStorage.removeItem("theme") : localStorage.setItem("theme", m); } catch {} apply(); };
window.themeMode = () => mode;
apply();
})();
</script>
<script>try{if(/Linux/.test(navigator.userAgent)&&!/Android/.test(navigator.userAgent)||localStorage.getItem("omarchy")||/[?&]omarchy=/.test(location.search))document.write('<script src="/omarchy.js"><\/script>')}catch(e){}</script>
<link rel="icon" href="/favicon.png" type="image/png">
<link rel="apple-touch-icon" href="/img/icon-256.png">
<link rel="alternate" hreflang="en" href="https://usemagpie.ai/docs/troubleshooting">
<link rel="alternate" hreflang="zh" href="https://usemagpie.ai/docs/zh/troubleshooting">
<link rel="alternate" hreflang="ja" href="https://usemagpie.ai/docs/ja/troubleshooting">
<link rel="alternate" hreflang="x-default" href="https://usemagpie.ai/docs/troubleshooting">
<link rel="canonical" href="https://usemagpie.ai/docs/troubleshooting">
<link rel="stylesheet" href="/docs.css">
<meta property="og:site_name" content="magpie">
<meta property="og:title" content="Fixing common errors: 401, 429, 502, 504 and more">
<meta property="og:description" content="What magpie’s gateway errors mean and how to fix them: 401 and 403, 429 and rest periods, 502 and 504, model not found, an agent that doesn’t show a model, port 3425 in use, agents in WSL, and use from another computer.">
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
<meta property="og:url" content="https://usemagpie.ai/docs/troubleshooting">
<meta name="twitter:card" content="summary_large_image">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "TechArticle",
"headline": "Fixing common errors: 401, 429, 502, 504 and more",
"description": "What magpie’s gateway errors mean and how to fix them: 401 and 403, 429 and rest periods, 502 and 504, model not found, an agent that doesn’t show a model, port 3425 in use, agents in WSL, and use from another computer.",
"inLanguage": "en",
"url": "https://usemagpie.ai/docs/troubleshooting",
"about": {
"@type": "SoftwareApplication",
"name": "magpie",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "macOS, Windows, Linux"
},
"publisher": {
"@type": "Organization",
"name": "magpie",
"url": "https://usemagpie.ai/"
}
},
{
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "Why does magpie answer 502 when the provider is up?",
"acceptedAnswer": {
"@type": "Answer",
"text": "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."
}
},
{
"@type": "Question",
"name": "Why does an account stay unused after a 429?",
"acceptedAnswer": {
"@type": "Answer",
"text": "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."
}
},
{
"@type": "Question",
"name": "What does “magpie knows no model” mean?",
"acceptedAnswer": {
"@type": "Answer",
"text": "No provider serves a model by that name. Name it as provider/model, as magpie models lists it, or switch its provider on again."
}
},
{
"@type": "Question",
"name": "How do I change magpie’s port?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Settings › Network and sharing › Gateway address. The agents magpie connected move with it."
}
},
{
"@type": "Question",
"name": "Can an agent in WSL use magpie on Windows?",
"acceptedAnswer": {
"@type": "Answer",
"text": "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."
}
},
{
"@type": "Question",
"name": "Can I use magpie from another computer?",
"acceptedAnswer": {
"@type": "Answer",
"text": "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."
}
}
]
}
]
}
</script>
</head>
<body>
<nav><div class="wrap">
<a class="brand" href="/"><img class="bird" src="/img/magpie-small.svg" alt="">magpie <small>Docs</small></a>
<div class="links">
<a href="/">Home</a>
<a href="/docs/start">Get started</a>
<a href="/docs/intent">Intent routing</a>
<a href="/docs/plugins">Plugins</a>
<a class="toc-only" href="/docs/remote">Remote magpie</a>
<a class="toc-only" href="/docs/docker">Docker</a>
<a class="toc-only" href="/docs/privacy">Privacy</a>
<a class="toc-only" href="/docs/masking">Privacy masking</a>
<a class="toc-only" href="/docs/mcp-router">MCP router</a>
<a class="toc-only" href="/docs/library">Library</a>
<a class="toc-only" href="/docs/claude-code-models">Models in Claude Code</a>
<a class="toc-only" href="/docs/codex-models">Models in Codex</a>
<a class="toc-only" href="/docs/gemini-cli-models">Models in Gemini CLI</a>
<a class="toc-only" href="/docs/subscriptions">Subscriptions in any agent</a>
<a class="toc-only" href="/docs/local-models">Local models</a>
<a class="toc-only" href="/docs/opencode-models">Models in OpenCode</a>
<a class="toc-only" href="/docs/alternatives">magpie vs CC Switch vs CCR</a>
<a href="/docs/import">Add to magpie</a>
<a href="/docs/integrate">Integrate</a>
<a href="https://github.com/yetone/magpie-releases/releases">Releases</a>
</div>
<div class="langs">
<button class="icon-btn lang" type="button" aria-label="Language" title="Language" aria-haspopup="true" aria-expanded="false" aria-controls="langs"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><circle cx="8" cy="8" r="6.25"/><path d="M1.75 8h12.5M8 1.75c1.7 1.75 2.55 3.83 2.55 6.25S9.7 12.5 8 14.25M8 1.75C6.3 3.5 5.45 5.58 5.45 8S6.3 12.5 8 14.25"/></svg></button>
<div class="lang-menu" id="langs" hidden>
<a href="/docs/troubleshooting" hreflang="en" lang="en">English</a>
<a href="/docs/zh/troubleshooting" hreflang="zh" lang="zh">中文</a>
<a href="/docs/ja/troubleshooting" hreflang="ja" lang="ja">日本語</a>
</div>
</div>
<a class="icon-btn" href="https://discord.gg/vGSnD3ZKQF" aria-label="magpie on Discord" title="Join us on Discord"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/></svg></a>
<a class="icon-btn" href="https://github.com/yetone/magpie" aria-label="magpie on GitHub" title="Source on GitHub"><svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg></a>
<button class="icon-btn theme" type="button" aria-label="Theme" title="Theme: system"><svg class="i-system" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1.75" y="2.75" width="12.5" height="8.5" rx="1.5"/><path d="M5.5 14h5M8 11.25V14"/></svg><svg class="i-light" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><circle cx="8" cy="8" r="3"/><path d="M8 1v1.5M8 13.5V15M1 8h1.5M13.5 8H15M3 3l1 1M12 12l1 1M3 13l1-1M12 4l1-1"/></svg><svg class="i-dark" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"><path d="M13.5 9.5A5.5 5.5 0 0 1 6.5 2.5a5.5 5.5 0 1 0 7 7Z"/></svg></button>
<a class="btn small" href="/#get">Download</a>
</div></nav>
<main class="wrap doc">
<aside class="toc">
<p>Fixing common errors</p>
<a href="#overview">Where to look</a>
<a href="#auth">401 and 403</a>
<a href="#limits">429 and rests</a>
<a href="#bad-gateway">502</a>
<a href="#timeout">504</a>
<a href="#unknown-model">Model not found</a>
<a href="#not-listed">Agent doesn’t show it</a>
<a href="#port">Port 3425 in use</a>
<a href="#wsl">Agents in WSL</a>
<a href="#lan">From another computer</a>
<a href="#plugins">Moved to plugins</a>
<a href="#faq">FAQ</a>
</aside>
<article>
<p class="eyebrow" id="overview">Docs · Help</p>
<h1>Fixing common errors: 401, 429, 502, 504 and more</h1>
<p class="lede">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.</p>
<p>Every request is listed on magpie’s <span class="ui">Routing</span> page, with which provider and account it went to and how each try ended. <span class="ui">Copy Report</span> on a request copies what you need to ask for help.</p>
<h2 id="auth"><a class="anchor" href="#auth">401 and 403: a key or sign-in refused</a></h2>
<p><b>From the vendor.</b> 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”.</p>
<ul><li><b>Fix:</b> sign in again from <span class="ui">+ Add provider</span> (or <code>magpie accounts add &lt;provider&gt;</code>), or give the provider a new key.</li></ul>
<p><b>From magpie itself.</b> magpie answers 403 on its own in a few cases, before anything is sent:</p>
<div class="table-wrap"><table>
<tr><th>Error</th><th>Cause</th><th>Fix</th></tr>
<tr><td>model disabled</td><td>You turned the model off in magpie.</td><td>Turn it on again on its provider.</td></tr>
<tr><td>model not allowed for the gateway key</td><td>The gateway key is held to some models.</td><td><code>magpie gateway-key models &lt;id&gt;</code> lists or changes them.</td></tr>
<tr><td>magpie doesn’t answer the web page …</td><td>A web page called the gateway from a browser.</td><td>List it in <span class="ui">Settings</span> › <span class="ui">Network and sharing</span> › <span class="ui">Web pages</span>, and send a gateway key.</td></tr>
</table></div>
<h2 id="limits"><a class="anchor" href="#limits">429 and rest periods</a></h2>
<p>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 <span class="ui">Fallback</span>. The provider’s row shows <span class="ui">Resting · {why} · back at {time}</span>.</p>
<div class="table-wrap"><table>
<tr><th>Refused for</th><th>Rests</th></tr>
<tr><td>Quota, with a reset time</td><td>Until the reset</td></tr>
<tr><td>Rate limit, with Retry-After</td><td>Until then</td></tr>
<tr><td>Credit</td><td>30 minutes, then 2 hours, 8 hours, a day, 3 days and a week if it is refused again</td></tr>
<tr><td>A ChatGPT account out of credits</td><td>Until the reset its refusal names, else until its full window renews, else 5 hours</td></tr>
<tr><td>Any other failure</td><td>A minute, doubling on repeats up to 10 minutes (30 for a rate limit)</td></tr>
</table></div>
<ul>
<li><b>Ask it again now.</b> <span class="ui">Try now</span> ends the rest: the next request asks it again. Refused again, it rests again.</li>
<li><b>Cap the rest.</b> <code>magpie provider rest-cap &lt;id&gt; 4h</code> sets the longest rest for a provider; <code>off</code> stops it resting for failures that say nothing of why.</li>
<li><b>A relay whose limits pass in a moment.</b> Untick <span class="ui">Set it aside when out of quota or rate limited</span> in the provider editor’s <span class="ui">Advanced</span>: a 429 then rests nothing, and the next request goes to it as usual.</li>
<li><b>Never all at once.</b> Add a second account or a fallback model, so a spent one never stops the agent. <code>magpie accounts</code> shows how much of each account’s allowance is used.</li>
</ul>
<p>Rests are kept across restarts, so quitting magpie doesn’t bring a resting account back early.</p>
<h2 id="bad-gateway"><a class="anchor" href="#bad-gateway">502: the provider didn’t answer</a></h2>
<p>A 502 means magpie couldn’t get an API reply from the provider. What follows the provider’s name says which case it is:</p>
<ul>
<li><b>“didn’t answer: …”</b> The connection failed: a name that doesn’t resolve, a refused connection, a proxy that is down. When this computer has no network at all, magpie notices and rests nobody.</li>
<li><b>“… not an API reply”</b> The provider answered, but with a web page (a sign-in page, a Cloudflare challenge), nothing at all, or something that isn’t JSON. The base URL usually points at a web site instead of the API: check it against the vendor’s docs, and whether it should end in <code>/v1</code>.</li>
<li><b>OpenCode: “… which is no error, not an API reply”.</b> OpenCode’s gateway sometimes answers a 400 holding only the model’s name. The same request is answered some seconds later, so magpie reads it as a 502, asks again within the request’s patience or tries a group’s next member, and rests nobody. It is tied to requests carrying very large tool lists.</li>
</ul>
<p>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.</p>
<h2 id="timeout"><a class="anchor" href="#timeout">504: no answer in time</a></h2>
<ul>
<li><b>“&lt;provider&gt;: no first token in Ns”.</b> A routing group gives each member a time to start answering (<span class="ui">First token</span>). The member was slower, so the next was asked. Raise it on the group for a slow model.</li>
<li><b>“no member of the group answered within its Ns budget”.</b> Every member of the group was tried within the group’s time and none answered.</li>
<li><b>“magpie held this request for … without routing it to any provider”.</b> The request waited inside magpie and was stopped rather than left waiting. Send it again; if it comes back, <span class="ui">Copy Report</span> on that request on the <span class="ui">Routing</span> page and share it.</li>
</ul>
<h2 id="unknown-model"><a class="anchor" href="#unknown-model">Model not found (404)</a></h2>
<p>The error reads <em>magpie knows no model “…”</em>, often with <em>did you mean …?</em> and the list of your provider ids.</p>
<ul>
<li><b>Name it as magpie does.</b> Use <code>provider/model</code>, as <code>magpie models</code> lists it, a routing group’s id or name, or a bare model id.</li>
<li><b>“… is switched off in Magpie, so … is not served”.</b> The provider or routing group is off. Switch it on again on the Providers or Routing page.</li>
<li><b>No providers yet.</b> The error says “add a provider in magpie first”.</li>
</ul>
<h2 id="not-listed"><a class="anchor" href="#not-listed">The agent doesn’t show the model</a></h2>
<ul>
<li><b>Restart the agent.</b> Most agents read their config only when they start. magpie says so on the agent’s row after a change, for example “Codex builds its model list at start-up”. Codex’s app also keeps an app-server running; restart it as the notice says.</li>
<li><b>Check magpie serves it.</b> <code>magpie models</code> lists every model you can pick. A model you turned off, or one whose provider is switched off, isn’t listed.</li>
<li><b>Claude Code.</b> <code>/model</code> lists magpie’s models marked “via magpie”. If <code>CLAUDE_CODE_USE_BEDROCK</code> or <code>CLAUDE_CODE_USE_VERTEX</code> is set in your shell, Claude Code goes to that cloud instead of magpie; remove it from your shell profile.</li>
</ul>
<h2 id="port"><a class="anchor" href="#port">Port 3425 is in use</a></h2>
<p>The gateway listens on <code>127.0.0.1:3425</code>. To move it, open <span class="ui">Settings</span> › <span class="ui">Network and sharing</span> › <span class="ui">Gateway address</span>. Only the port is set there, 1024 to 65535, and the agents magpie connected move with it.</p>
<div class="table-wrap"><table>
<tr><th>magpie says</th><th>Fix</th></tr>
<tr><td>Port … is in use by another program: pick another one</td><td>Pick a free port.</td></tr>
<tr><td>Another magpie serves the gateway at …: set its port there, or quit it first</td><td>Two copies of magpie are running. Quit one.</td></tr>
<tr><td>Port … is taken by another program, magpie web perhaps: magpie tries again every few seconds</td><td>Find what holds the port, or move the gateway to another.</td></tr>
<tr><td>MAGPIE_ADDR=… sets the gateway’s whole address, host:port: unset it to set the port here</td><td>Unset <code>MAGPIE_ADDR</code>, or change it.</td></tr>
</table></div>
<h2 id="wsl"><a class="anchor" href="#wsl">Agents in WSL</a></h2>
<p>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.</p>
<ul>
<li><b>The agent isn’t listed.</b> Start the distro, and check <span class="ui">Settings</span> › <span class="ui">General</span> › <span class="ui">Detect agents in WSL</span> is on.</li>
<li><b>It can’t reach magpie.</b> Under WSL’s default NAT networking, magpie also serves the gateway at Windows’ address on the WSL network, with a key of its own, and writes that address into the agent’s config. With mirrored networking the agent uses <code>127.0.0.1</code> as on Windows. Windows’ firewall still decides: WSL’s network counts as Public, so allow magpie there if the connection is blocked.</li>
<li><b>A change doesn’t show.</b> An agent in WSL reads its config at start-up: restart it there.</li>
</ul>
<h2 id="lan"><a class="anchor" href="#lan">From another computer on the network</a></h2>
<p>By default the gateway answers only this computer. To use it from another: <span class="ui">Settings</span> › <span class="ui">Network and sharing</span> › <span class="ui">Share on local network</span>. The other computer sends a gateway key from the <span class="ui">Gateway</span> page’s <span class="ui">Gateway keys</span>.</p>
<ul>
<li><b>“magpie isn’t shared on the local network”.</b> Turn sharing on, on the computer that runs magpie.</li>
<li><b>401.</b> The key is missing, off or expired. Send an enabled gateway key as <code>Authorization: Bearer &lt;key&gt;</code> or <code>x-api-key</code>.</li>
<li><b>403 for a model.</b> The key is held to some models: <code>magpie gateway-key models &lt;id&gt;</code>.</li>
</ul>
<p>Don’t open the port to the internet; use a VPN between your computers. The full setup, another magpie included, is in <a href="/docs/remote">Remote magpie</a>.</p>
<h2 id="plugins"><a class="anchor" href="#plugins">A subscription moved to a plugin isn’t served</a></h2>
<p>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.</p>
<ul><li><b>Fix:</b> a line over the Providers list says “… built-in subscription is retired, and its accounts haven’t moved to its plugin yet”. Press <span class="ui">Move to the plugin</span>: magpie installs the plugin and checks each account. Moving keeps your accounts, models and agents as they are. magpie also moves them by itself, and installing the plugin from the <span class="ui">Plugins</span> page does too.</li></ul>
<p>An error after the move comes from the plugin, which does the sign-in, models and requests.</p>
<h2 id="faq"><a class="anchor" href="#faq">FAQ</a></h2>
<h3>Why does magpie answer 502 when the provider is up?</h3>
<p>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.</p>
<h3>Why does an account stay unused after a 429?</h3>
<p>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.</p>
<h3>What does “magpie knows no model” mean?</h3>
<p>No provider serves a model by that name. Name it as provider/model, as magpie models lists it, or switch its provider on again.</p>
<h3>How do I change magpie’s port?</h3>
<p>Settings › Network and sharing › Gateway address. The agents magpie connected move with it.</p>
<h3>Can an agent in WSL use magpie on Windows?</h3>
<p>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.</p>
<h3>Can I use magpie from another computer?</h3>
<p>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.</p>
<p style="margin-top:48px">Still stuck? Copy the request’s report from the Routing page and ask on <a href="https://discord.gg/vGSnD3ZKQF">Discord</a>.</p>
</article>
</main>
<footer><div class="wrap">
<span>© 2026 magpie · MIT</span>
<div class="links">
<a href="/">Home</a>
<a href="/docs/intent">Intent routing</a>
<a href="/docs/plugins">Plugins</a>
<a href="/docs/remote">Remote magpie</a>
<a href="/docs/docker">Docker</a>
<a href="/docs/privacy">Privacy</a>
<a href="/docs/masking">Privacy masking</a>
<a href="/docs/mcp-router">MCP router</a>
<a href="/docs/library">Library</a>
<a href="/docs/claude-code-models">Models in Claude Code</a>
<a href="/docs/codex-models">Models in Codex</a>
<a href="/docs/gemini-cli-models">Models in Gemini CLI</a>
<a href="/docs/subscriptions">Subscriptions in any agent</a>
<a href="/docs/local-models">Local models</a>
<a href="/docs/opencode-models">Models in OpenCode</a>
<a href="/docs/alternatives">magpie vs CC Switch vs CCR</a>
<a href="/docs/import">Add to magpie</a>
<a href="/docs/integrate">Integrate</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
<a href="https://discord.gg/vGSnD3ZKQF">Discord</a>
<a href="/docs/contributors">Contributors</a>
<a href="https://github.com/yetone/magpie-releases/releases">Releases</a>
</div>
</div></footer>
<script>
(() => {
const next = { system: "light", light: "dark", dark: "system" };
document.querySelectorAll("button.theme").forEach((b) => {
b.dataset.mode = themeMode();
b.title = "Theme: " + themeMode();
b.addEventListener("click", () => setTheme(next[themeMode()]));
});
document.querySelectorAll(".copy").forEach((b) => b.addEventListener("click", async () => {
try {
await navigator.clipboard.writeText(document.getElementById(b.dataset.copy).textContent);
b.textContent = "Copied"; setTimeout(() => (b.textContent = "Copy"), 1400);
} catch {}
}));
})();
</script>
<script src="/docs.js"></script>
</body>
</html>
@@ -0,0 +1,308 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>在 Claude Code 中使用 ChatGPT Plus/Pro 订阅 · magpie</title>
<meta name="description" content="在 magpie 里登录一次 ChatGPT,就能让 Claude Code 用你 ChatGPT 套餐里的 GPT 模型:Opus、Sonnet、Haiku 分档怎么对应、推理强度、用量限制、多账号,以及怎么切回去。不需要 OpenAI API Key。">
<meta name="color-scheme" content="light dark">
<meta name="theme-color" content="#fafafa">
<script>
(() => {
let mode = "system";
try { mode = localStorage.getItem("theme") || "system"; } catch {}
const q = matchMedia("(prefers-color-scheme: dark)");
const apply = () => {
const t = mode === "system" ? (q.matches ? "dark" : "light") : mode;
document.documentElement.dataset.theme = t;
document.querySelector('meta[name="theme-color"]').content = t === "dark" ? "#0b0b0c" : "#fafafa";
document.querySelectorAll("button.theme").forEach((b) => { b.dataset.mode = mode; b.title = "Theme: " + mode; });
};
q.addEventListener("change", () => mode === "system" && apply());
window.setTheme = (m) => { mode = m; try { m === "system" ? localStorage.removeItem("theme") : localStorage.setItem("theme", m); } catch {} apply(); };
window.themeMode = () => mode;
apply();
})();
</script>
<script>try{if(/Linux/.test(navigator.userAgent)&&!/Android/.test(navigator.userAgent)||localStorage.getItem("omarchy")||/[?&]omarchy=/.test(location.search))document.write('<script src="/omarchy.js"><\/script>')}catch(e){}</script>
<link rel="icon" href="/favicon.png" type="image/png">
<link rel="apple-touch-icon" href="/img/icon-256.png">
<link rel="alternate" hreflang="en" href="https://usemagpie.ai/docs/claude-code-chatgpt">
<link rel="alternate" hreflang="zh" href="https://usemagpie.ai/docs/zh/claude-code-chatgpt">
<link rel="alternate" hreflang="ja" href="https://usemagpie.ai/docs/ja/claude-code-chatgpt">
<link rel="alternate" hreflang="x-default" href="https://usemagpie.ai/docs/claude-code-chatgpt">
<link rel="canonical" href="https://usemagpie.ai/docs/zh/claude-code-chatgpt">
<link rel="stylesheet" href="/docs.css">
<meta property="og:site_name" content="magpie">
<meta property="og:title" content="在 Claude Code 中使用 ChatGPT Plus/Pro 订阅">
<meta property="og:description" content="在 magpie 里登录一次 ChatGPT,就能让 Claude Code 用你 ChatGPT 套餐里的 GPT 模型:Opus、Sonnet、Haiku 分档怎么对应、推理强度、用量限制、多账号,以及怎么切回去。不需要 OpenAI API Key。">
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
<meta property="og:url" content="https://usemagpie.ai/docs/zh/claude-code-chatgpt">
<meta name="twitter:card" content="summary_large_image">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "TechArticle",
"headline": "在 Claude Code 中使用 ChatGPT Plus/Pro 订阅",
"description": "在 magpie 里登录一次 ChatGPT,就能让 Claude Code 用你 ChatGPT 套餐里的 GPT 模型:Opus、Sonnet、Haiku 分档怎么对应、推理强度、用量限制、多账号,以及怎么切回去。不需要 OpenAI API Key。",
"inLanguage": "zh",
"url": "https://usemagpie.ai/docs/zh/claude-code-chatgpt",
"about": {
"@type": "SoftwareApplication",
"name": "magpie",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "macOS, Windows, Linux"
},
"publisher": {
"@type": "Organization",
"name": "magpie",
"url": "https://usemagpie.ai/"
}
},
{
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "能在 Claude Code 里用 ChatGPT Plus 或 Pro 订阅吗?",
"acceptedAnswer": {
"@type": "Answer",
"text": "可以。在 magpie 里登录 ChatGPT,在 Claude Code 那一行选一个 codex/… 模型,或运行 magpie claude codex/gpt-5.5。magpie 把 Claude Code 的请求翻译给 GPT 模型,再把回复翻译回来,工具调用也包括在内。"
}
},
{
"@type": "Question",
"name": "需要 OpenAI API Key 吗?",
"acceptedAnswer": {
"@type": "Answer",
"text": "不需要。magpie 在 OpenAI 自己的页面登录,Claude Code 拿到的是网关的密钥。你的登录只保存在 magpie 里。"
}
},
{
"@type": "Question",
"name": "会占用 ChatGPT 套餐的额度吗?",
"acceptedAnswer": {
"@type": "Answer",
"text": "会。请求用的是你的 ChatGPT 账号,计入它的用量限制。magpie 的状态栏会在 Claude Code 输入框下方显示每个账号的 5 小时和 7 天用量。"
}
},
{
"@type": "Question",
"name": "Claude Code 的 Haiku 请求用哪个模型?",
"acceptedAnswer": {
"@type": "Answer",
"text": "默认用你选的 GPT 模型,除非你用 magpie claude haiku <model> 给 haiku 档单独设一个。"
}
},
{
"@type": "Question",
"name": "怎么切回 Claude 自己的模型?",
"acceptedAnswer": {
"@type": "Answer",
"text": "运行 magpie claude default,或在 magpie 里 Claude Code 那一行选回 Claude Code 自己的模型。"
}
},
{
"@type": "Question",
"name": "请求会经过 magpie 的服务器吗?",
"acceptedAnswer": {
"@type": "Answer",
"text": "不会。网关运行在你自己的电脑上,请求从这里直接发给 OpenAI,中间没有 magpie 的服务器。"
}
}
]
}
]
}
</script>
</head>
<body>
<nav><div class="wrap">
<a class="brand" href="/zh/"><img class="bird" src="/img/magpie-small.svg" alt="">magpie <small>文档</small></a>
<div class="links">
<a href="/zh/">首页</a>
<a href="/docs/zh/start">快速上手</a>
<a href="/docs/zh/intent">意图路由</a>
<a href="/docs/zh/plugins">插件开发</a>
<a class="toc-only" href="/docs/zh/remote">远程 magpie</a>
<a class="toc-only" href="/docs/zh/docker">Docker</a>
<a class="toc-only" href="/docs/zh/privacy">隐私</a>
<a class="toc-only" href="/docs/zh/masking">本地脱敏</a>
<a class="toc-only" href="/docs/zh/mcp-router">MCP 路由</a>
<a class="toc-only" href="/docs/zh/library">资源库</a>
<a class="toc-only" href="/docs/zh/claude-code-models">Claude Code 接入其他模型</a>
<a class="toc-only" href="/docs/zh/codex-models">Codex 接入其他模型</a>
<a class="toc-only" href="/docs/zh/gemini-cli-models">Gemini CLI 接入其他模型</a>
<a class="toc-only" href="/docs/zh/subscriptions">订阅用于任意 Agent</a>
<a class="toc-only" href="/docs/zh/local-models">本地模型</a>
<a class="toc-only" href="/docs/zh/opencode-models">OpenCode 接入其他模型</a>
<a class="toc-only" href="/docs/zh/alternatives">与 CC Switch、CCR 对比</a>
<a href="/docs/zh/import">Add to magpie</a>
<a href="/docs/zh/integrate">接入应用</a>
<a href="https://github.com/yetone/magpie-releases/releases">版本发布</a>
</div>
<div class="langs">
<button class="icon-btn lang" type="button" aria-label="语言" title="语言" aria-haspopup="true" aria-expanded="false" aria-controls="langs"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><circle cx="8" cy="8" r="6.25"/><path d="M1.75 8h12.5M8 1.75c1.7 1.75 2.55 3.83 2.55 6.25S9.7 12.5 8 14.25M8 1.75C6.3 3.5 5.45 5.58 5.45 8S6.3 12.5 8 14.25"/></svg></button>
<div class="lang-menu" id="langs" hidden>
<a href="/docs/claude-code-chatgpt" hreflang="en" lang="en">English</a>
<a href="/docs/zh/claude-code-chatgpt" hreflang="zh" lang="zh">中文</a>
<a href="/docs/ja/claude-code-chatgpt" hreflang="ja" lang="ja">日本語</a>
</div>
</div>
<a class="icon-btn" href="https://discord.gg/vGSnD3ZKQF" aria-label="magpie on Discord" title="Join us on Discord"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/></svg></a>
<a class="icon-btn" href="https://github.com/yetone/magpie" aria-label="magpie on GitHub" title="Source on GitHub"><svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg></a>
<button class="icon-btn theme" type="button" aria-label="Theme" title="Theme: system"><svg class="i-system" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1.75" y="2.75" width="12.5" height="8.5" rx="1.5"/><path d="M5.5 14h5M8 11.25V14"/></svg><svg class="i-light" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><circle cx="8" cy="8" r="3"/><path d="M8 1v1.5M8 13.5V15M1 8h1.5M13.5 8H15M3 3l1 1M12 12l1 1M3 13l1-1M12 4l1-1"/></svg><svg class="i-dark" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"><path d="M13.5 9.5A5.5 5.5 0 0 1 6.5 2.5a5.5 5.5 0 1 0 7 7Z"/></svg></button>
<a class="btn small" href="/#get">下载</a>
</div></nav>
<main class="wrap doc">
<aside class="toc">
<p>Claude Code 用 ChatGPT</p>
<a href="#overview">原理</a>
<a href="#signin">登录 ChatGPT</a>
<a href="#pick">选 GPT 模型</a>
<a href="#tiers">Opus、Sonnet、Haiku</a>
<a href="#effort">推理强度</a>
<a href="#limits">额度与用量</a>
<a href="#accounts">多账号</a>
<a href="#back">切回去</a>
<a href="#reverse">反过来用</a>
<a href="#faq">常见问题</a>
</aside>
<article>
<p class="eyebrow" id="overview">文档 · 指南</p>
<h1>在 Claude Code 中使用 ChatGPT Plus/Pro 订阅</h1>
<p class="lede">Claude Code 可以跑在你 ChatGPT Plus 或 Pro 套餐的 GPT 模型上。在 magpie 里登录 ChatGPT,给 Claude Code 选一个 <code>codex/…</code> 模型,照常使用即可。不需要 OpenAI API Key。</p>
<p>Claude Code 说的是 Anthropic 的 Messages API。magpie 在你电脑上运行一个网关,地址 <code>127.0.0.1:3425</code>,把 Claude Code 的每个请求翻译给 GPT 模型,再把回复翻译回来,流式输出和工具调用都包括在内。magpie 把网关的地址和密钥写进 Claude Code 的 <code>settings.json</code>,你的 ChatGPT 登录只保存在 magpie 里。</p>
<h2 id="signin"><a class="anchor" href="#signin">登录 ChatGPT</a></h2>
<ol class="steps">
<li><b>打开添加供应商</b>在 magpie 的 <span class="ui">供应商</span> 页,点 <span class="ui">+ 添加供应商</span>。</li>
<li><b>点 ChatGPT 卡片</b>magpie 会在浏览器里打开 OpenAI 自己的登录页,登录完成后账号马上出现。</li>
</ol>
<p>也可以在终端里:</p>
<div class="code"><span class="lang">终端</span><button class="copy" data-copy="cg-signin">复制</button><pre id="cg-signin">magpie accounts add codex # 登录一个 ChatGPT 账号</pre></div>
<p>这个账号的模型 id 是 <code>codex/…</code>。</p>
<h2 id="pick"><a class="anchor" href="#pick">给 Claude Code 选 GPT 模型</a></h2>
<p>在 <span class="ui">Agent</span> 页,点 Claude Code 那一行的模型,选一个 <code>codex/…</code> 模型。终端里:</p>
<div class="code"><span class="lang">终端</span><button class="copy" data-copy="cg-pick">复制</button><pre id="cg-pick">magpie models # 列出所有模型,格式 provider/model
magpie claude codex/gpt-5.5</pre></div>
<p>在 Claude Code 里,<code>/model</code> 也会列出 magpie 的模型,标着 “via magpie”,可以直接在那里切换。</p>
<div class="callout"><b>只想部分会话用 GPT?</b>不在 magpie 里接入 Claude Code,需要时运行 <code>claude-magpie</code>。它用 magpie 的设置启动同一个 <code>claude</code>,只对这次会话生效,不改写 <code>settings.json</code>。</div>
<h2 id="tiers"><a class="anchor" href="#tiers">Opus、Sonnet、Haiku 怎么对应</a></h2>
<p>Claude Code 按分档请求模型:<code>opus</code>、<code>sonnet</code>、<code>haiku</code> 和 <code>fable</code>。它自己的小任务,比如会话标题和 Explore 子代理,走 haiku 档。主模型是 GPT 模型时:</p>
<div class="table-wrap"><table>
<tr><th>分档</th><th><code>env</code> 里的变量</th><th>默认</th></tr>
<tr><td>opus</td><td><code>ANTHROPIC_DEFAULT_OPUS_MODEL</code></td><td>你选的 GPT 模型</td></tr>
<tr><td>sonnet</td><td><code>ANTHROPIC_DEFAULT_SONNET_MODEL</code></td><td>你选的 GPT 模型</td></tr>
<tr><td>haiku</td><td><code>ANTHROPIC_DEFAULT_HAIKU_MODEL</code>、<code>ANTHROPIC_SMALL_FAST_MODEL</code></td><td>你选的 GPT 模型</td></tr>
<tr><td>fable</td><td><code>ANTHROPIC_DEFAULT_FABLE_MODEL</code></td><td>不设置</td></tr>
</table></div>
<p>想让某一档用单独的模型,比如 haiku 用小一点的,在 magpie 里 Claude Code 那一行设置,或者在终端里:</p>
<div class="code"><span class="lang">终端</span><button class="copy" data-copy="cg-tier">复制</button><pre id="cg-tier">magpie claude haiku codex/… # 某一档单独用一个模型
magpie claude haiku "" # 回到主模型</pre></div>
<h2 id="effort"><a class="anchor" href="#effort">推理强度</a></h2>
<p>Claude Code 开启 thinking 的请求里,它要的推理强度会作为 GPT 模型的推理强度发过去。magpie 也会告诉 Claude Code 每个模型支持哪些档位。</p>
<p>想不管 Claude Code 要什么都固定一个强度,在 Claude Code 那一行设置 <span class="ui">推理强度</span>。<span class="ui">opus 推理强度</span> 等按分档设置,<span class="ui">子代理推理强度</span> 管子代理。默认都是 <span class="ui">跟随 Claude Code 请求的推理强度</span>。已打开的 Claude Code 会话仍用启动时的推理强度,重开后生效。</p>
<h2 id="limits"><a class="anchor" href="#limits">额度与用量</a></h2>
<p>请求用的是你的 ChatGPT 账号,所以和 Codex 自己的请求一样,计入套餐的用量限制。</p>
<ul>
<li><b>看用了多少。</b>打开 Claude Code 那一行的 <span class="ui">状态栏</span>:Claude Code 输入框下方会显示 magpie 所用账号的 5 小时和 7 天用量。<code>magpie accounts</code> 列出每个账号用掉了多少额度。<span class="ui">用量</span> 页有历史记录。</li>
<li><b>账号用完时。</b>magpie 会暂停这个账号,直到 OpenAI 拒绝时给出的重置时间;没有给出时等它的整个窗口刷新;都不知道时暂停 5 小时。期间请求转给你的下一个账号,或供应商的 <span class="ui">备用</span>。窗口刷新后账号自动回来。</li>
</ul>
<h2 id="accounts"><a class="anchor" href="#accounts">多账号与自动切换</a></h2>
<ul>
<li><b>再加一个账号。</b>再点一次 ChatGPT 卡片,或再运行一次 <code>magpie accounts add codex</code>。每个账号都列在这个供应商下面。</li>
<li><b>在账号间分配请求。</b>打开供应商那一行,勾上要用的账号。默认的 <span class="ui">智能</span> 路由会把请求发给还有额度、且额度最早刷新的账号。</li>
<li><b>用完时换模型。</b>供应商的 <span class="ui">备用</span> 列出所有账号用完、被限流或出错时要用的模型,可以是另一个订阅或 API Key 的模型。</li>
</ul>
<p>各种路由方式见 <a href="/docs/zh/start#routing">快速上手</a>。</p>
<h2 id="back"><a class="anchor" href="#back">切回去</a></h2>
<p>在 Claude Code 那一行选回 Claude Code 自己的模型,或者运行:</p>
<div class="code"><span class="lang">终端</span><button class="copy" data-copy="cg-back">复制</button><pre id="cg-back">magpie claude default</pre></div>
<p>这会撤掉 magpie 对 Claude Code 的接入,恢复原来的配置。Claude Code 那一行的 <span class="ui">断开</span> 效果相同。</p>
<div class="callout"><b>你的 claude.ai 登录。</b>用 magpie 的模型时,Claude Code 的 <span class="ui">登录方式</span> 默认是 <span class="ui">magpie 的密钥</span>:Claude Code 会退出 claude.ai,<code>/usage</code> 的套餐额度、connectors、语音和 <code>/teleport</code> 都不可用。设为 <span class="ui">claude.ai</span> 可以保留它们。</div>
<h2 id="reverse"><a class="anchor" href="#reverse">反过来:在 Codex 里用 Claude</a></h2>
<p>Claude Pro 或 Max 订阅也能这样用在 Codex 里。在 magpie 里登录 Claude,给 Codex 选一个 <code>claude/…</code> 模型。Claude 订阅的请求经由你电脑上安装的 Claude Code 发出,所以请保留它。</p>
<div class="code"><span class="lang">终端</span><button class="copy" data-copy="cg-rev">复制</button><pre id="cg-rev">magpie accounts add claude
magpie codex claude/claude-opus-5-5</pre></div>
<p>见 <a href="/docs/zh/codex-models">Codex 接入其他模型</a> 和 <a href="/docs/zh/subscriptions">订阅用于任意 Agent</a>。</p>
<h2 id="faq"><a class="anchor" href="#faq">常见问题</a></h2>
<h3>能在 Claude Code 里用 ChatGPT Plus 或 Pro 订阅吗?</h3>
<p>可以。在 magpie 里登录 ChatGPT,在 Claude Code 那一行选一个 <code>codex/…</code> 模型,或运行 <code>magpie claude codex/gpt-5.5</code>。magpie 把 Claude Code 的请求翻译给 GPT 模型,再把回复翻译回来,工具调用也包括在内。</p>
<h3>需要 OpenAI API Key 吗?</h3>
<p>不需要。magpie 在 OpenAI 自己的页面登录,Claude Code 拿到的是网关的密钥。你的登录只保存在 magpie 里。</p>
<h3>会占用 ChatGPT 套餐的额度吗?</h3>
<p>会。请求用的是你的 ChatGPT 账号,计入它的用量限制。magpie 的状态栏会在 Claude Code 输入框下方显示每个账号的 5 小时和 7 天用量。</p>
<h3>Claude Code 的 Haiku 请求用哪个模型?</h3>
<p>默认用你选的 GPT 模型,除非你用 <code>magpie claude haiku &lt;model&gt;</code> 给 haiku 档单独设一个。</p>
<h3>怎么切回 Claude 自己的模型?</h3>
<p>运行 <code>magpie claude default</code>,或在 magpie 里 Claude Code 那一行选回 Claude Code 自己的模型。</p>
<h3>请求会经过 magpie 的服务器吗?</h3>
<p>不会。网关运行在你自己的电脑上,请求从这里直接发给 OpenAI,中间没有 magpie 的服务器。</p>
<p style="margin-top:48px">用的是 API Key?见 <a href="/docs/zh/claude-code-models">Claude Code 接入其他模型</a>。遇到报错?见 <a href="/docs/zh/troubleshooting">常见错误排查</a>,或到 <a href="https://discord.gg/vGSnD3ZKQF">Discord</a> 提问。</p>
</article>
</main>
<footer><div class="wrap">
<span>© 2026 magpie · MIT</span>
<div class="links">
<a href="/zh/">首页</a>
<a href="/docs/zh/intent">意图路由</a>
<a href="/docs/zh/plugins">插件开发</a>
<a href="/docs/zh/remote">远程 magpie</a>
<a href="/docs/zh/docker">Docker</a>
<a href="/docs/zh/privacy">隐私</a>
<a href="/docs/zh/masking">本地脱敏</a>
<a href="/docs/zh/mcp-router">MCP 路由</a>
<a href="/docs/zh/library">资源库</a>
<a href="/docs/zh/claude-code-models">Claude Code 接入其他模型</a>
<a href="/docs/zh/codex-models">Codex 接入其他模型</a>
<a href="/docs/zh/gemini-cli-models">Gemini CLI 接入其他模型</a>
<a href="/docs/zh/subscriptions">订阅用于任意 Agent</a>
<a href="/docs/zh/local-models">本地模型</a>
<a href="/docs/zh/opencode-models">OpenCode 接入其他模型</a>
<a href="/docs/zh/alternatives">与 CC Switch、CCR 对比</a>
<a href="/docs/zh/import">Add to magpie</a>
<a href="/docs/zh/integrate">接入应用</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
<a href="https://discord.gg/vGSnD3ZKQF">Discord</a>
<a href="/docs/zh/contributors">贡献墙</a>
<a href="https://github.com/yetone/magpie-releases/releases">版本发布</a>
</div>
</div></footer>
<script>
(() => {
const next = { system: "light", light: "dark", dark: "system" };
document.querySelectorAll("button.theme").forEach((b) => {
b.dataset.mode = themeMode();
b.title = "Theme: " + themeMode();
b.addEventListener("click", () => setTheme(next[themeMode()]));
});
document.querySelectorAll(".copy").forEach((b) => b.addEventListener("click", async () => {
try {
await navigator.clipboard.writeText(document.getElementById(b.dataset.copy).textContent);
b.textContent = "已复制"; setTimeout(() => (b.textContent = "复制"), 1400);
} catch {}
}));
})();
</script>
<script src="/docs.js"></script>
</body>
</html>
+1 -1
View File
@@ -240,7 +240,7 @@ magpie claude haiku "" # 回到跟随主模型</pre></
<p>在 magpie 里登录订阅:<span class="ui">+ 添加供应商</span>,选 ChatGPT 或 Copilot。magpie 会打开官方的登录页。登录后,账号里的模型以 <code>codex/…</code> 或 <code>copilot/…</code> 出现在 Claude Code 的模型列表里。</p>
<div class="code"><span class="lang">终端</span><button class="copy" data-copy="ex-cc-gpt">复制</button><pre id="ex-cc-gpt">magpie accounts add codex # 登录一个 ChatGPT 账号
magpie claude codex/gpt-5.5</pre></div>
<p>Claude Code 说的还是 Anthropic Messages,magpie 把每个请求转成 GPT 模型能懂的格式,再把回复转回来,工具调用也包括在内。Antigravity 账号同理,模型是 <code>antigravity/…</code>。</p>
<p>Claude Code 说的还是 Anthropic Messages,magpie 把每个请求转成 GPT 模型能懂的格式,再把回复转回来,工具调用也包括在内。Antigravity 账号同理,模型是 <code>antigravity/…</code>。ChatGPT 套餐的完整用法,包括分档、推理强度和额度,见 <a href="/docs/zh/claude-code-chatgpt">Claude Code 用 ChatGPT</a>。</p>
<h2 id="routing"><a class="anchor" href="#routing">多个 Key 轮换</a></h2>
<p>有多个 Key 或账号时,magpie 可以把 Claude Code 的请求分摊到它们上面,一个用完自动换下一个。</p>
+1 -1
View File
@@ -362,7 +362,7 @@ IP-CIDR6,::1/128,DIRECT,no-resolve</pre>
</ol>
<p>模型 id 用 magpie 的(<code>magpie models</code>)。打开共享后,局域网里的其他电脑凭网关密钥也能连入;见 <a href="/docs/zh/remote#share">远程 magpie</a>。</p>
<p style="margin-top:48px">遇到问题,或者有值得分享的配置?来 <a href="https://discord.gg/vGSnD3ZKQF">Discord</a> 聊。想给自己的用户一键添加供应商的厂商,请看 <a href="/docs/zh/import">Add to magpie</a>。</p>
<p style="margin-top:48px">网关报错?见 <a href="/docs/zh/troubleshooting">常见错误排查</a>。遇到问题,或者有值得分享的配置?来 <a href="https://discord.gg/vGSnD3ZKQF">Discord</a> 聊。想给自己的用户一键添加供应商的厂商,请看 <a href="/docs/zh/import">Add to magpie</a>。</p>
</article>
</main>
+1 -1
View File
@@ -236,7 +236,7 @@
<h2 id="faq"><a class="anchor" href="#faq">常见问题</a></h2>
<h3>Claude Code 能用 ChatGPT Plus 或 Pro 订阅吗?</h3>
<p>能。在 magpie 里登录 ChatGPT,在 Claude Code 那一行选一个 <code>codex/…</code> 模型,或者运行 <code>magpie claude codex/gpt-5.5</code>。magpie 把 Claude Code 的 Anthropic 请求转成 GPT 模型的格式,再把回复转回来,工具调用也包括在内。</p>
<p>能。在 magpie 里登录 ChatGPT,在 Claude Code 那一行选一个 <code>codex/…</code> 模型,或者运行 <code>magpie claude codex/gpt-5.5</code>。magpie 把 Claude Code 的 Anthropic 请求转成 GPT 模型的格式,再把回复转回来,工具调用也包括在内。分档、推理强度等完整设置见 <a href="/docs/zh/claude-code-chatgpt">Claude Code 用 ChatGPT</a>。</p>
<h3>Codex 或 OpenCode 能用 Claude Pro 或 Max 订阅吗?</h3>
<p>能。在 magpie 里登录 Claude,在这个 Agent 那一行选一个 <code>claude/…</code> 模型。Claude 订阅的请求通过你电脑上安装的 Claude Code 发出,所以要保留 Claude Code。</p>
<h3>GitHub Copilot 的模型能在 VS Code 以外用吗?</h3>
+342
View File
@@ -0,0 +1,342 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>常见错误排查:401、429、502、504 等 · magpie</title>
<meta name="description" content="magpie 网关报错的含义和解决办法:401 和 403、429 与暂停使用、502 和 504、找不到模型、Agent 里看不到模型、3425 端口被占用、WSL 里的 Agent,以及从其他电脑使用。">
<meta name="color-scheme" content="light dark">
<meta name="theme-color" content="#fafafa">
<script>
(() => {
let mode = "system";
try { mode = localStorage.getItem("theme") || "system"; } catch {}
const q = matchMedia("(prefers-color-scheme: dark)");
const apply = () => {
const t = mode === "system" ? (q.matches ? "dark" : "light") : mode;
document.documentElement.dataset.theme = t;
document.querySelector('meta[name="theme-color"]').content = t === "dark" ? "#0b0b0c" : "#fafafa";
document.querySelectorAll("button.theme").forEach((b) => { b.dataset.mode = mode; b.title = "Theme: " + mode; });
};
q.addEventListener("change", () => mode === "system" && apply());
window.setTheme = (m) => { mode = m; try { m === "system" ? localStorage.removeItem("theme") : localStorage.setItem("theme", m); } catch {} apply(); };
window.themeMode = () => mode;
apply();
})();
</script>
<script>try{if(/Linux/.test(navigator.userAgent)&&!/Android/.test(navigator.userAgent)||localStorage.getItem("omarchy")||/[?&]omarchy=/.test(location.search))document.write('<script src="/omarchy.js"><\/script>')}catch(e){}</script>
<link rel="icon" href="/favicon.png" type="image/png">
<link rel="apple-touch-icon" href="/img/icon-256.png">
<link rel="alternate" hreflang="en" href="https://usemagpie.ai/docs/troubleshooting">
<link rel="alternate" hreflang="zh" href="https://usemagpie.ai/docs/zh/troubleshooting">
<link rel="alternate" hreflang="ja" href="https://usemagpie.ai/docs/ja/troubleshooting">
<link rel="alternate" hreflang="x-default" href="https://usemagpie.ai/docs/troubleshooting">
<link rel="canonical" href="https://usemagpie.ai/docs/zh/troubleshooting">
<link rel="stylesheet" href="/docs.css">
<meta property="og:site_name" content="magpie">
<meta property="og:title" content="常见错误排查:401、429、502、504 等">
<meta property="og:description" content="magpie 网关报错的含义和解决办法:401 和 403、429 与暂停使用、502 和 504、找不到模型、Agent 里看不到模型、3425 端口被占用、WSL 里的 Agent,以及从其他电脑使用。">
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
<meta property="og:url" content="https://usemagpie.ai/docs/zh/troubleshooting">
<meta name="twitter:card" content="summary_large_image">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "TechArticle",
"headline": "常见错误排查:401、429、502、504 等",
"description": "magpie 网关报错的含义和解决办法:401 和 403、429 与暂停使用、502 和 504、找不到模型、Agent 里看不到模型、3425 端口被占用、WSL 里的 Agent,以及从其他电脑使用。",
"inLanguage": "zh",
"url": "https://usemagpie.ai/docs/zh/troubleshooting",
"about": {
"@type": "SoftwareApplication",
"name": "magpie",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "macOS, Windows, Linux"
},
"publisher": {
"@type": "Organization",
"name": "magpie",
"url": "https://usemagpie.ai/"
}
},
{
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "供应商明明正常,magpie 为什么回 502?",
"acceptedAnswer": {
"@type": "Answer",
"text": "供应商回的不是 API 回复,比如网页或空内容。通常是 Base URL 指向了厂商的网站而不是 API。"
}
},
{
"@type": "Question",
"name": "429 之后为什么某个账号一直不用?",
"acceptedAnswer": {
"@type": "Answer",
"text": "magpie 会暂停它,直到厂商给出的重置时间;没有给出时暂停一段时间。供应商那一行会显示何时恢复,点“立即重试”可以结束暂停。"
}
},
{
"@type": "Question",
"name": "“magpie knows no model” 是什么意思?",
"acceptedAnswer": {
"@type": "Answer",
"text": "没有供应商提供这个名字的模型。按 magpie models 列出的 provider/model 命名,或重新打开它的供应商。"
}
},
{
"@type": "Question",
"name": "怎么修改 magpie 的端口?",
"acceptedAnswer": {
"@type": "Answer",
"text": "设置 › 网络与共享 › 网关地址。magpie 接入过的 Agent 会一起改过去。"
}
},
{
"@type": "Question",
"name": "WSL 里的 Agent 能用 Windows 上的 magpie 吗?",
"acceptedAnswer": {
"@type": "Answer",
"text": "能。magpie 会在运行中的 WSL 发行版里找到 Agent,并给每个配置一个能连上的地址。NAT 网络下需要 Windows 防火墙放行 WSL 的连接。"
}
},
{
"@type": "Question",
"name": "能从局域网里的其他电脑用 magpie 吗?",
"acceptedAnswer": {
"@type": "Answer",
"text": "能。打开 设置 › 网络与共享 › 局域网共享,另一台电脑发送网关密钥即可。不要把端口暴露到公网。"
}
}
]
}
]
}
</script>
</head>
<body>
<nav><div class="wrap">
<a class="brand" href="/zh/"><img class="bird" src="/img/magpie-small.svg" alt="">magpie <small>文档</small></a>
<div class="links">
<a href="/zh/">首页</a>
<a href="/docs/zh/start">快速上手</a>
<a href="/docs/zh/intent">意图路由</a>
<a href="/docs/zh/plugins">插件开发</a>
<a class="toc-only" href="/docs/zh/remote">远程 magpie</a>
<a class="toc-only" href="/docs/zh/docker">Docker</a>
<a class="toc-only" href="/docs/zh/privacy">隐私</a>
<a class="toc-only" href="/docs/zh/masking">本地脱敏</a>
<a class="toc-only" href="/docs/zh/mcp-router">MCP 路由</a>
<a class="toc-only" href="/docs/zh/library">资源库</a>
<a class="toc-only" href="/docs/zh/claude-code-models">Claude Code 接入其他模型</a>
<a class="toc-only" href="/docs/zh/codex-models">Codex 接入其他模型</a>
<a class="toc-only" href="/docs/zh/gemini-cli-models">Gemini CLI 接入其他模型</a>
<a class="toc-only" href="/docs/zh/subscriptions">订阅用于任意 Agent</a>
<a class="toc-only" href="/docs/zh/local-models">本地模型</a>
<a class="toc-only" href="/docs/zh/opencode-models">OpenCode 接入其他模型</a>
<a class="toc-only" href="/docs/zh/alternatives">与 CC Switch、CCR 对比</a>
<a href="/docs/zh/import">Add to magpie</a>
<a href="/docs/zh/integrate">接入应用</a>
<a href="https://github.com/yetone/magpie-releases/releases">版本发布</a>
</div>
<div class="langs">
<button class="icon-btn lang" type="button" aria-label="语言" title="语言" aria-haspopup="true" aria-expanded="false" aria-controls="langs"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><circle cx="8" cy="8" r="6.25"/><path d="M1.75 8h12.5M8 1.75c1.7 1.75 2.55 3.83 2.55 6.25S9.7 12.5 8 14.25M8 1.75C6.3 3.5 5.45 5.58 5.45 8S6.3 12.5 8 14.25"/></svg></button>
<div class="lang-menu" id="langs" hidden>
<a href="/docs/troubleshooting" hreflang="en" lang="en">English</a>
<a href="/docs/zh/troubleshooting" hreflang="zh" lang="zh">中文</a>
<a href="/docs/ja/troubleshooting" hreflang="ja" lang="ja">日本語</a>
</div>
</div>
<a class="icon-btn" href="https://discord.gg/vGSnD3ZKQF" aria-label="magpie on Discord" title="Join us on Discord"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/></svg></a>
<a class="icon-btn" href="https://github.com/yetone/magpie" aria-label="magpie on GitHub" title="Source on GitHub"><svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg></a>
<button class="icon-btn theme" type="button" aria-label="Theme" title="Theme: system"><svg class="i-system" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1.75" y="2.75" width="12.5" height="8.5" rx="1.5"/><path d="M5.5 14h5M8 11.25V14"/></svg><svg class="i-light" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><circle cx="8" cy="8" r="3"/><path d="M8 1v1.5M8 13.5V15M1 8h1.5M13.5 8H15M3 3l1 1M12 12l1 1M3 13l1-1M12 4l1-1"/></svg><svg class="i-dark" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"><path d="M13.5 9.5A5.5 5.5 0 0 1 6.5 2.5a5.5 5.5 0 1 0 7 7Z"/></svg></button>
<a class="btn small" href="/#get">下载</a>
</div></nav>
<main class="wrap doc">
<aside class="toc">
<p>常见错误排查</p>
<a href="#overview">先看哪里</a>
<a href="#auth">401 和 403</a>
<a href="#limits">429 与暂停</a>
<a href="#bad-gateway">502</a>
<a href="#timeout">504</a>
<a href="#unknown-model">找不到模型</a>
<a href="#not-listed">Agent 里看不到模型</a>
<a href="#port">3425 端口被占用</a>
<a href="#wsl">WSL 里的 Agent</a>
<a href="#lan">从其他电脑使用</a>
<a href="#plugins">已迁移到插件</a>
<a href="#faq">常见问题</a>
</aside>
<article>
<p class="eyebrow" id="overview">文档 · 帮助</p>
<h1>常见错误排查:401、429、502、504 等</h1>
<p class="lede">magpie 网关的报错会说明出了什么问题。这一页列出常见的报错、原因和解决办法。</p>
<p>每个请求都列在 magpie 的 <span class="ui">路由</span> 页上:发给了哪个供应商、哪个账号,每次尝试的结果。在请求上点 <span class="ui">复制报告</span>,就能拿到求助需要的信息。</p>
<h2 id="auth"><a class="anchor" href="#auth">401 和 403:密钥或登录被拒</a></h2>
<p><b>来自厂商。</b>供应商拒绝了 magpie 发送的密钥或登录。magpie 会暂停这个密钥或账号,改用下一个,所以只有全都不行时你才会看到报错。登录过期时报错会直接说明,比如 “the ChatGPT sign-in has expired — sign in again”。</p>
<ul><li><b>解决:</b>在 <span class="ui">+ 添加供应商</span> 里重新登录(或 <code>magpie accounts add &lt;provider&gt;</code>),或者给供应商换一个新密钥。</li></ul>
<p><b>来自 magpie 自己。</b>以下情况 magpie 会直接回 403,什么都不发出去:</p>
<div class="table-wrap"><table>
<tr><th>报错</th><th>原因</th><th>解决</th></tr>
<tr><td>model disabled</td><td>你在 magpie 里关掉了这个模型。</td><td>在它的供应商里重新打开。</td></tr>
<tr><td>model not allowed for the gateway key</td><td>这个网关密钥限定了可用的模型。</td><td>用 <code>magpie gateway-key models &lt;id&gt;</code> 查看或修改。</td></tr>
<tr><td>magpie doesn’t answer the web page …</td><td>有网页在浏览器里调用网关。</td><td>把它加到 <span class="ui">设置</span> › <span class="ui">网络与共享</span> › <span class="ui">网页</span>,并发送网关密钥。</td></tr>
</table></div>
<h2 id="limits"><a class="anchor" href="#limits">429 与暂停使用</a></h2>
<p>429 表示供应商额度用完、余额不足或在限流。magpie 会暂停被拒的密钥或账号,把请求交给下一个账号、路由组里的下一个成员,或供应商的 <span class="ui">备用</span>。供应商那一行会显示 <span class="ui">暂停使用 · {why} · {time} 恢复</span>。</p>
<div class="table-wrap"><table>
<tr><th>被拒原因</th><th>暂停多久</th></tr>
<tr><td>额度用完,给出了重置时间</td><td>到重置为止</td></tr>
<tr><td>限流,带 Retry-After</td><td>到那时为止</td></tr>
<tr><td>余额不足</td><td>30 分钟;再被拒依次为 2 小时、8 小时、1 天、3 天、1 周</td></tr>
<tr><td>ChatGPT 账号额度用完</td><td>到拒绝时给出的重置时间;没有就等整个窗口刷新;都不知道就 5 小时</td></tr>
<tr><td>其他失败</td><td>1 分钟,重复时翻倍,最多 10 分钟(限流最多 30 分钟)</td></tr>
</table></div>
<ul>
<li><b>现在就再试。</b><span class="ui">立即重试</span> 会结束暂停:下一个请求会再次使用它。再被拒绝时,会照常再次暂停。</li>
<li><b>限制暂停时长。</b><code>magpie provider rest-cap &lt;id&gt; 4h</code> 设置一个供应商最长暂停多久;<code>off</code> 让它在原因不明的失败后不暂停。</li>
<li><b>限额很快恢复的中转站。</b>在供应商编辑器的 <span class="ui">高级</span> 里取消勾选 <span class="ui">额度用完或被限流时暂停它</span>:之后 429 不再暂停它,下一个请求照常发给它。</li>
<li><b>不要只靠一个。</b>再加一个账号或备用模型,一个用完不会让 Agent 停下来。<code>magpie accounts</code> 显示每个账号用掉了多少额度。</li>
</ul>
<p>暂停状态在重启后保留,退出 magpie 不会让暂停中的账号提前回来。</p>
<h2 id="bad-gateway"><a class="anchor" href="#bad-gateway">502:供应商没有正常回应</a></h2>
<p>502 表示 magpie 没从供应商拿到 API 回复。供应商名称后面的内容说明是哪种情况:</p>
<ul>
<li><b>“didn’t answer: …”</b>连接失败:域名解析不了、连接被拒、代理没开。这台电脑完全没有网络时,magpie 能识别出来,不会暂停任何供应商。</li>
<li><b>“… not an API reply”</b>供应商回应了,但回的是网页(登录页、Cloudflare 验证页)、空内容,或不是 JSON 的内容。通常是 Base URL 指向了网站而不是 API:对照厂商文档检查,看看是否需要以 <code>/v1</code> 结尾。</li>
<li><b>OpenCode:“… which is no error, not an API reply”。</b>OpenCode 的网关有时会回一个只含模型名的 400。同样的请求几秒后就能成功,所以 magpie 把它当作 502:在请求的等待时间内重试,或换路由组的下一个成员,不暂停任何账号。它和携带特别多工具定义的请求有关。</li>
</ul>
<p>502、503、504、529 和 Cloudflare 的 520 到 524 都算作“忙”:magpie 会先重试或换路由组的下一个成员,然后才把错误交给 Agent。</p>
<h2 id="timeout"><a class="anchor" href="#timeout">504:没有及时回应</a></h2>
<ul>
<li><b>“&lt;provider&gt;: no first token in Ns”。</b>路由组给每个成员一个开始回复的时限(<span class="ui">首字耗时</span>)。这个成员超时了,于是换了下一个。慢模型可以在组里调大它。</li>
<li><b>“no member of the group answered within its Ns budget”。</b>在组的时限内试过了每个成员,都没有回应。</li>
<li><b>“magpie held this request for … without routing it to any provider”。</b>请求在 magpie 内部等待过久,被停下而不是一直挂着。重新发送;如果还出现,在 <span class="ui">路由</span> 页这个请求上点 <span class="ui">复制报告</span>,发出来。</li>
</ul>
<h2 id="unknown-model"><a class="anchor" href="#unknown-model">找不到模型(404)</a></h2>
<p>报错是 <em>magpie knows no model “…”</em>,常带有 <em>did you mean …?</em> 和你的供应商 id 列表。</p>
<ul>
<li><b>按 magpie 的方式命名。</b>用 <code>provider/model</code>(和 <code>magpie models</code> 列出的一样)、路由组的 id 或名称,或者不带前缀的模型 id。</li>
<li><b>“… is switched off in Magpie, so … is not served”。</b>供应商或路由组被关掉了。在供应商页或路由页重新打开。</li>
<li><b>还没有供应商。</b>报错会说 “add a provider in magpie first”。</li>
</ul>
<h2 id="not-listed"><a class="anchor" href="#not-listed">Agent 里看不到模型</a></h2>
<ul>
<li><b>重启 Agent。</b>大多数 Agent 只在启动时读取配置。改动后 magpie 会在 Agent 那一行提示,比如 Codex 启动时生成模型列表。Codex 应用还有一个常驻的 app-server,按提示重启它。</li>
<li><b>确认 magpie 提供这个模型。</b><code>magpie models</code> 列出所有可选模型。你关掉的模型,或所在供应商被关掉的模型,不会列出。</li>
<li><b>Claude Code。</b><code>/model</code> 会列出标着 “via magpie” 的模型。如果 shell 里设置了 <code>CLAUDE_CODE_USE_BEDROCK</code> 或 <code>CLAUDE_CODE_USE_VERTEX</code>,Claude Code 会连到那个云而不是 magpie;把它从 shell 配置文件里去掉。</li>
</ul>
<h2 id="port"><a class="anchor" href="#port">3425 端口被占用</a></h2>
<p>网关监听 <code>127.0.0.1:3425</code>。要换端口,打开 <span class="ui">设置</span> › <span class="ui">网络与共享</span> › <span class="ui">网关地址</span>。这里只设置端口(1024 到 65535),magpie 接入过的 Agent 会一起改过去。</p>
<div class="table-wrap"><table>
<tr><th>magpie 的提示</th><th>解决</th></tr>
<tr><td>端口 … 已被其他程序占用,请换一个</td><td>换一个空闲端口。</td></tr>
<tr><td>另一个 magpie 正在 … 提供网关:请在那边设端口,或先退出它</td><td>运行了两个 magpie,退出一个。</td></tr>
<tr><td>端口 … 被其他程序占用(可能是 magpie web):magpie 每隔几秒会再试一次</td><td>找到占用端口的程序,或把网关换到别的端口。</td></tr>
<tr><td>MAGPIE_ADDR=… 设置了网关的完整地址</td><td>取消或修改 <code>MAGPIE_ADDR</code>。</td></tr>
</table></div>
<h2 id="wsl"><a class="anchor" href="#wsl">WSL 里的 Agent</a></h2>
<p>在 Windows 上,magpie 会在正在运行的 WSL 发行版里查找 Claude Code、Codex、OpenCode、Kimi Code、Qwen Code 等 Agent。找到的每个都在 Agent 页有自己的一行,magpie 像在 Windows 上一样配置它。magpie 不会启动已停止的发行版。</p>
<ul>
<li><b>没有列出 Agent。</b>先启动发行版,并确认 <span class="ui">设置</span> › <span class="ui">常规</span> › <span class="ui">检测 WSL 中的 Agent</span> 已打开。</li>
<li><b>连不上 magpie。</b>在 WSL 默认的 NAT 网络下,magpie 还会在 Windows 的 WSL 网络地址上提供网关,使用单独的密钥,并把这个地址写进 Agent 的配置。镜像网络模式下,Agent 和 Windows 上一样用 <code>127.0.0.1</code>。是否放行仍由 Windows 防火墙决定:WSL 网络属于“公用”网络,连接被拦时请在那里允许 magpie。</li>
<li><b>改动没生效。</b>WSL 里的 Agent 启动时读取配置:在那边重启它。</li>
</ul>
<h2 id="lan"><a class="anchor" href="#lan">从局域网里的其他电脑使用</a></h2>
<p>默认情况下网关只回应本机。要让其他电脑使用:<span class="ui">设置</span> › <span class="ui">网络与共享</span> › <span class="ui">局域网共享</span>。另一台电脑需要发送 <span class="ui">网关</span> 页 <span class="ui">网关密钥</span> 里的密钥。</p>
<ul>
<li><b>“magpie isn’t shared on the local network”。</b>在运行 magpie 的电脑上打开共享。</li>
<li><b>401。</b>没带密钥,或密钥已关闭、已过期。以 <code>Authorization: Bearer &lt;key&gt;</code> 或 <code>x-api-key</code> 发送一个启用的网关密钥。</li>
<li><b>某个模型 403。</b>这个密钥限定了可用的模型:<code>magpie gateway-key models &lt;id&gt;</code>。</li>
</ul>
<p>不要把端口暴露到公网;在电脑之间用 VPN。完整的设置,包括连接另一台 magpie,见 <a href="/docs/zh/remote">远程 magpie</a>。</p>
<h2 id="plugins"><a class="anchor" href="#plugins">已迁移到插件的订阅无法使用</a></h2>
<p>Command Code、Cursor、Devin、Factory、Grok、Kiro、Xiaomi MiMo、Qoder、WorkBuddy、ZCode 和 Zed 已不再内置于 magpie,各自由一个功能相同的社区插件提供。之前添加的账号还需要迁移到插件,迁移之前它们无法使用。</p>
<ul><li><b>解决:</b>供应商列表上方会有一行提示“… 的内置订阅已下线,它的账号还没迁移到插件”。点 <span class="ui">迁移到插件</span>:magpie 会安装插件并逐个检查账号。迁移会保留你的账号、模型和 Agent 设置。magpie 也会自动迁移,在 <span class="ui">插件</span> 页安装插件同样会迁移。</li></ul>
<p>迁移后的报错来自插件:登录、模型和请求都由插件处理。</p>
<h2 id="faq"><a class="anchor" href="#faq">常见问题</a></h2>
<h3>供应商明明正常,magpie 为什么回 502?</h3>
<p>供应商回的不是 API 回复,比如网页或空内容。通常是 Base URL 指向了厂商的网站而不是 API。</p>
<h3>429 之后为什么某个账号一直不用?</h3>
<p>magpie 会暂停它,直到厂商给出的重置时间;没有给出时暂停一段时间。供应商那一行会显示何时恢复,点“立即重试”可以结束暂停。</p>
<h3>“magpie knows no model” 是什么意思?</h3>
<p>没有供应商提供这个名字的模型。按 magpie models 列出的 provider/model 命名,或重新打开它的供应商。</p>
<h3>怎么修改 magpie 的端口?</h3>
<p>设置 › 网络与共享 › 网关地址。magpie 接入过的 Agent 会一起改过去。</p>
<h3>WSL 里的 Agent 能用 Windows 上的 magpie 吗?</h3>
<p>能。magpie 会在运行中的 WSL 发行版里找到 Agent,并给每个配置一个能连上的地址。NAT 网络下需要 Windows 防火墙放行 WSL 的连接。</p>
<h3>能从局域网里的其他电脑用 magpie 吗?</h3>
<p>能。打开 设置 › 网络与共享 › 局域网共享,另一台电脑发送网关密钥即可。不要把端口暴露到公网。</p>
<p style="margin-top:48px">还没解决?在路由页复制这个请求的报告,到 <a href="https://discord.gg/vGSnD3ZKQF">Discord</a> 提问。</p>
</article>
</main>
<footer><div class="wrap">
<span>© 2026 magpie · MIT</span>
<div class="links">
<a href="/zh/">首页</a>
<a href="/docs/zh/intent">意图路由</a>
<a href="/docs/zh/plugins">插件开发</a>
<a href="/docs/zh/remote">远程 magpie</a>
<a href="/docs/zh/docker">Docker</a>
<a href="/docs/zh/privacy">隐私</a>
<a href="/docs/zh/masking">本地脱敏</a>
<a href="/docs/zh/mcp-router">MCP 路由</a>
<a href="/docs/zh/library">资源库</a>
<a href="/docs/zh/claude-code-models">Claude Code 接入其他模型</a>
<a href="/docs/zh/codex-models">Codex 接入其他模型</a>
<a href="/docs/zh/gemini-cli-models">Gemini CLI 接入其他模型</a>
<a href="/docs/zh/subscriptions">订阅用于任意 Agent</a>
<a href="/docs/zh/local-models">本地模型</a>
<a href="/docs/zh/opencode-models">OpenCode 接入其他模型</a>
<a href="/docs/zh/alternatives">与 CC Switch、CCR 对比</a>
<a href="/docs/zh/import">Add to magpie</a>
<a href="/docs/zh/integrate">接入应用</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
<a href="https://discord.gg/vGSnD3ZKQF">Discord</a>
<a href="/docs/zh/contributors">贡献墙</a>
<a href="https://github.com/yetone/magpie-releases/releases">版本发布</a>
</div>
</div></footer>
<script>
(() => {
const next = { system: "light", light: "dark", dark: "system" };
document.querySelectorAll("button.theme").forEach((b) => {
b.dataset.mode = themeMode();
b.title = "Theme: " + themeMode();
b.addEventListener("click", () => setTheme(next[themeMode()]));
});
document.querySelectorAll(".copy").forEach((b) => b.addEventListener("click", async () => {
try {
await navigator.clipboard.writeText(document.getElementById(b.dataset.copy).textContent);
b.textContent = "已复制"; setTimeout(() => (b.textContent = "复制"), 1400);
} catch {}
}));
})();
</script>
<script src="/docs.js"></script>
</body>
</html>
+267 -3
View File
@@ -312,7 +312,7 @@ Users report that this works. Trae keeps custom models in your Trae account, on
The model id is magpie’s (`magpie models`). Sharing lets other computers on your network in with a gateway key; see [Remote magpie](https://usemagpie.ai/docs/remote#share).
Stuck, or have a setup worth sharing? Ask on [Discord](https://discord.gg/vGSnD3ZKQF). Vendors who want to hand their users a ready-made provider: see [Add to magpie](https://usemagpie.ai/docs/import).
An error from the gateway? See [Fixing common errors](https://usemagpie.ai/docs/troubleshooting). Stuck, or have a setup worth sharing? Ask on [Discord](https://discord.gg/vGSnD3ZKQF). Vendors who want to hand their users a ready-made provider: see [Add to magpie](https://usemagpie.ai/docs/import).
---
@@ -405,7 +405,7 @@ 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/…`.
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](https://usemagpie.ai/docs/claude-code-chatgpt).
## Routing over several keys
@@ -766,7 +766,7 @@ Any tool with a base-URL setting can use a subscription through the gateway too.
### 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 Anthropic requests for the GPT model and the replies back, tool calls included.
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 Anthropic requests for the GPT model and the replies back, tool calls included. The whole setup, tiers and effort included, is in [ChatGPT in Claude Code](https://usemagpie.ai/docs/claude-code-chatgpt).
### Can I use my Claude Pro or Max subscription in Codex or OpenCode?
@@ -796,6 +796,132 @@ Using a key instead? See [Models in Claude Code](https://usemagpie.ai/docs/claud
---
Source: https://usemagpie.ai/docs/claude-code-chatgpt
# Use your ChatGPT Plus or Pro subscription 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.
## Sign in to ChatGPT
1. **Open Add provider.** In magpie’s Providers tab, press + Add provider.
2. **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 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.
## 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
```
## 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 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.
## 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](https://usemagpie.ai/docs/start#routing).
## 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.
## 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](https://usemagpie.ai/docs/codex-models) and [Subscriptions in any agent](https://usemagpie.ai/docs/subscriptions).
## 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 <model>`.
### 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](https://usemagpie.ai/docs/claude-code-models). Something fails? See [Fixing common errors](https://usemagpie.ai/docs/troubleshooting), or ask on [Discord](https://discord.gg/vGSnD3ZKQF).
---
Source: https://usemagpie.ai/docs/local-models
# Use Ollama or LM Studio models in Claude Code and Codex
@@ -3057,6 +3183,144 @@ See also [Privacy](https://usemagpie.ai/docs/privacy) for everything magpie send
---
Source: https://usemagpie.ai/docs/troubleshooting
# 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”.
- **Fix:.** sign in again from + Add provider (or `magpie accounts add <provider>`), or give the provider a new key.
**From magpie itself.** magpie answers 403 on its own in a few cases, before anything is sent:
| Error | Cause | Fix |
| --- | --- | --- |
| model disabled | You turned the model off in magpie. | Turn it on again on its provider. |
| model not allowed for the gateway key | The 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 for | Rests |
| --- | --- |
| Quota, with a reset time | Until the reset |
| Rate limit, with Retry-After | Until then |
| Credit | 30 minutes, then 2 hours, 8 hours, a day, 3 days and a week if it is refused again |
| A ChatGPT account out of credits | Until the reset its refusal names, else until its full window renews, else 5 hours |
| Any other failure | A minute, doubling on repeats up to 10 minutes (30 for a rate limit) |
- **Ask it again now..** Try now ends the rest: the next request asks it again. Refused again, it rests again.
- **Cap the rest..** `magpie provider rest-cap <id> 4h` sets the longest rest for a provider; `off` stops it resting for failures that say nothing of why.
- **A relay whose limits pass in a moment..** Untick Set it aside when out of quota or rate limited in the provider editor’s Advanced: a 429 then rests nothing, and the next request goes to it as usual.
- **Never all at once..** Add a second account or a fallback model, so a spent one never stops the agent. `magpie accounts` shows how much of each account’s allowance is used.
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:
- **“didn’t answer: …”.** The connection failed: a name that doesn’t resolve, a refused connection, a proxy that is down. When this computer has no network at all, magpie notices and rests nobody.
- **“… not an API reply”.** The provider answered, but with a web page (a sign-in page, a Cloudflare challenge), nothing at all, or something that isn’t JSON. The base URL usually points at a web site instead of the API: check it against the vendor’s docs, and whether it should end in `/v1`.
- **OpenCode: “… which is no error, not an API reply”..** OpenCode’s gateway sometimes answers a 400 holding only the model’s name. The same request is answered some seconds later, so magpie reads it as a 502, asks again within the request’s patience or tries a group’s next member, and rests nobody. It is tied to requests carrying very large tool lists.
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
- **“<provider>: no first token in Ns”..** A routing group gives each member a time to start answering (First token). The member was slower, so the next was asked. Raise it on the group for a slow model.
- **“no member of the group answered within its Ns budget”..** Every member of the group was tried within the group’s time and none answered.
- **“magpie held this request for … without routing it to any provider”..** The request waited inside magpie and was stopped rather than left waiting. Send it again; if it comes back, Copy Report on that request on the Routing page and share it.
## Model not found (404)
The error reads *magpie knows no model “…”*, often with *did you mean …?* and the list of your provider ids.
- **Name it as magpie does..** Use `provider/model`, as `magpie models` lists it, a routing group’s id or name, or a bare model id.
- **“… is switched off in Magpie, so … is not served”..** The provider or routing group is off. Switch it on again on the Providers or Routing page.
- **No providers yet..** The error says “add a provider in magpie first”.
## The agent doesn’t show the model
- **Restart the agent..** Most agents read their config only when they start. magpie says so on the agent’s row after a change, for example “Codex builds its model list at start-up”. Codex’s app also keeps an app-server running; restart it as the notice says.
- **Check magpie serves it..** `magpie models` lists every model you can pick. A model you turned off, or one whose provider is switched off, isn’t listed.
- **Claude Code..** `/model` lists magpie’s models marked “via magpie”. If `CLAUDE_CODE_USE_BEDROCK` or `CLAUDE_CODE_USE_VERTEX` is set in your shell, Claude Code goes to that cloud instead of magpie; remove it from your shell profile.
## 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 says | Fix |
| --- | --- |
| Port … is in use by another program: pick another one | Pick a free port. |
| Another magpie serves the gateway at …: set its port there, or quit it first | Two copies of magpie are running. Quit one. |
| Port … is taken by another program, magpie web perhaps: magpie tries again every few seconds | Find 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 here | Unset `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.
- **The agent isn’t listed..** Start the distro, and check Settings › General › Detect agents in WSL is on.
- **It can’t reach magpie..** Under WSL’s default NAT networking, magpie also serves the gateway at Windows’ address on the WSL network, with a key of its own, and writes that address into the agent’s config. With mirrored networking the agent uses `127.0.0.1` as on Windows. Windows’ firewall still decides: WSL’s network counts as Public, so allow magpie there if the connection is blocked.
- **A change doesn’t show..** An agent in WSL reads its config at start-up: restart it there.
## 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.
- **“magpie isn’t shared on the local network”..** Turn sharing on, on the computer that runs magpie.
- **401..** The key is missing, off or expired. Send an enabled gateway key as `Authorization: Bearer <key>` or `x-api-key`.
- **403 for a model..** The key is held to some models: `magpie gateway-key models <id>`.
Don’t open the port to the internet; use a VPN between your computers. The full setup, another magpie included, is in [Remote magpie](https://usemagpie.ai/docs/remote).
## 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.
- **Fix:.** a line over the Providers list says “… built-in subscription is retired, and its accounts haven’t moved to its plugin yet”. Press Move to the plugin: magpie installs the plugin and checks each account. Moving keeps your accounts, models and agents as they are. magpie also moves them by itself, and installing the plugin from the Plugins page does too.
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](https://discord.gg/vGSnD3ZKQF).
---
Source: https://usemagpie.ai/docs/library
# Library
+2
View File
@@ -41,6 +41,7 @@ DeepSeek, Kimi (Moonshot), GLM (Zhipu), Qwen, MiniMax, Anthropic (Claude), OpenA
- [Models in Codex](https://usemagpie.ai/docs/codex-models): run Codex on DeepSeek, Kimi, GLM, Qwen or a Claude subscription; the /model list with reasoning efforts and what changes in config.toml.
- [Models in Gemini CLI](https://usemagpie.ai/docs/gemini-cli-models): run Gemini CLI on DeepSeek, Kimi, GLM, Qwen or a Claude or ChatGPT subscription; what changes in ~/.gemini/.env and settings.json, and how to switch back.
- [Subscriptions in any agent](https://usemagpie.ai/docs/subscriptions): sign in to Claude, ChatGPT, GitHub Copilot, Gemini Code Assist or Antigravity in magpie and use its models in Claude Code, Codex, Gemini CLI or OpenCode, with several accounts and failover.
- [ChatGPT in Claude Code](https://usemagpie.ai/docs/claude-code-chatgpt): use a ChatGPT Plus or Pro subscription in Claude Code with no API key; signing in, picking a GPT model, how the opus, sonnet and haiku tiers map, reasoning effort, usage limits, several accounts and switching back.
- [Local models in Claude Code and Codex](https://usemagpie.ai/docs/local-models): run Claude Code and Codex on Ollama, LM Studio, oMLX, MLX-Serve, vLLM or llama.cpp; default addresses, which API each server speaks, context window and masking.
- [Models in OpenCode](https://usemagpie.ai/docs/opencode-models): run OpenCode on DeepSeek, Kimi, GLM, Qwen or a Claude, ChatGPT or Copilot subscription; what magpie writes in opencode.json, reasoning variants and cost, and how to switch back.
- [magpie vs CC Switch vs Claude Code Router](https://usemagpie.ai/docs/alternatives): a fair comparison of the three: agents, config rewrite or local proxy, protocol translation, subscription sign-ins, routing and failover, GUI and CLI, platforms and license, and which one fits.
@@ -59,6 +60,7 @@ DeepSeek, Kimi (Moonshot), GLM (Zhipu), Qwen, MiniMax, Anthropic (Claude), OpenA
- [OpenAI in every agent](https://usemagpie.ai/docs/openai): an OpenAI API key (or Azure OpenAI) in Claude Code, Codex, Gemini CLI and OpenCode; Responses vs Chat Completions, prompt_cache_key, reasoning effort and Fast (priority tier), web search, cost and several keys.
- [Intent routing](https://usemagpie.ai/docs/intent): how a turn is routed by what the user asks for.
- [Privacy masking](https://usemagpie.ai/docs/masking): what is masked before a request leaves the computer and how values come back.
- [Fixing common errors](https://usemagpie.ai/docs/troubleshooting): what the gateway's errors mean and the fix: 401 and 403, 429 and rest periods, 502 and 504, model not found, an agent that doesn't show a model, port 3425 in use, agents in WSL, use from another computer and subscriptions moved to plugins.
- [Library](https://usemagpie.ai/docs/library): instructions, MCP servers, skills, hooks and subagents for each agent.
- [MCP router](https://usemagpie.ai/docs/mcp-router): one magpie MCP server per agent.
- [Remote magpie](https://usemagpie.ai/docs/remote): use one magpie from several computers.
+6
View File
@@ -5,6 +5,7 @@
<url><loc>https://usemagpie.ai/ja/</loc></url>
<url><loc>https://usemagpie.ai/de/</loc></url>
<url><loc>https://usemagpie.ai/docs/claude-code-models</loc></url>
<url><loc>https://usemagpie.ai/docs/claude-code-chatgpt</loc></url>
<url><loc>https://usemagpie.ai/docs/codex-models</loc></url>
<url><loc>https://usemagpie.ai/docs/contributors</loc></url>
<url><loc>https://usemagpie.ai/docs/docker</loc></url>
@@ -20,6 +21,7 @@
<url><loc>https://usemagpie.ai/docs/remote</loc></url>
<url><loc>https://usemagpie.ai/docs/start</loc></url>
<url><loc>https://usemagpie.ai/docs/subscriptions</loc></url>
<url><loc>https://usemagpie.ai/docs/troubleshooting</loc></url>
<url><loc>https://usemagpie.ai/docs/local-models</loc></url>
<url><loc>https://usemagpie.ai/docs/opencode-models</loc></url>
<url><loc>https://usemagpie.ai/docs/alternatives</loc></url>
@@ -37,6 +39,7 @@
<url><loc>https://usemagpie.ai/docs/anthropic</loc></url>
<url><loc>https://usemagpie.ai/docs/openai</loc></url>
<url><loc>https://usemagpie.ai/docs/zh/claude-code-models</loc></url>
<url><loc>https://usemagpie.ai/docs/zh/claude-code-chatgpt</loc></url>
<url><loc>https://usemagpie.ai/docs/zh/codex-models</loc></url>
<url><loc>https://usemagpie.ai/docs/zh/contributors</loc></url>
<url><loc>https://usemagpie.ai/docs/zh/docker</loc></url>
@@ -52,6 +55,7 @@
<url><loc>https://usemagpie.ai/docs/zh/remote</loc></url>
<url><loc>https://usemagpie.ai/docs/zh/start</loc></url>
<url><loc>https://usemagpie.ai/docs/zh/subscriptions</loc></url>
<url><loc>https://usemagpie.ai/docs/zh/troubleshooting</loc></url>
<url><loc>https://usemagpie.ai/docs/zh/local-models</loc></url>
<url><loc>https://usemagpie.ai/docs/zh/opencode-models</loc></url>
<url><loc>https://usemagpie.ai/docs/zh/alternatives</loc></url>
@@ -69,6 +73,7 @@
<url><loc>https://usemagpie.ai/docs/zh/anthropic</loc></url>
<url><loc>https://usemagpie.ai/docs/zh/openai</loc></url>
<url><loc>https://usemagpie.ai/docs/ja/claude-code-models</loc></url>
<url><loc>https://usemagpie.ai/docs/ja/claude-code-chatgpt</loc></url>
<url><loc>https://usemagpie.ai/docs/ja/codex-models</loc></url>
<url><loc>https://usemagpie.ai/docs/ja/contributors</loc></url>
<url><loc>https://usemagpie.ai/docs/ja/docker</loc></url>
@@ -83,6 +88,7 @@
<url><loc>https://usemagpie.ai/docs/ja/remote</loc></url>
<url><loc>https://usemagpie.ai/docs/ja/start</loc></url>
<url><loc>https://usemagpie.ai/docs/ja/subscriptions</loc></url>
<url><loc>https://usemagpie.ai/docs/ja/troubleshooting</loc></url>
<url><loc>https://usemagpie.ai/docs/ja/local-models</loc></url>
<url><loc>https://usemagpie.ai/docs/ja/opencode-models</loc></url>
<url><loc>https://usemagpie.ai/docs/ja/alternatives</loc></url>