From d2a80b31731c6efbc9554c73d0b3e714d2d004e9 Mon Sep 17 00:00:00 2001 From: yetone Date: Wed, 11 Nov 2026 04:48:27 +0800 Subject: [PATCH] site: docs pages for ChatGPT in Claude Code and fixing common errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- site/public/docs/claude-code-chatgpt.html | 308 +++++++++++++++++ site/public/docs/claude-code-models.html | 2 +- site/public/docs/ja/claude-code-chatgpt.html | 308 +++++++++++++++++ site/public/docs/ja/claude-code-models.html | 2 +- site/public/docs/ja/start.html | 2 +- site/public/docs/ja/subscriptions.html | 2 +- site/public/docs/ja/troubleshooting.html | 342 +++++++++++++++++++ site/public/docs/start.html | 2 +- site/public/docs/subscriptions.html | 2 +- site/public/docs/troubleshooting.html | 342 +++++++++++++++++++ site/public/docs/zh/claude-code-chatgpt.html | 308 +++++++++++++++++ site/public/docs/zh/claude-code-models.html | 2 +- site/public/docs/zh/start.html | 2 +- site/public/docs/zh/subscriptions.html | 2 +- site/public/docs/zh/troubleshooting.html | 342 +++++++++++++++++++ site/public/llms-full.txt | 270 ++++++++++++++- site/public/llms.txt | 2 + site/public/sitemap.xml | 6 + 18 files changed, 2234 insertions(+), 12 deletions(-) create mode 100644 site/public/docs/claude-code-chatgpt.html create mode 100644 site/public/docs/ja/claude-code-chatgpt.html create mode 100644 site/public/docs/ja/troubleshooting.html create mode 100644 site/public/docs/troubleshooting.html create mode 100644 site/public/docs/zh/claude-code-chatgpt.html create mode 100644 site/public/docs/zh/troubleshooting.html diff --git a/site/public/docs/claude-code-chatgpt.html b/site/public/docs/claude-code-chatgpt.html new file mode 100644 index 000000000..ff79732d1 --- /dev/null +++ b/site/public/docs/claude-code-chatgpt.html @@ -0,0 +1,308 @@ + + + + + +Use your ChatGPT Plus or Pro subscription in Claude Code · magpie + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+

Docs · Guide

+

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 providerIn magpie’s Providers tab, press + Add provider.
  2. +
  3. Click the ChatGPT tilemagpie opens OpenAI’s own sign-in page in your browser. The account shows up as soon as you finish.
  4. +
+

Or from a terminal:

+
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:

+
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:

+
+ + + + + +
TierVariable in envBy default
opusANTHROPIC_DEFAULT_OPUS_MODELThe GPT model you picked
sonnetANTHROPIC_DEFAULT_SONNET_MODELThe GPT model you picked
haikuANTHROPIC_DEFAULT_HAIKU_MODEL, ANTHROPIC_SMALL_FAST_MODELThe GPT model you picked
fableANTHROPIC_DEFAULT_FABLE_MODELLeft 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:

+
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.

+ +

Switch back

+

Pick one of Claude Code’s own models on its row, or run:

+
Terminal
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.

+
Terminal
magpie accounts add claude
+magpie codex claude/claude-opus-5-5
+

See Models in Codex and Subscriptions in any agent.

+ +

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. Something fails? See Fixing common errors, or ask on Discord.

+
+
+ + + + + + + diff --git a/site/public/docs/claude-code-models.html b/site/public/docs/claude-code-models.html index 6c912f5fa..d2414e9a8 100644 --- a/site/public/docs/claude-code-models.html +++ b/site/public/docs/claude-code-models.html @@ -240,7 +240,7 @@ magpie claude haiku "" # back to the main model<

Sign in to the subscription in magpie: + Add provider, then the ChatGPT or Copilot tile. magpie opens the vendor’s own sign-in page. The account’s models then show in Claude Code’s picker as codex/… or copilot/….

Terminal
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.

Routing over several keys

With several keys or accounts, magpie can spread Claude Code’s requests over them and move on when one runs out.

diff --git a/site/public/docs/ja/claude-code-chatgpt.html b/site/public/docs/ja/claude-code-chatgpt.html new file mode 100644 index 000000000..bc7e67554 --- /dev/null +++ b/site/public/docs/ja/claude-code-chatgpt.html @@ -0,0 +1,308 @@ + + + + + +ChatGPT Plus/Pro のサブスクを Claude Code で使う · magpie + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+

ドキュメント · ガイド

+

ChatGPT Plus/Pro のサブスクを Claude Code で使う

+

Claude Code は ChatGPT Plus・Pro プランの GPT モデルで動かせます。magpie で ChatGPT にサインインし、Claude Code に codex/… のモデルを選べば、あとはいつもどおり使えます。OpenAI の API キーは要りません。

+ +

Claude Code は Anthropic の Messages API で話します。magpie はお使いのコンピュータ上でゲートウェイ(127.0.0.1:3425)を動かし、Claude Code のリクエストを GPT モデル向けに、返答を Claude Code 向けに変換します。ストリーミングとツール呼び出しも含みます。magpie はゲートウェイのアドレスとキーを Claude Code の settings.json に書き込み、ChatGPT のサインインは magpie の中だけに置かれます。

+ +

ChatGPT にサインイン

+
    +
  1. プロバイダの追加を開くmagpie の プロバイダ タブで + プロバイダを追加 を押します。
  2. +
  3. ChatGPT のタイルをクリックブラウザで OpenAI 自身のサインインページが開きます。終わるとすぐにアカウントが表示されます。
  4. +
+

ターミナルからでも追加できます。

+
ターミナル
magpie accounts add codex      # ChatGPT アカウントにサインイン
+

このアカウントのモデルは codex/… です。

+ +

Claude Code に GPT モデルを選ぶ

+

エージェント タブで Claude Code の行のモデルをクリックし、codex/… のモデルを選びます。ターミナルからは:

+
ターミナル
magpie models                  # すべてのモデルを provider/model で表示
+magpie claude codex/gpt-5.5
+

Claude Code の中でも、/model に magpie のモデルが “via magpie” 付きで並ぶので、そこで切り替えられます。

+
一部のセッションだけ GPT にしたいとき。magpie で Claude Code を接続せず、必要なときに claude-magpie を実行します。同じ claude をそのセッションだけ magpie の設定で起動し、settings.json は書き換えません。
+ +

Opus・Sonnet・Haiku の対応

+

Claude Code はティアでモデルを求めます:opus、sonnet、haiku、fable。セッションのタイトルや Explore サブエージェントなどの小さな仕事は haiku ティアに行きます。メインモデルが GPT モデルのときは:

+
+ + + + + +
ティアenv の変数既定
opusANTHROPIC_DEFAULT_OPUS_MODEL選んだ GPT モデル
sonnetANTHROPIC_DEFAULT_SONNET_MODEL選んだ GPT モデル
haikuANTHROPIC_DEFAULT_HAIKU_MODEL、ANTHROPIC_SMALL_FAST_MODEL選んだ GPT モデル
fableANTHROPIC_DEFAULT_FABLE_MODEL設定しない
+

ティアに別のモデルを使うには(haiku を小さいモデルにするなど)、magpie の Claude Code の行で設定するか、ターミナルから:

+
ターミナル
magpie claude haiku codex/…    # 1 つのティアだけ別のモデルに
+magpie claude haiku ""         # メインモデルに戻す
+ +

推論レベル

+

Claude Code が thinking を有効にしたリクエストでは、Claude Code が求める推論レベルがそのまま GPT モデルの推論レベルになります。magpie は各モデルが持つ推論レベルも Claude Code に伝えます。

+

Claude Code の求めに関わらず固定したいときは、Claude Code の行で 推論レベル を設定します。opus の推論レベル などはティアごと、サブエージェントの推論レベル はサブエージェントの設定です。どれも既定は Claude Code が要求する推論レベル です。開いている Claude Code セッションは起動時の推論レベルのままなので、反映するには再起動してください。

+ +

上限と使用量

+

リクエストはあなたの ChatGPT アカウントで処理されるので、Codex 自身のリクエストと同じくプランの使用量上限に数えられます。

+
    +
  • 使用量を見る。Claude Code の行の ステータスライン をオンにすると、Claude Code の入力欄の下に、magpie が使うアカウントの 5 時間と 7 日の使用量を表示します。magpie accounts は各アカウントの使用済みの割合を表示します。履歴は 使用量 タブにあります。
  • +
  • アカウントを使い切ったとき。magpie はそのアカウントを、OpenAI の拒否が示すリセット時刻まで、示されなければ枠全体が更新されるまで、それも分からなければ 5 時間休ませ、その間のリクエストを次のアカウントかプロバイダの フォールバック に送ります。枠が更新されるとアカウントは自動で戻ります。
  • +
+ +

複数のアカウントとフェイルオーバー

+
    +
  • アカウントを増やす。ChatGPT のタイルをもう一度クリックするか、magpie accounts add codex をもう一度実行します。各アカウントはプロバイダの下に並びます。
  • +
  • リクエストを分散する。プロバイダの行を開き、使うアカウントにチェックを入れます。既定の スマート ルーティングは、クォータに余裕があり、最も早く更新されるアカウントに送ります。
  • +
  • 別のモデルに切り替える。プロバイダの フォールバック には、すべてのアカウントが切れたり、レート制限やエラーになったときに使うモデルを並べます。別のサブスクや API キーのモデルも選べます。
  • +
+

ルーティングの種類は はじめに にあります。

+ +

元に戻す

+

Claude Code の行で Claude Code 自身のモデルを選ぶか、次を実行します。

+
ターミナル
magpie claude default
+

magpie による接続を外し、元の設定に戻します。Claude Code の行の 切断 も同じです。

+
claude.ai のサインイン。magpie のモデルを使うとき、Claude Code の サインイン の既定は magpie のキー です。claude.ai からはサインアウトされ、/usage のプラン上限、コネクタ、音声、/teleport は使えません。残したいときは claude.ai にします。
+ +

逆の使い方:Codex で Claude

+

Claude Pro や Max のサブスクも同じように Codex で使えます。magpie で Claude にサインインし、Codex に claude/… のモデルを選びます。Claude サブスクのリクエストはコンピュータにインストールされた Claude Code を通るので、アンインストールしないでください。

+
ターミナル
magpie accounts add claude
+magpie codex claude/claude-opus-5-5
+

Codex で他のモデルとサブスクを任意のエージェントでも参照してください。

+ +

よくある質問

+

ChatGPT Plus や Pro のサブスクを Claude Code で使えますか?

+

使えます。magpie で ChatGPT にサインインし、Claude Code の行で codex/… のモデルを選ぶか、magpie claude codex/gpt-5.5 を実行します。magpie が Claude Code のリクエストを GPT モデル向けに、返答を元の形に変換します。ツール呼び出しも含みます。

+

OpenAI の API キーは必要ですか?

+

不要です。magpie は OpenAI 自身のページでサインインし、Claude Code にはゲートウェイのキーが渡されます。サインインは magpie の中だけに置かれます。

+

ChatGPT プランの上限は消費されますか?

+

はい。リクエストはあなたの ChatGPT アカウントで処理され、その使用量上限に数えられます。magpie のステータスラインは、Claude Code の入力欄の下に各アカウントの 5 時間と 7 日の使用量を表示します。

+

Claude Code の Haiku のリクエストはどのモデルを使いますか?

+

選んだ GPT モデルです。magpie claude haiku <model> で haiku ティアに別のモデルを設定することもできます。

+

Claude 自身のモデルに戻すには?

+

magpie claude default を実行するか、magpie の Claude Code の行で Claude Code 自身のモデルを選びます。

+

リクエストは magpie のサーバーを通りますか?

+

通りません。ゲートウェイはお使いのコンピュータ上で動き、リクエストはそこから OpenAI に直接送られます。間に magpie のサーバーはありません。

+ +

API キーを使う場合は Claude Code で他のモデルを参照してください。エラーが出るときは よくあるエラーの直し方、または Discord で質問してください。

+
+
+ + + + + + + diff --git a/site/public/docs/ja/claude-code-models.html b/site/public/docs/ja/claude-code-models.html index 8110b69a3..afb8a79c8 100644 --- a/site/public/docs/ja/claude-code-models.html +++ b/site/public/docs/ja/claude-code-models.html @@ -240,7 +240,7 @@ magpie claude haiku "" # メインのモデルに戻

magpie でサブスクリプションにサインインします:+ Add provider から ChatGPT または Copilot のタイルを選ぶと、magpie がベンダー自身のサインインページを開きます。するとそのアカウントのモデルが、Claude Code のピッカーに codex/… または copilot/… として表示されます。

ターミナル
magpie accounts add codex      # ChatGPT アカウントにサインイン
 magpie claude codex/gpt-5.5
-

Claude Code が話すのはあくまで Anthropic Messages です。magpie が各リクエストを GPT モデル向けに変換し、応答を戻します。ツール呼び出しも含みます。Antigravity アカウントも同じように antigravity/… として使えます。

+

Claude Code が話すのはあくまで Anthropic Messages です。magpie が各リクエストを GPT モデル向けに変換し、応答を戻します。ツール呼び出しも含みます。Antigravity アカウントも同じように antigravity/… として使えます。ティア、推論レベル、上限を含む ChatGPT プランの使い方は Claude Code で ChatGPT にあります。

複数のキーでルーティング

キーやアカウントが複数あれば、magpie は Claude Code のリクエストをそれらに分散し、1 つが使い切られたら次へ移れます。

diff --git a/site/public/docs/ja/start.html b/site/public/docs/ja/start.html index 184b662bf..257e28e30 100644 --- a/site/public/docs/ja/start.html +++ b/site/public/docs/ja/start.html @@ -362,7 +362,7 @@ IP-CIDR6,::1/128,DIRECT,no-resolve

モデル id は magpie のもの(magpie models)です。共有をオンにすると、同じネットワークのほかのコンピューターもゲートウェイキーで接続できます。リモート magpie を参照してください。

-

困ったときや、共有したい構成があるときは Discord でどうぞ。ユーザーにすぐ使えるプロバイダを配りたいベンダーの方は magpie に追加 をご覧ください。

+

ゲートウェイのエラーは よくあるエラーの直し方 を参照してください。困ったときや、共有したい構成があるときは Discord でどうぞ。ユーザーにすぐ使えるプロバイダを配りたいベンダーの方は magpie に追加 をご覧ください。

diff --git a/site/public/docs/ja/subscriptions.html b/site/public/docs/ja/subscriptions.html index 207b03aa4..96c487ef5 100644 --- a/site/public/docs/ja/subscriptions.html +++ b/site/public/docs/ja/subscriptions.html @@ -236,7 +236,7 @@

よくある質問

ChatGPT Plus や Pro のサブスクリプションを Claude Code で使えますか?

-

はい。magpie で ChatGPT にサインインし、Claude Code の行で codex/… のモデルを選ぶか、magpie claude codex/gpt-5.5 を実行します。magpie が Claude Code の Anthropic リクエストを GPT モデル向けに変換し、応答を戻します。ツール呼び出しも含みます。

+

はい。magpie で ChatGPT にサインインし、Claude Code の行で codex/… のモデルを選ぶか、magpie claude codex/gpt-5.5 を実行します。magpie が Claude Code の Anthropic リクエストを GPT モデル向けに変換し、応答を戻します。ツール呼び出しも含みます。ティアや推論レベルを含む設定の全体は Claude Code で ChatGPT にあります。

Claude Pro や Max のサブスクリプションを Codex や OpenCode で使えますか?

はい。magpie で Claude にサインインし、エージェントの行で claude/… のモデルを選びます。Claude サブスクリプションでのリクエストは、コンピューターにインストールされた Claude Code を通じて送られるので、Claude Code はインストールしたままにしてください。

GitHub Copilot のモデルを VS Code の外で使えますか?

diff --git a/site/public/docs/ja/troubleshooting.html b/site/public/docs/ja/troubleshooting.html new file mode 100644 index 000000000..0702706fb --- /dev/null +++ b/site/public/docs/ja/troubleshooting.html @@ -0,0 +1,342 @@ + + + + + +よくあるエラーの直し方:401・429・502・504 など · magpie + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+

ドキュメント · ヘルプ

+

よくあるエラーの直し方:401・429・502・504 など

+

magpie のゲートウェイのエラーは、何が起きたかを自分の言葉で伝えます。このページでは、よくあるエラーとその原因、直し方をまとめます。

+ +

すべてのリクエストは magpie の ルーティング ページに並び、どのプロバイダとアカウントに送られ、各試行がどう終わったかが分かります。リクエストの レポートをコピー で、質問に必要な情報をコピーできます。

+ +

401 と 403:キーやサインインが拒否された

+

ベンダーから。プロバイダが magpie の送ったキーやサインインを拒否しました。magpie はそのキーやアカウントを休ませて次を試すので、エラーが見えるのは残りがないときだけです。サインインの期限切れはそう書かれます(例:“the ChatGPT sign-in has expired — sign in again”)。

+
  • 直し方:+ プロバイダを追加(または magpie accounts add <provider>)からサインインし直すか、プロバイダに新しいキーを設定します。
+

magpie 自身から。次の場合、magpie は何も送らずに 403 を返します。

+
+ + + + +
エラー原因直し方
model disabledmagpie でそのモデルをオフにしています。プロバイダでオンに戻します。
model not allowed for the gateway keyゲートウェイキーが一部のモデルに限られています。magpie gateway-key models <id> で確認・変更します。
magpie doesn’t answer the web page …Web ページがブラウザからゲートウェイを呼びました。設定 › ネットワークと共有 › Web ページ に追加し、ゲートウェイキーを送ります。
+ +

429 と休止

+

429 はクォータ切れ、残高不足、レート制限のいずれかです。magpie は拒否されたキーやアカウントを休ませ、リクエストを次のアカウント、ルーティンググループの次のメンバー、またはプロバイダの フォールバック に送ります。プロバイダの行には 休止中 · {why} · {time} に復帰 と表示されます。

+
+ + + + + + +
拒否の理由休止の長さ
クォータ切れ(リセット時刻あり)リセットまで
レート制限(Retry-After あり)その時刻まで
残高不足30 分。再び拒否されると 2 時間、8 時間、1 日、3 日、1 週間
ChatGPT アカウントのクレジット切れ拒否が示すリセットまで。なければ枠全体の更新まで。それも分からなければ 5 時間
その他の失敗1 分。繰り返すと倍になり最大 10 分(レート制限は 30 分)
+
    +
  • 今すぐもう一度。今すぐ試す は休止を終えます。次のリクエストで再び使われ、再度拒否されれば通常どおり休止します。
  • +
  • 休止の上限。magpie provider rest-cap <id> 4h でプロバイダの最長休止を設定します。off にすると、理由の分からない失敗では休止しません。
  • +
  • 上限がすぐ戻る中継サービス。プロバイダ編集の 詳細設定 で クォータ切れやレート制限で一時的に外す のチェックを外すと、429 で休止せず、次のリクエストもいつもどおり送られます。
  • +
  • 1 つに頼らない。アカウントやフォールバックのモデルをもう 1 つ追加すれば、1 つが切れてもエージェントは止まりません。magpie accounts で各アカウントの使用量が分かります。
  • +
+

休止は再起動後も保たれるので、magpie を終了しても休止中のアカウントは早く戻りません。

+ +

502:プロバイダが応答しない

+

502 は、magpie がプロバイダから API の返答を得られなかったことを示します。プロバイダ名に続く文で、どの場合かが分かります。

+
    +
  • “didn’t answer: …”接続に失敗しました:名前が解決できない、接続が拒否された、プロキシが止まっている、など。コンピュータがまったくネットワークにつながっていないときは、magpie がそれに気づき、どのプロバイダも休ませません。
  • +
  • “… not an API reply”プロバイダは応答しましたが、Web ページ(サインインページ、Cloudflare のチャレンジ)、空の本文、JSON でない内容でした。たいていはベース URL が API ではなく Web サイトを指しています。ベンダーのドキュメントと照らし合わせ、/v1 で終わるべきかも確認してください。
  • +
  • OpenCode:“… which is no error, not an API reply”。OpenCode のゲートウェイは、モデル名だけを含む 400 を返すことがあります。同じリクエストは数秒後に通るので、magpie はこれを 502 とみなし、リクエストの待ち時間内に再試行するか、グループの次のメンバーを試します。誰も休ませません。非常に大きなツール一覧を含むリクエストで起きます。
  • +
+

502、503、504、529、Cloudflare の 520〜524 は「混雑」として扱われ、エージェントに返す前に再試行するか、ルーティンググループの次のメンバーに移ります。

+ +

504:時間内に応答がない

+
    +
  • “<provider>: no first token in Ns”。ルーティンググループは各メンバーに応答開始までの時間(最初のトークン)を与えます。それを過ぎたので次のメンバーに移りました。遅いモデルにはグループで長くします。
  • +
  • “no member of the group answered within its Ns budget”。グループの時間内に全メンバーを試し、どれも応答しませんでした。
  • +
  • “magpie held this request for … without routing it to any provider”。リクエストが magpie の中で待ちすぎたため、待たせ続けずに止めました。送り直してください。繰り返すときは、ルーティング ページでそのリクエストの レポートをコピー して共有してください。
  • +
+ +

モデルが見つからない(404)

+

エラーは magpie knows no model “…” で、did you mean …? とプロバイダ id の一覧が付くことがあります。

+
    +
  • magpie の名前で指定する。magpie models が表示する provider/model、ルーティンググループの id か名前、またはプレフィックスなしのモデル id を使います。
  • +
  • “… is switched off in Magpie, so … is not served”。プロバイダかルーティンググループがオフです。プロバイダページかルーティングページでオンに戻します。
  • +
  • プロバイダがまだない。エラーに “add a provider in magpie first” と出ます。
  • +
+ +

エージェントにモデルが出ない

+
    +
  • エージェントを再起動する。多くのエージェントは起動時にだけ設定を読みます。変更後、magpie はエージェントの行でそう知らせます(例:Codex は起動時にモデル一覧を作る)。Codex アプリは app-server も動かし続けるので、案内どおりに再起動してください。
  • +
  • magpie が提供しているか確認する。magpie models に選べるモデルがすべて並びます。オフにしたモデルや、プロバイダがオフのモデルは出ません。
  • +
  • Claude Code。/model に “via magpie” 付きでモデルが並びます。シェルで CLAUDE_CODE_USE_BEDROCK や CLAUDE_CODE_USE_VERTEX が設定されていると、Claude Code は magpie ではなくそのクラウドに接続します。シェルのプロファイルから外してください。
  • +
+ +

ポート 3425 が使用中

+

ゲートウェイは 127.0.0.1:3425 で待ち受けます。変えるには 設定 › ネットワークと共有 › ゲートウェイのアドレス を開きます。設定できるのはポート(1024〜65535)だけで、magpie が接続したエージェントも一緒に移ります。

+
+ + + + + +
magpie の表示直し方
ポート … は他のプログラムが使用中です。別のポートを選んでください空いているポートを選びます。
別の magpie が … でゲートウェイを提供しています。そちらでポートを設定するか、先に終了してくださいmagpie が 2 つ動いています。1 つを終了します。
ポート … は別のプログラム(magpie web かもしれません)が使用中です:magpie が数秒ごとに再試行しますポートを使っているものを探すか、ゲートウェイを別のポートに移します。
MAGPIE_ADDR=… がゲートウェイのアドレス全体を設定していますMAGPIE_ADDR を外すか変更します。
+ +

WSL のエージェント

+

Windows では、magpie は実行中の WSL ディストリビューションから Claude Code、Codex、OpenCode、Kimi Code、Qwen Code などのエージェントを探します。見つかったものはそれぞれエージェントページに自分の行を持ち、Windows と同じように設定されます。停止中のディストリビューションを起動することはありません。

+
    +
  • エージェントが出ない。ディストリビューションを起動し、設定 › 一般 › WSL のエージェントを検出 がオンか確認します。
  • +
  • magpie に届かない。WSL 既定の NAT ネットワークでは、magpie は WSL ネットワーク上の Windows のアドレスでも専用のキーでゲートウェイを提供し、そのアドレスをエージェントの設定に書き込みます。ミラーモードでは、エージェントは Windows と同じく 127.0.0.1 を使います。通すかどうかは Windows ファイアウォールが決め、WSL のネットワークは「パブリック」扱いです。接続が遮断されるときはそこで magpie を許可してください。
  • +
  • 変更が反映されない。WSL のエージェントは起動時に設定を読みます。WSL 側で再起動してください。
  • +
+ +

ネットワーク上の別のコンピュータから

+

既定では、ゲートウェイはこのコンピュータにだけ応答します。別のコンピュータから使うには 設定 › ネットワークと共有 › ローカルネットワークで共有 をオンにします。相手のコンピュータは ゲートウェイ ページの ゲートウェイキー のキーを送ります。

+
    +
  • “magpie isn’t shared on the local network”。magpie を動かしているコンピュータで共有をオンにします。
  • +
  • 401。キーがない、オフ、または期限切れです。有効なゲートウェイキーを Authorization: Bearer <key> か x-api-key で送ります。
  • +
  • 特定のモデルで 403。キーが一部のモデルに限られています:magpie gateway-key models <id>。
  • +
+

ポートをインターネットに公開しないでください。コンピュータ間は VPN を使います。別の magpie への接続を含む設定の全体は リモート magpie にあります。

+ +

プラグインに移ったサブスクが使えない

+

Command Code、Cursor、Devin、Factory、Grok、Kiro、Xiaomi MiMo、Qoder、WorkBuddy、ZCode、Zed は magpie に組み込まれなくなり、それぞれ同じ働きをするコミュニティプラグインが提供します。以前に追加したアカウントはプラグインへの移行が必要で、移行するまで使えません。

+
  • 直し方:プロバイダ一覧の上に「… の組み込みサブスクリプションは終了しました。アカウントはまだプラグインに移行されていません」と出ます。プラグインに移行 を押すと、magpie がプラグインをインストールし、各アカウントを確認します。移行してもアカウント、モデル、エージェントはそのままです。magpie は自動でも移行し、プラグイン ページからプラグインをインストールしても移行されます。
+

移行後のエラーはプラグインから来ています。サインイン、モデル、リクエストはプラグインが処理します。

+ +

よくある質問

+

プロバイダは動いているのに、なぜ 502 になるのですか?

+

プロバイダが Web ページや空の本文など、API の返答でないものを返しました。たいていはベース URL が API ではなくベンダーの Web サイトを指しています。

+

429 のあと、なぜアカウントが使われないままなのですか?

+

magpie はベンダーが示したリセットまで、示されなければしばらくの間そのアカウントを休ませます。プロバイダの行に復帰時刻が出ており、「今すぐ試す」で休止を終えられます。

+

“magpie knows no model” とはどういう意味ですか?

+

その名前のモデルを提供するプロバイダがありません。magpie models が表示する provider/model で指定するか、プロバイダをオンに戻します。

+

magpie のポートを変えるには?

+

設定 › ネットワークと共有 › ゲートウェイのアドレス です。magpie が接続したエージェントも一緒に移ります。

+

WSL のエージェントから Windows の magpie を使えますか?

+

使えます。magpie は実行中の WSL ディストリビューションのエージェントを見つけ、届くアドレスで設定します。NAT ネットワークでは、Windows ファイアウォールが WSL からの接続を通す必要があります。

+

別のコンピュータから magpie を使えますか?

+

使えます。設定 › ネットワークと共有 › ローカルネットワークで共有 をオンにし、相手のコンピュータからゲートウェイキーを送ります。ポートはインターネットに公開しないでください。

+ +

解決しないときは、ルーティングページでそのリクエストのレポートをコピーして Discord で質問してください。

+
+
+ + + + + + + diff --git a/site/public/docs/start.html b/site/public/docs/start.html index 362e2d81a..a42be044d 100644 --- a/site/public/docs/start.html +++ b/site/public/docs/start.html @@ -362,7 +362,7 @@ IP-CIDR6,::1/128,DIRECT,no-resolve

The model id is magpie’s (magpie models). Sharing lets other computers on your network in with a gateway key; see Remote magpie.

-

Stuck, or have a setup worth sharing? Ask on Discord. Vendors who want to hand their users a ready-made provider: see Add to magpie.

+

An error from the gateway? See Fixing common errors. Stuck, or have a setup worth sharing? Ask on Discord. Vendors who want to hand their users a ready-made provider: see Add to magpie.

diff --git a/site/public/docs/subscriptions.html b/site/public/docs/subscriptions.html index 76bc941c9..2f3e2926a 100644 --- a/site/public/docs/subscriptions.html +++ b/site/public/docs/subscriptions.html @@ -236,7 +236,7 @@

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 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.

Can I use my Claude Pro or Max subscription in Codex or OpenCode?

Yes. Sign in to Claude in magpie and pick a claude/… model on the agent’s row. Requests on a Claude subscription run through the Claude Code installed on your computer, so keep it installed.

Can I use GitHub Copilot models outside VS Code?

diff --git a/site/public/docs/troubleshooting.html b/site/public/docs/troubleshooting.html new file mode 100644 index 000000000..c2864702e --- /dev/null +++ b/site/public/docs/troubleshooting.html @@ -0,0 +1,342 @@ + + + + + +Fixing common errors: 401, 429, 502, 504 and more · magpie + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+

Docs · Help

+

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

+

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

+ +

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

+ +

401 and 403: a key or sign-in refused

+

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

+
  • 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:

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

429 and rest periods

+

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

+
+ + + + + + +
Refused forRests
Quota, with a reset timeUntil the reset
Rate limit, with Retry-AfterUntil then
Credit30 minutes, then 2 hours, 8 hours, a day, 3 days and a week if it is refused again
A ChatGPT account out of creditsUntil the reset its refusal names, else until its full window renews, else 5 hours
Any other failureA minute, doubling on repeats up to 10 minutes (30 for a rate limit)
+
    +
  • 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 saysFix
Port … is in use by another program: pick another onePick a free port.
Another magpie serves the gateway at …: set its port there, or quit it firstTwo copies of magpie are running. Quit one.
Port … is taken by another program, magpie web perhaps: magpie tries again every few secondsFind what holds the port, or move the gateway to another.
MAGPIE_ADDR=… sets the gateway’s whole address, host:port: unset it to set the port hereUnset MAGPIE_ADDR, or change it.
+ +

Agents in WSL

+

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

+
    +
  • 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.

+ +

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.

+
+
+ + + + + + + diff --git a/site/public/docs/zh/claude-code-chatgpt.html b/site/public/docs/zh/claude-code-chatgpt.html new file mode 100644 index 000000000..78d6c6704 --- /dev/null +++ b/site/public/docs/zh/claude-code-chatgpt.html @@ -0,0 +1,308 @@ + + + + + +在 Claude Code 中使用 ChatGPT Plus/Pro 订阅 · magpie + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+

文档 · 指南

+

在 Claude Code 中使用 ChatGPT Plus/Pro 订阅

+

Claude Code 可以跑在你 ChatGPT Plus 或 Pro 套餐的 GPT 模型上。在 magpie 里登录 ChatGPT,给 Claude Code 选一个 codex/… 模型,照常使用即可。不需要 OpenAI API Key。

+ +

Claude Code 说的是 Anthropic 的 Messages API。magpie 在你电脑上运行一个网关,地址 127.0.0.1:3425,把 Claude Code 的每个请求翻译给 GPT 模型,再把回复翻译回来,流式输出和工具调用都包括在内。magpie 把网关的地址和密钥写进 Claude Code 的 settings.json,你的 ChatGPT 登录只保存在 magpie 里。

+ +

登录 ChatGPT

+
    +
  1. 打开添加供应商在 magpie 的 供应商 页,点 + 添加供应商。
  2. +
  3. 点 ChatGPT 卡片magpie 会在浏览器里打开 OpenAI 自己的登录页,登录完成后账号马上出现。
  4. +
+

也可以在终端里:

+
终端
magpie accounts add codex      # 登录一个 ChatGPT 账号
+

这个账号的模型 id 是 codex/…。

+ +

给 Claude Code 选 GPT 模型

+

在 Agent 页,点 Claude Code 那一行的模型,选一个 codex/… 模型。终端里:

+
终端
magpie models                  # 列出所有模型,格式 provider/model
+magpie claude codex/gpt-5.5
+

在 Claude Code 里,/model 也会列出 magpie 的模型,标着 “via magpie”,可以直接在那里切换。

+
只想部分会话用 GPT?不在 magpie 里接入 Claude Code,需要时运行 claude-magpie。它用 magpie 的设置启动同一个 claude,只对这次会话生效,不改写 settings.json。
+ +

Opus、Sonnet、Haiku 怎么对应

+

Claude Code 按分档请求模型:opus、sonnet、haiku 和 fable。它自己的小任务,比如会话标题和 Explore 子代理,走 haiku 档。主模型是 GPT 模型时:

+
+ + + + + +
分档env 里的变量默认
opusANTHROPIC_DEFAULT_OPUS_MODEL你选的 GPT 模型
sonnetANTHROPIC_DEFAULT_SONNET_MODEL你选的 GPT 模型
haikuANTHROPIC_DEFAULT_HAIKU_MODEL、ANTHROPIC_SMALL_FAST_MODEL你选的 GPT 模型
fableANTHROPIC_DEFAULT_FABLE_MODEL不设置
+

想让某一档用单独的模型,比如 haiku 用小一点的,在 magpie 里 Claude Code 那一行设置,或者在终端里:

+
终端
magpie claude haiku codex/…    # 某一档单独用一个模型
+magpie claude haiku ""         # 回到主模型
+ +

推理强度

+

Claude Code 开启 thinking 的请求里,它要的推理强度会作为 GPT 模型的推理强度发过去。magpie 也会告诉 Claude Code 每个模型支持哪些档位。

+

想不管 Claude Code 要什么都固定一个强度,在 Claude Code 那一行设置 推理强度。opus 推理强度 等按分档设置,子代理推理强度 管子代理。默认都是 跟随 Claude Code 请求的推理强度。已打开的 Claude Code 会话仍用启动时的推理强度,重开后生效。

+ +

额度与用量

+

请求用的是你的 ChatGPT 账号,所以和 Codex 自己的请求一样,计入套餐的用量限制。

+
    +
  • 看用了多少。打开 Claude Code 那一行的 状态栏:Claude Code 输入框下方会显示 magpie 所用账号的 5 小时和 7 天用量。magpie accounts 列出每个账号用掉了多少额度。用量 页有历史记录。
  • +
  • 账号用完时。magpie 会暂停这个账号,直到 OpenAI 拒绝时给出的重置时间;没有给出时等它的整个窗口刷新;都不知道时暂停 5 小时。期间请求转给你的下一个账号,或供应商的 备用。窗口刷新后账号自动回来。
  • +
+ +

多账号与自动切换

+
    +
  • 再加一个账号。再点一次 ChatGPT 卡片,或再运行一次 magpie accounts add codex。每个账号都列在这个供应商下面。
  • +
  • 在账号间分配请求。打开供应商那一行,勾上要用的账号。默认的 智能 路由会把请求发给还有额度、且额度最早刷新的账号。
  • +
  • 用完时换模型。供应商的 备用 列出所有账号用完、被限流或出错时要用的模型,可以是另一个订阅或 API Key 的模型。
  • +
+

各种路由方式见 快速上手。

+ +

切回去

+

在 Claude Code 那一行选回 Claude Code 自己的模型,或者运行:

+
终端
magpie claude default
+

这会撤掉 magpie 对 Claude Code 的接入,恢复原来的配置。Claude Code 那一行的 断开 效果相同。

+
你的 claude.ai 登录。用 magpie 的模型时,Claude Code 的 登录方式 默认是 magpie 的密钥:Claude Code 会退出 claude.ai,/usage 的套餐额度、connectors、语音和 /teleport 都不可用。设为 claude.ai 可以保留它们。
+ +

反过来:在 Codex 里用 Claude

+

Claude Pro 或 Max 订阅也能这样用在 Codex 里。在 magpie 里登录 Claude,给 Codex 选一个 claude/… 模型。Claude 订阅的请求经由你电脑上安装的 Claude Code 发出,所以请保留它。

+
终端
magpie accounts add claude
+magpie codex claude/claude-opus-5-5
+

见 Codex 接入其他模型 和 订阅用于任意 Agent。

+ +

常见问题

+

能在 Claude Code 里用 ChatGPT Plus 或 Pro 订阅吗?

+

可以。在 magpie 里登录 ChatGPT,在 Claude Code 那一行选一个 codex/… 模型,或运行 magpie claude codex/gpt-5.5。magpie 把 Claude Code 的请求翻译给 GPT 模型,再把回复翻译回来,工具调用也包括在内。

+

需要 OpenAI API Key 吗?

+

不需要。magpie 在 OpenAI 自己的页面登录,Claude Code 拿到的是网关的密钥。你的登录只保存在 magpie 里。

+

会占用 ChatGPT 套餐的额度吗?

+

会。请求用的是你的 ChatGPT 账号,计入它的用量限制。magpie 的状态栏会在 Claude Code 输入框下方显示每个账号的 5 小时和 7 天用量。

+

Claude Code 的 Haiku 请求用哪个模型?

+

默认用你选的 GPT 模型,除非你用 magpie claude haiku <model> 给 haiku 档单独设一个。

+

怎么切回 Claude 自己的模型?

+

运行 magpie claude default,或在 magpie 里 Claude Code 那一行选回 Claude Code 自己的模型。

+

请求会经过 magpie 的服务器吗?

+

不会。网关运行在你自己的电脑上,请求从这里直接发给 OpenAI,中间没有 magpie 的服务器。

+ +

用的是 API Key?见 Claude Code 接入其他模型。遇到报错?见 常见错误排查,或到 Discord 提问。

+
+
+ + + + + + + diff --git a/site/public/docs/zh/claude-code-models.html b/site/public/docs/zh/claude-code-models.html index 4854ee795..f8a3023ef 100644 --- a/site/public/docs/zh/claude-code-models.html +++ b/site/public/docs/zh/claude-code-models.html @@ -240,7 +240,7 @@ magpie claude haiku "" # 回到跟随主模型在 magpie 里登录订阅:+ 添加供应商,选 ChatGPT 或 Copilot。magpie 会打开官方的登录页。登录后,账号里的模型以 codex/… 或 copilot/… 出现在 Claude Code 的模型列表里。

终端
magpie accounts add codex      # 登录一个 ChatGPT 账号
 magpie claude codex/gpt-5.5
-

Claude Code 说的还是 Anthropic Messages,magpie 把每个请求转成 GPT 模型能懂的格式,再把回复转回来,工具调用也包括在内。Antigravity 账号同理,模型是 antigravity/…。

+

Claude Code 说的还是 Anthropic Messages,magpie 把每个请求转成 GPT 模型能懂的格式,再把回复转回来,工具调用也包括在内。Antigravity 账号同理,模型是 antigravity/…。ChatGPT 套餐的完整用法,包括分档、推理强度和额度,见 Claude Code 用 ChatGPT。

多个 Key 轮换

有多个 Key 或账号时,magpie 可以把 Claude Code 的请求分摊到它们上面,一个用完自动换下一个。

diff --git a/site/public/docs/zh/start.html b/site/public/docs/zh/start.html index 2438f2a09..21af705f2 100644 --- a/site/public/docs/zh/start.html +++ b/site/public/docs/zh/start.html @@ -362,7 +362,7 @@ IP-CIDR6,::1/128,DIRECT,no-resolve

模型 id 用 magpie 的(magpie models)。打开共享后,局域网里的其他电脑凭网关密钥也能连入;见 远程 magpie。

-

遇到问题,或者有值得分享的配置?来 Discord 聊。想给自己的用户一键添加供应商的厂商,请看 Add to magpie。

+

网关报错?见 常见错误排查。遇到问题,或者有值得分享的配置?来 Discord 聊。想给自己的用户一键添加供应商的厂商,请看 Add to magpie。

diff --git a/site/public/docs/zh/subscriptions.html b/site/public/docs/zh/subscriptions.html index ac9b4d22d..2a12a5d29 100644 --- a/site/public/docs/zh/subscriptions.html +++ b/site/public/docs/zh/subscriptions.html @@ -236,7 +236,7 @@

常见问题

Claude Code 能用 ChatGPT Plus 或 Pro 订阅吗?

-

能。在 magpie 里登录 ChatGPT,在 Claude Code 那一行选一个 codex/… 模型,或者运行 magpie claude codex/gpt-5.5。magpie 把 Claude Code 的 Anthropic 请求转成 GPT 模型的格式,再把回复转回来,工具调用也包括在内。

+

能。在 magpie 里登录 ChatGPT,在 Claude Code 那一行选一个 codex/… 模型,或者运行 magpie claude codex/gpt-5.5。magpie 把 Claude Code 的 Anthropic 请求转成 GPT 模型的格式,再把回复转回来,工具调用也包括在内。分档、推理强度等完整设置见 Claude Code 用 ChatGPT。

Codex 或 OpenCode 能用 Claude Pro 或 Max 订阅吗?

能。在 magpie 里登录 Claude,在这个 Agent 那一行选一个 claude/… 模型。Claude 订阅的请求通过你电脑上安装的 Claude Code 发出,所以要保留 Claude Code。

GitHub Copilot 的模型能在 VS Code 以外用吗?

diff --git a/site/public/docs/zh/troubleshooting.html b/site/public/docs/zh/troubleshooting.html new file mode 100644 index 000000000..b9e6da5e2 --- /dev/null +++ b/site/public/docs/zh/troubleshooting.html @@ -0,0 +1,342 @@ + + + + + +常见错误排查:401、429、502、504 等 · magpie + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+

文档 · 帮助

+

常见错误排查:401、429、502、504 等

+

magpie 网关的报错会说明出了什么问题。这一页列出常见的报错、原因和解决办法。

+ +

每个请求都列在 magpie 的 路由 页上:发给了哪个供应商、哪个账号,每次尝试的结果。在请求上点 复制报告,就能拿到求助需要的信息。

+ +

401 和 403:密钥或登录被拒

+

来自厂商。供应商拒绝了 magpie 发送的密钥或登录。magpie 会暂停这个密钥或账号,改用下一个,所以只有全都不行时你才会看到报错。登录过期时报错会直接说明,比如 “the ChatGPT sign-in has expired — sign in again”。

+
  • 解决:在 + 添加供应商 里重新登录(或 magpie accounts add <provider>),或者给供应商换一个新密钥。
+

来自 magpie 自己。以下情况 magpie 会直接回 403,什么都不发出去:

+
+ + + + +
报错原因解决
model disabled你在 magpie 里关掉了这个模型。在它的供应商里重新打开。
model not allowed for the gateway key这个网关密钥限定了可用的模型。用 magpie gateway-key models <id> 查看或修改。
magpie doesn’t answer the web page …有网页在浏览器里调用网关。把它加到 设置 › 网络与共享 › 网页,并发送网关密钥。
+ +

429 与暂停使用

+

429 表示供应商额度用完、余额不足或在限流。magpie 会暂停被拒的密钥或账号,把请求交给下一个账号、路由组里的下一个成员,或供应商的 备用。供应商那一行会显示 暂停使用 · {why} · {time} 恢复。

+
+ + + + + + +
被拒原因暂停多久
额度用完,给出了重置时间到重置为止
限流,带 Retry-After到那时为止
余额不足30 分钟;再被拒依次为 2 小时、8 小时、1 天、3 天、1 周
ChatGPT 账号额度用完到拒绝时给出的重置时间;没有就等整个窗口刷新;都不知道就 5 小时
其他失败1 分钟,重复时翻倍,最多 10 分钟(限流最多 30 分钟)
+
    +
  • 现在就再试。立即重试 会结束暂停:下一个请求会再次使用它。再被拒绝时,会照常再次暂停。
  • +
  • 限制暂停时长。magpie provider rest-cap <id> 4h 设置一个供应商最长暂停多久;off 让它在原因不明的失败后不暂停。
  • +
  • 限额很快恢复的中转站。在供应商编辑器的 高级 里取消勾选 额度用完或被限流时暂停它:之后 429 不再暂停它,下一个请求照常发给它。
  • +
  • 不要只靠一个。再加一个账号或备用模型,一个用完不会让 Agent 停下来。magpie accounts 显示每个账号用掉了多少额度。
  • +
+

暂停状态在重启后保留,退出 magpie 不会让暂停中的账号提前回来。

+ +

502:供应商没有正常回应

+

502 表示 magpie 没从供应商拿到 API 回复。供应商名称后面的内容说明是哪种情况:

+
    +
  • “didn’t answer: …”连接失败:域名解析不了、连接被拒、代理没开。这台电脑完全没有网络时,magpie 能识别出来,不会暂停任何供应商。
  • +
  • “… not an API reply”供应商回应了,但回的是网页(登录页、Cloudflare 验证页)、空内容,或不是 JSON 的内容。通常是 Base URL 指向了网站而不是 API:对照厂商文档检查,看看是否需要以 /v1 结尾。
  • +
  • OpenCode:“… which is no error, not an API reply”。OpenCode 的网关有时会回一个只含模型名的 400。同样的请求几秒后就能成功,所以 magpie 把它当作 502:在请求的等待时间内重试,或换路由组的下一个成员,不暂停任何账号。它和携带特别多工具定义的请求有关。
  • +
+

502、503、504、529 和 Cloudflare 的 520 到 524 都算作“忙”:magpie 会先重试或换路由组的下一个成员,然后才把错误交给 Agent。

+ +

504:没有及时回应

+
    +
  • “<provider>: no first token in Ns”。路由组给每个成员一个开始回复的时限(首字耗时)。这个成员超时了,于是换了下一个。慢模型可以在组里调大它。
  • +
  • “no member of the group answered within its Ns budget”。在组的时限内试过了每个成员,都没有回应。
  • +
  • “magpie held this request for … without routing it to any provider”。请求在 magpie 内部等待过久,被停下而不是一直挂着。重新发送;如果还出现,在 路由 页这个请求上点 复制报告,发出来。
  • +
+ +

找不到模型(404)

+

报错是 magpie knows no model “…”,常带有 did you mean …? 和你的供应商 id 列表。

+
    +
  • 按 magpie 的方式命名。用 provider/model(和 magpie models 列出的一样)、路由组的 id 或名称,或者不带前缀的模型 id。
  • +
  • “… is switched off in Magpie, so … is not served”。供应商或路由组被关掉了。在供应商页或路由页重新打开。
  • +
  • 还没有供应商。报错会说 “add a provider in magpie first”。
  • +
+ +

Agent 里看不到模型

+
    +
  • 重启 Agent。大多数 Agent 只在启动时读取配置。改动后 magpie 会在 Agent 那一行提示,比如 Codex 启动时生成模型列表。Codex 应用还有一个常驻的 app-server,按提示重启它。
  • +
  • 确认 magpie 提供这个模型。magpie models 列出所有可选模型。你关掉的模型,或所在供应商被关掉的模型,不会列出。
  • +
  • Claude Code。/model 会列出标着 “via magpie” 的模型。如果 shell 里设置了 CLAUDE_CODE_USE_BEDROCK 或 CLAUDE_CODE_USE_VERTEX,Claude Code 会连到那个云而不是 magpie;把它从 shell 配置文件里去掉。
  • +
+ +

3425 端口被占用

+

网关监听 127.0.0.1:3425。要换端口,打开 设置 › 网络与共享 › 网关地址。这里只设置端口(1024 到 65535),magpie 接入过的 Agent 会一起改过去。

+
+ + + + + +
magpie 的提示解决
端口 … 已被其他程序占用,请换一个换一个空闲端口。
另一个 magpie 正在 … 提供网关:请在那边设端口,或先退出它运行了两个 magpie,退出一个。
端口 … 被其他程序占用(可能是 magpie web):magpie 每隔几秒会再试一次找到占用端口的程序,或把网关换到别的端口。
MAGPIE_ADDR=… 设置了网关的完整地址取消或修改 MAGPIE_ADDR。
+ +

WSL 里的 Agent

+

在 Windows 上,magpie 会在正在运行的 WSL 发行版里查找 Claude Code、Codex、OpenCode、Kimi Code、Qwen Code 等 Agent。找到的每个都在 Agent 页有自己的一行,magpie 像在 Windows 上一样配置它。magpie 不会启动已停止的发行版。

+
    +
  • 没有列出 Agent。先启动发行版,并确认 设置 › 常规 › 检测 WSL 中的 Agent 已打开。
  • +
  • 连不上 magpie。在 WSL 默认的 NAT 网络下,magpie 还会在 Windows 的 WSL 网络地址上提供网关,使用单独的密钥,并把这个地址写进 Agent 的配置。镜像网络模式下,Agent 和 Windows 上一样用 127.0.0.1。是否放行仍由 Windows 防火墙决定:WSL 网络属于“公用”网络,连接被拦时请在那里允许 magpie。
  • +
  • 改动没生效。WSL 里的 Agent 启动时读取配置:在那边重启它。
  • +
+ +

从局域网里的其他电脑使用

+

默认情况下网关只回应本机。要让其他电脑使用:设置 › 网络与共享 › 局域网共享。另一台电脑需要发送 网关 页 网关密钥 里的密钥。

+
    +
  • “magpie isn’t shared on the local network”。在运行 magpie 的电脑上打开共享。
  • +
  • 401。没带密钥,或密钥已关闭、已过期。以 Authorization: Bearer <key> 或 x-api-key 发送一个启用的网关密钥。
  • +
  • 某个模型 403。这个密钥限定了可用的模型:magpie gateway-key models <id>。
  • +
+

不要把端口暴露到公网;在电脑之间用 VPN。完整的设置,包括连接另一台 magpie,见 远程 magpie。

+ +

已迁移到插件的订阅无法使用

+

Command Code、Cursor、Devin、Factory、Grok、Kiro、Xiaomi MiMo、Qoder、WorkBuddy、ZCode 和 Zed 已不再内置于 magpie,各自由一个功能相同的社区插件提供。之前添加的账号还需要迁移到插件,迁移之前它们无法使用。

+
  • 解决:供应商列表上方会有一行提示“… 的内置订阅已下线,它的账号还没迁移到插件”。点 迁移到插件:magpie 会安装插件并逐个检查账号。迁移会保留你的账号、模型和 Agent 设置。magpie 也会自动迁移,在 插件 页安装插件同样会迁移。
+

迁移后的报错来自插件:登录、模型和请求都由插件处理。

+ +

常见问题

+

供应商明明正常,magpie 为什么回 502?

+

供应商回的不是 API 回复,比如网页或空内容。通常是 Base URL 指向了厂商的网站而不是 API。

+

429 之后为什么某个账号一直不用?

+

magpie 会暂停它,直到厂商给出的重置时间;没有给出时暂停一段时间。供应商那一行会显示何时恢复,点“立即重试”可以结束暂停。

+

“magpie knows no model” 是什么意思?

+

没有供应商提供这个名字的模型。按 magpie models 列出的 provider/model 命名,或重新打开它的供应商。

+

怎么修改 magpie 的端口?

+

设置 › 网络与共享 › 网关地址。magpie 接入过的 Agent 会一起改过去。

+

WSL 里的 Agent 能用 Windows 上的 magpie 吗?

+

能。magpie 会在运行中的 WSL 发行版里找到 Agent,并给每个配置一个能连上的地址。NAT 网络下需要 Windows 防火墙放行 WSL 的连接。

+

能从局域网里的其他电脑用 magpie 吗?

+

能。打开 设置 › 网络与共享 › 局域网共享,另一台电脑发送网关密钥即可。不要把端口暴露到公网。

+ +

还没解决?在路由页复制这个请求的报告,到 Discord 提问。

+
+
+ + + + + + + diff --git a/site/public/llms-full.txt b/site/public/llms-full.txt index 7dce8e581..d603cf838 100644 --- a/site/public/llms-full.txt +++ b/site/public/llms-full.txt @@ -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 `. + +### 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 `), 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 ` 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 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 + +- **“: 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 ` or `x-api-key`. +- **403 for a model..** The key is held to some models: `magpie gateway-key models `. + +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 diff --git a/site/public/llms.txt b/site/public/llms.txt index 0de18ce67..c7d0ca0f3 100644 --- a/site/public/llms.txt +++ b/site/public/llms.txt @@ -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. diff --git a/site/public/sitemap.xml b/site/public/sitemap.xml index fe48116d9..c29de3b3b 100644 --- a/site/public/sitemap.xml +++ b/site/public/sitemap.xml @@ -5,6 +5,7 @@ https://usemagpie.ai/ja/ https://usemagpie.ai/de/ https://usemagpie.ai/docs/claude-code-models +https://usemagpie.ai/docs/claude-code-chatgpt https://usemagpie.ai/docs/codex-models https://usemagpie.ai/docs/contributors https://usemagpie.ai/docs/docker @@ -20,6 +21,7 @@ https://usemagpie.ai/docs/remote https://usemagpie.ai/docs/start https://usemagpie.ai/docs/subscriptions +https://usemagpie.ai/docs/troubleshooting https://usemagpie.ai/docs/local-models https://usemagpie.ai/docs/opencode-models https://usemagpie.ai/docs/alternatives @@ -37,6 +39,7 @@ https://usemagpie.ai/docs/anthropic https://usemagpie.ai/docs/openai https://usemagpie.ai/docs/zh/claude-code-models +https://usemagpie.ai/docs/zh/claude-code-chatgpt https://usemagpie.ai/docs/zh/codex-models https://usemagpie.ai/docs/zh/contributors https://usemagpie.ai/docs/zh/docker @@ -52,6 +55,7 @@ https://usemagpie.ai/docs/zh/remote https://usemagpie.ai/docs/zh/start https://usemagpie.ai/docs/zh/subscriptions +https://usemagpie.ai/docs/zh/troubleshooting https://usemagpie.ai/docs/zh/local-models https://usemagpie.ai/docs/zh/opencode-models https://usemagpie.ai/docs/zh/alternatives @@ -69,6 +73,7 @@ https://usemagpie.ai/docs/zh/anthropic https://usemagpie.ai/docs/zh/openai https://usemagpie.ai/docs/ja/claude-code-models +https://usemagpie.ai/docs/ja/claude-code-chatgpt https://usemagpie.ai/docs/ja/codex-models https://usemagpie.ai/docs/ja/contributors https://usemagpie.ai/docs/ja/docker @@ -83,6 +88,7 @@ https://usemagpie.ai/docs/ja/remote https://usemagpie.ai/docs/ja/start https://usemagpie.ai/docs/ja/subscriptions +https://usemagpie.ai/docs/ja/troubleshooting https://usemagpie.ai/docs/ja/local-models https://usemagpie.ai/docs/ja/opencode-models https://usemagpie.ai/docs/ja/alternatives