site: provider pages for DeepSeek, Kimi and GLM (docs/deepseek, kimi, glm; zh, ja)
One page per provider, in English, Chinese and Japanese. Each covers adding the provider (the presets and plan= on the CLI), the endpoints magpie uses for each plan (from internal/provider/presets.go), how Claude Code, Codex, Gemini CLI and OpenCode reach it (linking the agent guides), the provider's thinking rules from internal/gateway (DeepSeek's thinking on tool turns, low/high/max effort and one-hour key affinity; GLM-5.3 and Kimi Code (China) K3.1 refusing thinking off; GLM's output_config.effort), the Zhipu 1113 retry on the Coding Plan endpoint, balances and plan windows (balance.go, planquota.go), and an FAQ with FAQPage JSON-LD. The four agent guides get a "By provider" line in each language; sitemap.xml and llms.txt list the new pages. Model ids are only ones in presets.go or catalog testdata. Generated by provgen.py in the seo scratch folder, from claude-code-models' layout. Run: mote-run node --test worker.test.mjs install.test.mjs, 69/69 pass. Tag balance of each article checked by script. Not tried: a browser render of the pages.
This commit is contained in:
@@ -251,6 +251,8 @@ magpie claude codex/gpt-5.5</pre></div>
|
||||
</ul>
|
||||
<p>The routing modes are in <a href="/docs/start#routing">Get started</a>.</p>
|
||||
|
||||
<p><b>By provider:</b> <a href="/docs/deepseek">DeepSeek</a> · <a href="/docs/kimi">Kimi and Kimi Code</a> · <a href="/docs/glm">GLM Coding Plan</a></p>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">FAQ</a></h2>
|
||||
<h3>Do I set <code>ANTHROPIC_BASE_URL</code> myself?</h3>
|
||||
<p>No. magpie writes it into Claude Code’s <code>settings.json</code>. If <code>CLAUDE_CODE_USE_BEDROCK</code>, <code>CLAUDE_CODE_USE_VERTEX</code> or another cloud switch is set in your shell’s environment, Claude Code sends its requests to that cloud and not to magpie; magpie tells you so, and you take it out of your shell profile.</p>
|
||||
|
||||
@@ -251,6 +251,8 @@ magpie codex claude/…</pre></div>
|
||||
</ul>
|
||||
<p>The routing modes are in <a href="/docs/start#routing">Get started</a>.</p>
|
||||
|
||||
<p><b>By provider:</b> <a href="/docs/deepseek">DeepSeek</a> · <a href="/docs/kimi">Kimi and Kimi Code</a> · <a href="/docs/glm">GLM Coding Plan</a></p>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">FAQ</a></h2>
|
||||
<h3>Do I write <code>[model_providers]</code> myself?</h3>
|
||||
<p>No. magpie writes Codex’s <code>config.toml</code> when you pick a model. You don’t export <code>OPENAI_BASE_URL</code> either.</p>
|
||||
|
||||
@@ -0,0 +1,284 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>DeepSeek in Claude Code, Codex, Gemini CLI and OpenCode · magpie</title>
|
||||
<meta name="description" content="Use DeepSeek V4 in Claude Code, Codex, Gemini CLI and OpenCode with magpie: add your DeepSeek API key once, which endpoints magpie uses, how thinking, reasoning effort and the prompt cache are handled, and your balance.">
|
||||
<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/deepseek">
|
||||
<link rel="alternate" hreflang="zh" href="https://usemagpie.ai/docs/zh/deepseek">
|
||||
<link rel="alternate" hreflang="ja" href="https://usemagpie.ai/docs/ja/deepseek">
|
||||
<link rel="alternate" hreflang="x-default" href="https://usemagpie.ai/docs/deepseek">
|
||||
<link rel="canonical" href="https://usemagpie.ai/docs/deepseek">
|
||||
<link rel="stylesheet" href="/docs.css">
|
||||
<meta property="og:site_name" content="magpie">
|
||||
<meta property="og:title" content="DeepSeek in Claude Code, Codex, Gemini CLI and OpenCode">
|
||||
<meta property="og:description" content="Use DeepSeek V4 in Claude Code, Codex, Gemini CLI and OpenCode with magpie: add your DeepSeek API key once, which endpoints magpie uses, how thinking, reasoning effort and the prompt cache are handled, and your balance.">
|
||||
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
|
||||
<meta property="og:url" content="https://usemagpie.ai/docs/deepseek">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@graph": [
|
||||
{
|
||||
"@type": "TechArticle",
|
||||
"headline": "DeepSeek in Claude Code, Codex, Gemini CLI and OpenCode",
|
||||
"description": "Use DeepSeek V4 in Claude Code, Codex, Gemini CLI and OpenCode with magpie: add your DeepSeek API key once, which endpoints magpie uses, how thinking, reasoning effort and the prompt cache are handled, and your balance.",
|
||||
"inLanguage": "en",
|
||||
"url": "https://usemagpie.ai/docs/deepseek",
|
||||
"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": "How do I use DeepSeek in Claude Code?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "Add your DeepSeek API key in magpie (Providers, Add provider, DeepSeek), then pick a DeepSeek model such as deepseek-v4-pro on Claude Code’s row, or run magpie claude deepseek/deepseek-v4-pro. magpie writes Claude Code’s settings.json and passes its requests to DeepSeek’s Anthropic endpoint, https://api.deepseek.com/anthropic."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Can Codex use DeepSeek?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "Yes. DeepSeek serves the OpenAI Responses API that Codex speaks, so magpie passes Codex’s requests on as they are. Pick the model on Codex’s row or run magpie codex deepseek/deepseek-v4-pro; it shows in Codex’s /model list."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Do I need to set ANTHROPIC_BASE_URL to DeepSeek myself?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "No. magpie points Claude Code at its own gateway at 127.0.0.1:3425 and keeps your DeepSeek key itself. Picking one of Claude Code’s own models again puts back what you had."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Can I switch between Claude and DeepSeek in one conversation?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "Yes. DeepSeek’s Anthropic endpoint wants a thinking block on tool-calling turns, and a conversation that started on Claude doesn’t have one it can read. magpie adds it, so a routing group can fall back from Claude to DeepSeek mid-conversation."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Which reasoning effort does DeepSeek take?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "DeepSeek thinks at three levels, low, high and max, set in output_config.effort, and ignores budget_tokens. magpie fits the level or token budget an agent asks for to one of those three."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Can I use several DeepSeek keys?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "Yes. Add them all to the DeepSeek provider and tick each one. magpie spreads requests over them, keeps a conversation on one key so its prompt cache is reused, and moves on when a key runs out of balance."
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
</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/deepseek" hreflang="en" lang="en">English</a>
|
||||
<a href="/docs/zh/deepseek" hreflang="zh" lang="zh">中文</a>
|
||||
<a href="/docs/ja/deepseek" 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>On this page</p>
|
||||
<a href="#add">Add it</a>
|
||||
<a href="#endpoints">Plans and endpoints</a>
|
||||
<a href="#agents">In each agent</a>
|
||||
<a href="#thinking">Thinking</a>
|
||||
<a href="#usage">Balance and usage</a>
|
||||
<a href="#faq">FAQ</a>
|
||||
</aside>
|
||||
|
||||
<article>
|
||||
<p class="eyebrow" id="overview">Docs · Provider</p>
|
||||
<h1>DeepSeek in Claude Code, Codex, Gemini CLI and OpenCode</h1>
|
||||
<p class="lede">DeepSeek serves an OpenAI-compatible API and an Anthropic-compatible one. Add your key to magpie once, and Claude Code, Codex, Gemini CLI, OpenCode and every other agent you connect can use DeepSeek’s models through magpie’s gateway at <code>127.0.0.1:3425</code>.</p>
|
||||
|
||||
<h2 id="add"><a class="anchor" href="#add">Add DeepSeek</a></h2>
|
||||
<ol class="steps">
|
||||
<li><b>Get an API key</b>Create one at <a href="https://platform.deepseek.com/api_keys">platform.deepseek.com/api_keys</a>.</li>
|
||||
<li><b>Add the provider</b>In magpie’s <span class="ui">Providers</span> tab, press <span class="ui">+ Add provider</span>, pick DeepSeek, paste the key and save. magpie asks DeepSeek which models it serves, such as <code>deepseek-v4-pro</code> and <code>deepseek-v4-flash</code>.</li>
|
||||
<li><b>Pick it for an agent</b>In the <span class="ui">Agents</span> tab, click the model on the agent’s row and choose a DeepSeek model.</li>
|
||||
</ol>
|
||||
<div class="code"><span class="lang">Terminal</span><button class="copy" data-copy="ex-add">Copy</button><pre id="ex-add">magpie provider add deepseek sk-…
|
||||
magpie models # every model, as provider/model</pre></div>
|
||||
<p>Model ids in magpie are <code>provider/model</code>, so DeepSeek’s are <code>deepseek/…</code>. Adding the preset again adds a second DeepSeek provider for another key; to spread requests over several keys, add them all to the one provider instead.</p>
|
||||
|
||||
<h2 id="endpoints"><a class="anchor" href="#endpoints">Endpoints</a></h2>
|
||||
<p>DeepSeek has one plan, pay as you go, and magpie uses these endpoints for it:</p>
|
||||
<div class="table-wrap"><table>
|
||||
<tr><th>API</th><th>Base URL</th></tr>
|
||||
<tr><td>OpenAI Chat Completions and Responses</td><td><code>https://api.deepseek.com/v1</code></td></tr>
|
||||
<tr><td>Anthropic Messages</td><td><code>https://api.deepseek.com/anthropic</code></td></tr>
|
||||
</table></div>
|
||||
|
||||
<h2 id="agents"><a class="anchor" href="#agents">In each agent</a></h2>
|
||||
<p>Pick the model on an agent’s row in the <span class="ui">Agents</span> tab, or from a terminal. Each guide says what magpie writes in that agent’s config and how to switch back.</p>
|
||||
<div class="code"><span class="lang">Terminal</span><button class="copy" data-copy="ex-agents">Copy</button><pre id="ex-agents">magpie claude deepseek/deepseek-v4-pro
|
||||
magpie codex deepseek/deepseek-v4-pro
|
||||
magpie gemini model deepseek/deepseek-v4-flash
|
||||
magpie opencode deepseek/deepseek-v4-pro</pre></div>
|
||||
<ul>
|
||||
<li><b>Claude Code</b> speaks Anthropic Messages, and so does DeepSeek’s Anthropic endpoint, so its requests are passed on as they are. Every tier (opus, sonnet, haiku) runs on the model you pick unless you give one its own. <a href="/docs/claude-code-models">Models in Claude Code</a>.</li>
|
||||
<li><b>Codex</b> speaks only OpenAI Responses. DeepSeek serves the Responses API itself, so Codex’s requests are passed on as they are. The model shows in Codex’s <code>/model</code> with its reasoning efforts. <a href="/docs/codex-models">Models in Codex</a>.</li>
|
||||
<li><b>Gemini CLI</b> speaks Gemini’s API. magpie points it at its gateway and translates. <a href="/docs/gemini-cli-models">Models in Gemini CLI</a>.</li>
|
||||
<li><b>OpenCode</b> gets the model in <code>opencode.json</code>, with its reasoning variants and cost. <a href="/docs/opencode-models">Models in OpenCode</a>.</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="thinking"><a class="anchor" href="#thinking">Thinking, effort and the prompt cache</a></h2>
|
||||
<ul>
|
||||
<li><b>Thinking on tool turns.</b> DeepSeek’s Anthropic endpoint wants a thinking block on every assistant turn that calls a tool, and on turns that only answer tool results. When an agent’s history has none, magpie adds one, and turns a Claude <code>redacted_thinking</code> block into one. So a routing group can fall back from Claude to DeepSeek in the middle of a conversation.</li>
|
||||
<li><b>Effort.</b> DeepSeek thinks at three levels, <code>low</code>, <code>high</code> and <code>max</code>, set in <code>output_config.effort</code>, and ignores <code>budget_tokens</code>. A token budget an agent sends is fitted to one of the three.</li>
|
||||
<li><b>Prompt cache.</b> With several keys, magpie keeps a conversation on the same DeepSeek key for an hour after its last turn, so the next turn reads its prompt from DeepSeek’s cache instead of sending it uncached to another key.</li>
|
||||
<li><b>Images.</b> magpie uploads each image an agent sends to DeepSeek’s API once and names it by its file id on later turns. <code>magpie provider set deepseek image-files=off</code> sends images inline on every turn instead.</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="usage"><a class="anchor" href="#usage">Balance and usage</a></h2>
|
||||
<p>The DeepSeek row shows your balance, read from DeepSeek: the total, what was granted and what you topped up. The <span class="ui">Usage</span> tab counts tokens, cache hits and cost for each agent and model that went through magpie.</p>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">FAQ</a></h2>
|
||||
<h3>How do I use DeepSeek in Claude Code?</h3>
|
||||
<p>Add your DeepSeek API key in magpie (Providers, Add provider, DeepSeek), then pick a DeepSeek model such as <code>deepseek-v4-pro</code> on Claude Code’s row, or run <code>magpie claude deepseek/deepseek-v4-pro</code>. magpie writes Claude Code’s <code>settings.json</code> and passes its requests to DeepSeek’s Anthropic endpoint, <code>https://api.deepseek.com/anthropic</code>.</p>
|
||||
<h3>Can Codex use DeepSeek?</h3>
|
||||
<p>Yes. DeepSeek serves the OpenAI Responses API that Codex speaks, so magpie passes Codex’s requests on as they are. Pick the model on Codex’s row or run <code>magpie codex deepseek/deepseek-v4-pro</code>; it shows in Codex’s <code>/model</code> list.</p>
|
||||
<h3>Do I need to set ANTHROPIC_BASE_URL to DeepSeek myself?</h3>
|
||||
<p>No. magpie points Claude Code at its own gateway at <code>127.0.0.1:3425</code> and keeps your DeepSeek key itself. Picking one of Claude Code’s own models again puts back what you had.</p>
|
||||
<h3>Can I switch between Claude and DeepSeek in one conversation?</h3>
|
||||
<p>Yes. DeepSeek’s Anthropic endpoint wants a thinking block on tool-calling turns, and a conversation that started on Claude doesn’t have one it can read. magpie adds it, so a routing group can fall back from Claude to DeepSeek mid-conversation.</p>
|
||||
<h3>Which reasoning effort does DeepSeek take?</h3>
|
||||
<p>DeepSeek thinks at three levels, low, high and max, set in <code>output_config.effort</code>, and ignores <code>budget_tokens</code>. magpie fits the level or token budget an agent asks for to one of those three.</p>
|
||||
<h3>Can I use several DeepSeek keys?</h3>
|
||||
<p>Yes. Add them all to the DeepSeek provider and tick each one. magpie spreads requests over them, keeps a conversation on one key so its prompt cache is reused, and moves on when a key runs out of balance.</p>
|
||||
|
||||
<p style="margin-top:48px">Every agent: <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/opencode-models">Models in OpenCode</a>. Ask on <a href="https://discord.gg/vGSnD3ZKQF">Discord</a> if you get stuck.</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>
|
||||
@@ -235,6 +235,8 @@ magpie gemini model codex/gpt-5.5</pre></div>
|
||||
</ul>
|
||||
<p>The routing modes and rules are in <a href="/docs/start#routing">Get started</a>.</p>
|
||||
|
||||
<p><b>By provider:</b> <a href="/docs/deepseek">DeepSeek</a> · <a href="/docs/kimi">Kimi and Kimi Code</a> · <a href="/docs/glm">GLM Coding Plan</a></p>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">FAQ</a></h2>
|
||||
<h3>Can Gemini CLI use models that aren’t Gemini?</h3>
|
||||
<p>Yes, through a gateway that serves the Gemini API. magpie runs one on your computer and points Gemini CLI at it, so any model of a provider you add works: DeepSeek, Kimi, GLM, Qwen, MiniMax, or a Claude, ChatGPT or Copilot subscription.</p>
|
||||
|
||||
@@ -0,0 +1,288 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>GLM Coding Plan in Claude Code, Codex, Gemini CLI and OpenCode · magpie</title>
|
||||
<meta name="description" content="Use Zhipu GLM and Z.ai models such as GLM-5.3 in Claude Code, Codex, Gemini CLI and OpenCode with magpie: a GLM Coding Plan or pay-as-you-go key, each plan’s endpoints, the 1113 “insufficient balance” fix, thinking, and the plan’s usage windows.">
|
||||
<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/glm">
|
||||
<link rel="alternate" hreflang="zh" href="https://usemagpie.ai/docs/zh/glm">
|
||||
<link rel="alternate" hreflang="ja" href="https://usemagpie.ai/docs/ja/glm">
|
||||
<link rel="alternate" hreflang="x-default" href="https://usemagpie.ai/docs/glm">
|
||||
<link rel="canonical" href="https://usemagpie.ai/docs/glm">
|
||||
<link rel="stylesheet" href="/docs.css">
|
||||
<meta property="og:site_name" content="magpie">
|
||||
<meta property="og:title" content="GLM Coding Plan in Claude Code, Codex, Gemini CLI and OpenCode">
|
||||
<meta property="og:description" content="Use Zhipu GLM and Z.ai models such as GLM-5.3 in Claude Code, Codex, Gemini CLI and OpenCode with magpie: a GLM Coding Plan or pay-as-you-go key, each plan’s endpoints, the 1113 “insufficient balance” fix, thinking, and the plan’s usage windows.">
|
||||
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
|
||||
<meta property="og:url" content="https://usemagpie.ai/docs/glm">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@graph": [
|
||||
{
|
||||
"@type": "TechArticle",
|
||||
"headline": "GLM Coding Plan in Claude Code, Codex, Gemini CLI and OpenCode",
|
||||
"description": "Use Zhipu GLM and Z.ai models such as GLM-5.3 in Claude Code, Codex, Gemini CLI and OpenCode with magpie: a GLM Coding Plan or pay-as-you-go key, each plan’s endpoints, the 1113 “insufficient balance” fix, thinking, and the plan’s usage windows.",
|
||||
"inLanguage": "en",
|
||||
"url": "https://usemagpie.ai/docs/glm",
|
||||
"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": "How do I use the GLM Coding Plan in Claude Code?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "Add Zhipu GLM (open.bigmodel.cn) or Z.ai (api.z.ai) in magpie, choose Coding Plan as the key’s plan, then pick a GLM model such as glm-5.3 on Claude Code’s row, or run magpie claude zhipu/glm-5.3. Claude Code’s requests go to the Anthropic endpoint, which bills the Coding Plan when the account has one."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Can Codex use GLM?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "Yes. The GLM Coding Plan serves the OpenAI Responses API Codex speaks, so magpie passes Codex’s requests on as they are. On pay as you go, magpie translates Codex’s requests to Chat Completions. Run magpie codex zhipu/glm-5.3 or pick it on Codex’s row."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Why does my GLM Coding Plan key say insufficient balance (1113)?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "A Coding Plan key sent to the pay-as-you-go endpoint, https://open.bigmodel.cn/api/paas/v4, is answered with 429 code 1113. magpie tries the Coding Plan endpoint, https://open.bigmodel.cn/api/coding/paas/v4, and when the key is served there it moves the provider to the plan’s endpoints. Choosing Coding Plan when you add the key avoids it."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Can I have a Coding Plan key and a pay-as-you-go key together?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "Yes. Each key on a Zhipu GLM or Z.ai provider says which plan it is for. Its requests go to that plan’s endpoints, and its model list and usage windows are that plan’s."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Zhipu GLM or Z.ai: which preset do I pick?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "The one that issued your key: Zhipu GLM for a key from open.bigmodel.cn, Z.ai for a key from z.ai."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Does GLM-5.3 work with thinking turned off?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "GLM-5.3 always thinks and turns away a request that switches thinking off. magpie asks again with thinking left on, so the agent gets an answer."
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
</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/glm" hreflang="en" lang="en">English</a>
|
||||
<a href="/docs/zh/glm" hreflang="zh" lang="zh">中文</a>
|
||||
<a href="/docs/ja/glm" 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>On this page</p>
|
||||
<a href="#add">Add it</a>
|
||||
<a href="#endpoints">Plans and endpoints</a>
|
||||
<a href="#agents">In each agent</a>
|
||||
<a href="#thinking">Thinking</a>
|
||||
<a href="#usage">Balance and usage</a>
|
||||
<a href="#faq">FAQ</a>
|
||||
</aside>
|
||||
|
||||
<article>
|
||||
<p class="eyebrow" id="overview">Docs · Provider</p>
|
||||
<h1>GLM Coding Plan in Claude Code, Codex, Gemini CLI and OpenCode</h1>
|
||||
<p class="lede">Zhipu’s GLM models come from two places, Zhipu GLM at open.bigmodel.cn and Z.ai at api.z.ai, and each has two plans: pay as you go and the GLM Coding Plan. Add a key to magpie with its plan, and Claude Code, Codex, Gemini CLI, OpenCode and your other agents can use GLM through magpie’s gateway at <code>127.0.0.1:3425</code>.</p>
|
||||
|
||||
<h2 id="add"><a class="anchor" href="#add">Add GLM</a></h2>
|
||||
<ol class="steps">
|
||||
<li><b>Get a key</b>From <a href="https://open.bigmodel.cn/usercenter/proj-mgmt/apikeys">open.bigmodel.cn</a> for Zhipu GLM, or <a href="https://z.ai/manage-apikey/apikey-list">z.ai</a> for Z.ai.</li>
|
||||
<li><b>Add the provider and pick the plan</b>In <span class="ui">Providers</span>, press <span class="ui">+ Add provider</span>, pick Zhipu GLM or Z.ai, choose the plan your key is for (<span class="ui">Pay as you go</span> or <span class="ui">Coding Plan</span>), paste the key and save.</li>
|
||||
<li><b>Pick it for an agent</b>In the <span class="ui">Agents</span> tab, choose a GLM model such as <code>glm-5.3</code> on the agent’s row.</li>
|
||||
</ol>
|
||||
<div class="code"><span class="lang">Terminal</span><button class="copy" data-copy="ex-add">Copy</button><pre id="ex-add">magpie provider add zhipu sk-… plan=coding # GLM Coding Plan (open.bigmodel.cn)
|
||||
magpie provider add zai sk-… plan=coding # GLM Coding Plan (z.ai)
|
||||
magpie provider add zhipu sk-… plan=api # pay as you go</pre></div>
|
||||
<div class="callout"><b>Pick the plan your key is for.</b> A Coding Plan key has its own endpoints. Sent to the pay-as-you-go one, it is told it has no balance (429, code 1113). If that happens, magpie tries the Coding Plan endpoint, and when the key is served there it moves the provider to the plan’s endpoints. When both refuse, the error says what each said and what to change.</div>
|
||||
|
||||
<h2 id="endpoints"><a class="anchor" href="#endpoints">Plans and endpoints</a></h2>
|
||||
<div class="table-wrap"><table>
|
||||
<tr><th>Preset</th><th>Plan</th><th>OpenAI Chat Completions</th><th>OpenAI Responses</th><th>Anthropic Messages</th></tr>
|
||||
<tr><td>Zhipu GLM</td><td>Pay as you go</td><td><code>https://open.bigmodel.cn/api/paas/v4</code></td><td>—</td><td><code>https://open.bigmodel.cn/api/anthropic</code></td></tr>
|
||||
<tr><td>Zhipu GLM</td><td>Coding Plan</td><td><code>https://open.bigmodel.cn/api/coding/paas/v4</code></td><td><code>https://open.bigmodel.cn/api/v1</code></td><td><code>https://open.bigmodel.cn/api/anthropic</code></td></tr>
|
||||
<tr><td>Z.ai</td><td>Pay as you go</td><td><code>https://api.z.ai/api/paas/v4</code></td><td>—</td><td><code>https://api.z.ai/api/anthropic</code></td></tr>
|
||||
<tr><td>Z.ai</td><td>Coding Plan</td><td><code>https://api.z.ai/api/coding/paas/v4</code></td><td><code>https://api.z.ai/api/v1</code></td><td><code>https://api.z.ai/api/anthropic</code></td></tr>
|
||||
</table></div>
|
||||
<p>Both plans share the Anthropic endpoint, which bills the Coding Plan when the account has one. Each key on the provider says which plan it is for, so one provider can hold a pay-as-you-go key and a Coding Plan key, and each key’s requests, model list and windows are its own plan’s.</p>
|
||||
|
||||
<h2 id="agents"><a class="anchor" href="#agents">In each agent</a></h2>
|
||||
<p>Pick the model on an agent’s row in the <span class="ui">Agents</span> tab, or from a terminal. Each guide says what magpie writes in that agent’s config and how to switch back.</p>
|
||||
<div class="code"><span class="lang">Terminal</span><button class="copy" data-copy="ex-agents">Copy</button><pre id="ex-agents">magpie claude zhipu/glm-5.3
|
||||
magpie codex zhipu/glm-5.3
|
||||
magpie gemini model zhipu/glm-5.3
|
||||
magpie opencode zhipu/glm-5.3</pre></div>
|
||||
<ul>
|
||||
<li><b>Claude Code</b> speaks Anthropic Messages, and so does GLM’s Anthropic endpoint, so its requests are passed on as they are. Every tier (opus, sonnet, haiku) runs on the model you pick unless you give one its own. <a href="/docs/claude-code-models">Models in Claude Code</a>.</li>
|
||||
<li><b>Codex</b> speaks only OpenAI Responses. The Coding Plan serves the Responses API itself, so Codex’s requests are passed on as they are; on pay as you go, magpie translates them to Chat Completions. The model shows in Codex’s <code>/model</code> with its reasoning efforts. <a href="/docs/codex-models">Models in Codex</a>.</li>
|
||||
<li><b>Gemini CLI</b> speaks Gemini’s API. magpie points it at its gateway and translates. <a href="/docs/gemini-cli-models">Models in Gemini CLI</a>.</li>
|
||||
<li><b>OpenCode</b> gets the model in <code>opencode.json</code>, with its reasoning variants and cost. <a href="/docs/opencode-models">Models in OpenCode</a>.</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="thinking"><a class="anchor" href="#thinking">Thinking and effort</a></h2>
|
||||
<ul>
|
||||
<li><b>GLM-5.3 always thinks.</b> It turns away a request that switches thinking off. magpie asks again with thinking left on, so the agent gets an answer rather than the error.</li>
|
||||
<li><b>Effort.</b> GLM-5.2 and GLM-5.3 take their reasoning level in <code>output_config.effort</code>, and magpie puts the agent’s level there.</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="usage"><a class="anchor" href="#usage">Usage windows and search</a></h2>
|
||||
<ul>
|
||||
<li><b>Coding Plan windows.</b> The row shows the plan’s windows, read from Zhipu or Z.ai: the hourly and weekly allowances, and the month’s MCP tool calls.</li>
|
||||
<li><b>Web search.</b> With a Coding Plan key and no searcher chosen in Settings, magpie searches the web for GLM models through the plan’s own search service.</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">FAQ</a></h2>
|
||||
<h3>How do I use the GLM Coding Plan in Claude Code?</h3>
|
||||
<p>Add Zhipu GLM (open.bigmodel.cn) or Z.ai (api.z.ai) in magpie, choose Coding Plan as the key’s plan, then pick a GLM model such as <code>glm-5.3</code> on Claude Code’s row, or run <code>magpie claude zhipu/glm-5.3</code>. Claude Code’s requests go to the Anthropic endpoint, which bills the Coding Plan when the account has one.</p>
|
||||
<h3>Can Codex use GLM?</h3>
|
||||
<p>Yes. The GLM Coding Plan serves the OpenAI Responses API Codex speaks, so magpie passes Codex’s requests on as they are. On pay as you go, magpie translates Codex’s requests to Chat Completions. Run <code>magpie codex zhipu/glm-5.3</code> or pick it on Codex’s row.</p>
|
||||
<h3>Why does my GLM Coding Plan key say insufficient balance (1113)?</h3>
|
||||
<p>A Coding Plan key sent to the pay-as-you-go endpoint, <code>https://open.bigmodel.cn/api/paas/v4</code>, is answered with 429 code 1113. magpie tries the Coding Plan endpoint, <code>https://open.bigmodel.cn/api/coding/paas/v4</code>, and when the key is served there it moves the provider to the plan’s endpoints. Choosing Coding Plan when you add the key avoids it.</p>
|
||||
<h3>Can I have a Coding Plan key and a pay-as-you-go key together?</h3>
|
||||
<p>Yes. Each key on a Zhipu GLM or Z.ai provider says which plan it is for. Its requests go to that plan’s endpoints, and its model list and usage windows are that plan’s.</p>
|
||||
<h3>Zhipu GLM or Z.ai: which preset do I pick?</h3>
|
||||
<p>The one that issued your key: Zhipu GLM for a key from open.bigmodel.cn, Z.ai for a key from z.ai.</p>
|
||||
<h3>Does GLM-5.3 work with thinking turned off?</h3>
|
||||
<p>GLM-5.3 always thinks and turns away a request that switches thinking off. magpie asks again with thinking left on, so the agent gets an answer.</p>
|
||||
|
||||
<p style="margin-top:48px">Every agent: <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/opencode-models">Models in OpenCode</a>. Ask on <a href="https://discord.gg/vGSnD3ZKQF">Discord</a> if you get stuck.</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>
|
||||
@@ -251,6 +251,8 @@ magpie claude codex/gpt-5.5</pre></div>
|
||||
</ul>
|
||||
<p>ルーティングモードは<a href="/docs/ja/start#routing">はじめに</a>で説明しています。</p>
|
||||
|
||||
<p><b>プロバイダ別:</b><a href="/docs/ja/deepseek">DeepSeek</a> · <a href="/docs/ja/kimi">Kimi と Kimi Code</a> · <a href="/docs/ja/glm">GLM Coding Plan</a></p>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">よくある質問</a></h2>
|
||||
<h3><code>ANTHROPIC_BASE_URL</code> は自分で設定しますか?</h3>
|
||||
<p>いいえ。magpie が Claude Code の <code>settings.json</code> に書き込みます。シェルの環境変数に <code>CLAUDE_CODE_USE_BEDROCK</code>、<code>CLAUDE_CODE_USE_VERTEX</code> などのクラウドの切り替えが設定されていると、Claude Code は magpie ではなくそのクラウドにリクエストを送ります。その場合は magpie が知らせるので、シェルのプロファイルから取り除いてください。</p>
|
||||
|
||||
@@ -251,6 +251,8 @@ magpie codex claude/…</pre></div>
|
||||
</ul>
|
||||
<p>ルーティングモードは<a href="/docs/ja/start#routing">はじめに</a>で説明しています。</p>
|
||||
|
||||
<p><b>プロバイダ別:</b><a href="/docs/ja/deepseek">DeepSeek</a> · <a href="/docs/ja/kimi">Kimi と Kimi Code</a> · <a href="/docs/ja/glm">GLM Coding Plan</a></p>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">よくある質問</a></h2>
|
||||
<h3><code>[model_providers]</code> は自分で書きますか?</h3>
|
||||
<p>いいえ。モデルを選ぶと magpie が Codex の <code>config.toml</code> を書きます。<code>OPENAI_BASE_URL</code> を export する必要もありません。</p>
|
||||
|
||||
@@ -0,0 +1,284 @@
|
||||
<!doctype html>
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>DeepSeek を Claude Code・Codex・Gemini CLI・OpenCode で使う · magpie</title>
|
||||
<meta name="description" content="magpie で DeepSeek V4 を Claude Code、Codex、Gemini CLI、OpenCode から使う方法:DeepSeek の API キーを一度追加するだけ。magpie が使うエンドポイント、思考・推論レベル・キャッシュの扱い、残高の表示。">
|
||||
<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/deepseek">
|
||||
<link rel="alternate" hreflang="zh" href="https://usemagpie.ai/docs/zh/deepseek">
|
||||
<link rel="alternate" hreflang="ja" href="https://usemagpie.ai/docs/ja/deepseek">
|
||||
<link rel="alternate" hreflang="x-default" href="https://usemagpie.ai/docs/deepseek">
|
||||
<link rel="canonical" href="https://usemagpie.ai/docs/ja/deepseek">
|
||||
<link rel="stylesheet" href="/docs.css">
|
||||
<meta property="og:site_name" content="magpie">
|
||||
<meta property="og:title" content="DeepSeek を Claude Code・Codex・Gemini CLI・OpenCode で使う">
|
||||
<meta property="og:description" content="magpie で DeepSeek V4 を Claude Code、Codex、Gemini CLI、OpenCode から使う方法:DeepSeek の API キーを一度追加するだけ。magpie が使うエンドポイント、思考・推論レベル・キャッシュの扱い、残高の表示。">
|
||||
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
|
||||
<meta property="og:url" content="https://usemagpie.ai/docs/ja/deepseek">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@graph": [
|
||||
{
|
||||
"@type": "TechArticle",
|
||||
"headline": "DeepSeek を Claude Code・Codex・Gemini CLI・OpenCode で使う",
|
||||
"description": "magpie で DeepSeek V4 を Claude Code、Codex、Gemini CLI、OpenCode から使う方法:DeepSeek の API キーを一度追加するだけ。magpie が使うエンドポイント、思考・推論レベル・キャッシュの扱い、残高の表示。",
|
||||
"inLanguage": "ja",
|
||||
"url": "https://usemagpie.ai/docs/ja/deepseek",
|
||||
"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": "DeepSeek を Claude Code で使うには?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "magpie に DeepSeek の API キーを追加し(プロバイダ → プロバイダを追加 → DeepSeek)、Claude Code の行で deepseek-v4-pro などの DeepSeek モデルを選ぶか、magpie claude deepseek/deepseek-v4-pro を実行します。magpie が Claude Code の settings.json を書き、リクエストを DeepSeek の Anthropic エンドポイント https://api.deepseek.com/anthropic に渡します。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Codex で DeepSeek は使えますか?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "使えます。DeepSeek は Codex が話す OpenAI Responses API を自分で提供しているので、magpie は Codex のリクエストをそのまま渡します。Codex の行でモデルを選ぶか magpie codex deepseek/deepseek-v4-pro を実行すると、Codex の /model に並びます。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "ANTHROPIC_BASE_URL を自分で DeepSeek に向ける必要は?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "ありません。magpie が Claude Code をローカルゲートウェイ 127.0.0.1:3425 に向け、DeepSeek のキーは magpie が持ちます。Claude Code 自身のモデルを選び直せば元の設定に戻ります。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "1 つの会話で Claude と DeepSeek を切り替えられますか?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "できます。DeepSeek の Anthropic エンドポイントはツールを呼ぶターンに思考ブロックを求めますが、Claude で始めた会話にはそれが読める形でありません。magpie が補うので、ルーティンググループは会話の途中で Claude から DeepSeek にフォールバックできます。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "DeepSeek の推論レベルは?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "low・high・max の 3 段階で、output_config.effort で指定し、budget_tokens は見ません。ツールが求めるレベルやトークン予算は、magpie がこの 3 つのどれかに合わせます。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "DeepSeek のキーを複数使えますか?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "使えます。すべて DeepSeek プロバイダに追加してチェックを入れてください。magpie はリクエストをキーに振り分け、キャッシュを生かすために 1 つの会話は同じキーに留め、残高が尽きたキーは次へ回します。"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
</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/deepseek" hreflang="en" lang="en">English</a>
|
||||
<a href="/docs/zh/deepseek" hreflang="zh" lang="zh">中文</a>
|
||||
<a href="/docs/ja/deepseek" 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="#add">追加する</a>
|
||||
<a href="#endpoints">プランとエンドポイント</a>
|
||||
<a href="#agents">ツールごとの使い方</a>
|
||||
<a href="#thinking">思考</a>
|
||||
<a href="#usage">残高と使用量</a>
|
||||
<a href="#faq">よくある質問</a>
|
||||
</aside>
|
||||
|
||||
<article>
|
||||
<p class="eyebrow" id="overview">ドキュメント · プロバイダ</p>
|
||||
<h1>DeepSeek を Claude Code・Codex・Gemini CLI・OpenCode で使う</h1>
|
||||
<p class="lede">DeepSeek は OpenAI 互換と Anthropic 互換の両方の API を提供しています。magpie にキーを一度追加すれば、Claude Code、Codex、Gemini CLI、OpenCode、ほかに接続したツールのすべてが、magpie のゲートウェイ <code>127.0.0.1:3425</code> を通して DeepSeek のモデルを使えます。</p>
|
||||
|
||||
<h2 id="add"><a class="anchor" href="#add">DeepSeek を追加する</a></h2>
|
||||
<ol class="steps">
|
||||
<li><b>API キーを取得</b><a href="https://platform.deepseek.com/api_keys">platform.deepseek.com/api_keys</a> で作成します。</li>
|
||||
<li><b>プロバイダを追加</b>magpie の <span class="ui">プロバイダ</span> タブで <span class="ui">+ プロバイダを追加</span> を押し、DeepSeek を選んでキーを貼り付け、保存します。magpie が DeepSeek に提供モデル(<code>deepseek-v4-pro</code>、<code>deepseek-v4-flash</code> など)を問い合わせます。</li>
|
||||
<li><b>ツールで選ぶ</b><span class="ui">エージェント</span> タブで、ツールの行のモデルをクリックして DeepSeek のモデルを選びます。</li>
|
||||
</ol>
|
||||
<div class="code"><span class="lang">ターミナル</span><button class="copy" data-copy="ex-add">コピー</button><pre id="ex-add">magpie provider add deepseek sk-…
|
||||
magpie models # すべてのモデル(provider/model 形式)</pre></div>
|
||||
<p>magpie のモデル ID は <code>provider/model</code> 形式で、DeepSeek のものは <code>deepseek/…</code> です。プリセットをもう一度追加すると、別のキー用に 2 つ目の DeepSeek プロバイダができます。複数のキーにリクエストを振り分けたいときは、1 つのプロバイダにまとめて追加します。</p>
|
||||
|
||||
<h2 id="endpoints"><a class="anchor" href="#endpoints">エンドポイント</a></h2>
|
||||
<p>DeepSeek のプランは従量課金だけで、magpie が使うエンドポイントは次のとおりです。</p>
|
||||
<div class="table-wrap"><table>
|
||||
<tr><th>API</th><th>ベース URL</th></tr>
|
||||
<tr><td>OpenAI Chat Completions と Responses</td><td><code>https://api.deepseek.com/v1</code></td></tr>
|
||||
<tr><td>Anthropic Messages</td><td><code>https://api.deepseek.com/anthropic</code></td></tr>
|
||||
</table></div>
|
||||
|
||||
<h2 id="agents"><a class="anchor" href="#agents">ツールごとの使い方</a></h2>
|
||||
<p><span class="ui">エージェント</span> タブで各ツールの行のモデルをクリックして選ぶか、ターミナルで選びます。各ガイドに、magpie がそのツールの設定に何を書くか、どう元に戻すかがあります。</p>
|
||||
<div class="code"><span class="lang">ターミナル</span><button class="copy" data-copy="ex-agents">コピー</button><pre id="ex-agents">magpie claude deepseek/deepseek-v4-pro
|
||||
magpie codex deepseek/deepseek-v4-pro
|
||||
magpie gemini model deepseek/deepseek-v4-flash
|
||||
magpie opencode deepseek/deepseek-v4-pro</pre></div>
|
||||
<ul>
|
||||
<li><b>Claude Code</b> は Anthropic Messages を話し、DeepSeek の Anthropic エンドポイントも同じなので、リクエストはそのまま渡されます。opus・sonnet・haiku の各ティアは、個別に指定しない限り選んだモデルで動きます。<a href="/docs/ja/claude-code-models">Claude Code で他のモデル</a>。</li>
|
||||
<li><b>Codex</b> が話すのは OpenAI Responses だけです。DeepSeek は Responses API を自分で提供しているので、Codex のリクエストはそのまま渡されます。モデルは推論レベル付きで Codex の <code>/model</code> に並びます。<a href="/docs/ja/codex-models">Codex で他のモデル</a>。</li>
|
||||
<li><b>Gemini CLI</b> は Gemini の API を話します。magpie がゲートウェイに向けて変換します。<a href="/docs/ja/gemini-cli-models">Gemini CLI で他のモデル</a>。</li>
|
||||
<li><b>OpenCode</b> には、magpie が <code>opencode.json</code> にモデルを推論バリアントと価格つきで書きます。<a href="/docs/ja/opencode-models">OpenCode で他のモデル</a>。</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="thinking"><a class="anchor" href="#thinking">思考・推論レベル・キャッシュ</a></h2>
|
||||
<ul>
|
||||
<li><b>ツールのターンの思考ブロック。</b>DeepSeek の Anthropic エンドポイントは、ツールを呼ぶアシスタントのターンと、ツールの結果だけを返すターンのすべてに思考ブロックを求めます。履歴にないときは magpie が補い、Claude の <code>redacted_thinking</code> も使える思考ブロックに変えます。そのためルーティンググループは会話の途中で Claude から DeepSeek に切り替えられます。</li>
|
||||
<li><b>推論レベル。</b>DeepSeek は <code>low</code>・<code>high</code>・<code>max</code> の 3 段階で考え、<code>output_config.effort</code> で指定し、<code>budget_tokens</code> は見ません。ツールが送るトークン予算はこの 3 つのどれかに合わせられます。</li>
|
||||
<li><b>キャッシュ。</b>キーが複数あるとき、magpie は会話の最後のターンから 1 時間は同じ DeepSeek キーに留めます。次のターンは DeepSeek のキャッシュから読まれ、キャッシュなしで別のキーに送り直されることはありません。</li>
|
||||
<li><b>画像。</b>ツールが DeepSeek の API に送る画像は、magpie が一度だけアップロードし、以降のターンではファイル ID で指します。<code>magpie provider set deepseek image-files=off</code> にすると毎ターンインラインで送ります。</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="usage"><a class="anchor" href="#usage">残高と使用量</a></h2>
|
||||
<p>DeepSeek の行には DeepSeek から読んだ残高(合計、付与分、チャージ分)が表示されます。<span class="ui">使用量</span> タブでは、magpie を通ったトークン、キャッシュヒット、費用をツールとモデルごとに数えます。</p>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">よくある質問</a></h2>
|
||||
<h3>DeepSeek を Claude Code で使うには?</h3>
|
||||
<p>magpie に DeepSeek の API キーを追加し(プロバイダ → プロバイダを追加 → DeepSeek)、Claude Code の行で <code>deepseek-v4-pro</code> などの DeepSeek モデルを選ぶか、<code>magpie claude deepseek/deepseek-v4-pro</code> を実行します。magpie が Claude Code の <code>settings.json</code> を書き、リクエストを DeepSeek の Anthropic エンドポイント <code>https://api.deepseek.com/anthropic</code> に渡します。</p>
|
||||
<h3>Codex で DeepSeek は使えますか?</h3>
|
||||
<p>使えます。DeepSeek は Codex が話す OpenAI Responses API を自分で提供しているので、magpie は Codex のリクエストをそのまま渡します。Codex の行でモデルを選ぶか <code>magpie codex deepseek/deepseek-v4-pro</code> を実行すると、Codex の <code>/model</code> に並びます。</p>
|
||||
<h3>ANTHROPIC_BASE_URL を自分で DeepSeek に向ける必要は?</h3>
|
||||
<p>ありません。magpie が Claude Code をローカルゲートウェイ <code>127.0.0.1:3425</code> に向け、DeepSeek のキーは magpie が持ちます。Claude Code 自身のモデルを選び直せば元の設定に戻ります。</p>
|
||||
<h3>1 つの会話で Claude と DeepSeek を切り替えられますか?</h3>
|
||||
<p>できます。DeepSeek の Anthropic エンドポイントはツールを呼ぶターンに思考ブロックを求めますが、Claude で始めた会話にはそれが読める形でありません。magpie が補うので、ルーティンググループは会話の途中で Claude から DeepSeek にフォールバックできます。</p>
|
||||
<h3>DeepSeek の推論レベルは?</h3>
|
||||
<p>low・high・max の 3 段階で、<code>output_config.effort</code> で指定し、<code>budget_tokens</code> は見ません。ツールが求めるレベルやトークン予算は、magpie がこの 3 つのどれかに合わせます。</p>
|
||||
<h3>DeepSeek のキーを複数使えますか?</h3>
|
||||
<p>使えます。すべて DeepSeek プロバイダに追加してチェックを入れてください。magpie はリクエストをキーに振り分け、キャッシュを生かすために 1 つの会話は同じキーに留め、残高が尽きたキーは次へ回します。</p>
|
||||
|
||||
<p style="margin-top:48px">ツールごとのガイド:<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/opencode-models">OpenCode で他のモデル</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>
|
||||
@@ -235,6 +235,8 @@ magpie gemini model codex/gpt-5.5</pre></div>
|
||||
</ul>
|
||||
<p>ルーティングモードとルールは<a href="/docs/ja/start#routing">はじめに</a>で説明しています。</p>
|
||||
|
||||
<p><b>プロバイダ別:</b><a href="/docs/ja/deepseek">DeepSeek</a> · <a href="/docs/ja/kimi">Kimi と Kimi Code</a> · <a href="/docs/ja/glm">GLM Coding Plan</a></p>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">よくある質問</a></h2>
|
||||
<h3>Gemini CLI で Gemini 以外のモデルを使えますか?</h3>
|
||||
<p>はい。Gemini API を提供するゲートウェイを通せば使えます。magpie はそれをあなたのコンピューターで動かし、Gemini CLI をそこへ向けるので、追加したプロバイダのどのモデルでも動きます:DeepSeek、Kimi、GLM、Qwen、MiniMax、あるいは Claude、ChatGPT、Copilot のサブスクリプション。</p>
|
||||
|
||||
@@ -0,0 +1,288 @@
|
||||
<!doctype html>
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>GLM Coding Plan を Claude Code・Codex・Gemini CLI・OpenCode で使う · magpie</title>
|
||||
<meta name="description" content="magpie で Zhipu GLM と Z.ai の GLM-5.3 などのモデルを Claude Code、Codex、Gemini CLI、OpenCode から使う方法:GLM Coding Plan か従量課金のキー、プランごとのエンドポイント、1113「残高不足」の対処、思考、プランの使用量ウィンドウ。">
|
||||
<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/glm">
|
||||
<link rel="alternate" hreflang="zh" href="https://usemagpie.ai/docs/zh/glm">
|
||||
<link rel="alternate" hreflang="ja" href="https://usemagpie.ai/docs/ja/glm">
|
||||
<link rel="alternate" hreflang="x-default" href="https://usemagpie.ai/docs/glm">
|
||||
<link rel="canonical" href="https://usemagpie.ai/docs/ja/glm">
|
||||
<link rel="stylesheet" href="/docs.css">
|
||||
<meta property="og:site_name" content="magpie">
|
||||
<meta property="og:title" content="GLM Coding Plan を Claude Code・Codex・Gemini CLI・OpenCode で使う">
|
||||
<meta property="og:description" content="magpie で Zhipu GLM と Z.ai の GLM-5.3 などのモデルを Claude Code、Codex、Gemini CLI、OpenCode から使う方法:GLM Coding Plan か従量課金のキー、プランごとのエンドポイント、1113「残高不足」の対処、思考、プランの使用量ウィンドウ。">
|
||||
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
|
||||
<meta property="og:url" content="https://usemagpie.ai/docs/ja/glm">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@graph": [
|
||||
{
|
||||
"@type": "TechArticle",
|
||||
"headline": "GLM Coding Plan を Claude Code・Codex・Gemini CLI・OpenCode で使う",
|
||||
"description": "magpie で Zhipu GLM と Z.ai の GLM-5.3 などのモデルを Claude Code、Codex、Gemini CLI、OpenCode から使う方法:GLM Coding Plan か従量課金のキー、プランごとのエンドポイント、1113「残高不足」の対処、思考、プランの使用量ウィンドウ。",
|
||||
"inLanguage": "ja",
|
||||
"url": "https://usemagpie.ai/docs/ja/glm",
|
||||
"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": "GLM Coding Plan を Claude Code で使うには?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "magpie に Zhipu GLM(open.bigmodel.cn)か Z.ai(api.z.ai)を追加し、キーのプランに Coding Plan を選んでから、Claude Code の行で glm-5.3 などの GLM モデルを選ぶか、magpie claude zhipu/glm-5.3 を実行します。Claude Code のリクエストは Anthropic エンドポイントに送られ、アカウントに Coding Plan があればそのプランで課金されます。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Codex で GLM は使えますか?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "使えます。GLM Coding Plan は Codex が話す OpenAI Responses API を提供しているので、magpie はそのまま渡します。従量課金では、magpie が Codex のリクエストを Chat Completions に変換します。magpie codex zhipu/glm-5.3 を実行するか、Codex の行で選んでください。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Coding Plan のキーで「残高不足」(1113)が出るのはなぜ?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "Coding Plan のキーを従量課金のエンドポイント https://open.bigmodel.cn/api/paas/v4 に送ると、429・コード 1113 が返ります。magpie は Coding Plan のエンドポイント https://open.bigmodel.cn/api/coding/paas/v4 で試し直し、使えればプロバイダをプランのエンドポイントに切り替えます。キーを追加するときに Coding Plan を選べば起きません。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Coding Plan と従量課金のキーを一緒に使えますか?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "使えます。Zhipu GLM や Z.ai のプロバイダでは、キーごとにどのプラン用かを指定できます。リクエストはそのプランのエンドポイントに送られ、モデル一覧と使用量ウィンドウもそのプランのものになります。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Zhipu GLM と Z.ai のどちらを選べば?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "キーを発行したほうです。open.bigmodel.cn のキーなら Zhipu GLM、z.ai のキーなら Z.ai です。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "GLM-5.3 は思考をオフにできますか?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "GLM-5.3 は常に思考し、思考をオフにするリクエストを受け付けません。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/glm" hreflang="en" lang="en">English</a>
|
||||
<a href="/docs/zh/glm" hreflang="zh" lang="zh">中文</a>
|
||||
<a href="/docs/ja/glm" 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="#add">追加する</a>
|
||||
<a href="#endpoints">プランとエンドポイント</a>
|
||||
<a href="#agents">ツールごとの使い方</a>
|
||||
<a href="#thinking">思考</a>
|
||||
<a href="#usage">残高と使用量</a>
|
||||
<a href="#faq">よくある質問</a>
|
||||
</aside>
|
||||
|
||||
<article>
|
||||
<p class="eyebrow" id="overview">ドキュメント · プロバイダ</p>
|
||||
<h1>GLM Coding Plan を Claude Code・Codex・Gemini CLI・OpenCode で使う</h1>
|
||||
<p class="lede">Zhipu の GLM モデルは、open.bigmodel.cn の Zhipu GLM と api.z.ai の Z.ai の 2 か所から使え、どちらにも従量課金と GLM Coding Plan の 2 つのプランがあります。magpie にキーをプランつきで追加すれば、Claude Code、Codex、Gemini CLI、OpenCode などが magpie のゲートウェイ <code>127.0.0.1:3425</code> を通して GLM を使えます。</p>
|
||||
|
||||
<h2 id="add"><a class="anchor" href="#add">GLM を追加する</a></h2>
|
||||
<ol class="steps">
|
||||
<li><b>キーを取得</b>Zhipu GLM は <a href="https://open.bigmodel.cn/usercenter/proj-mgmt/apikeys">open.bigmodel.cn</a>、Z.ai は <a href="https://z.ai/manage-apikey/apikey-list">z.ai</a> で取得します。</li>
|
||||
<li><b>プロバイダを追加してプランを選ぶ</b><span class="ui">プロバイダ</span> で <span class="ui">+ プロバイダを追加</span> を押し、Zhipu GLM か Z.ai を選び、キーのプラン(<span class="ui">従量課金</span> か <span class="ui">Coding Plan</span>)を選んでキーを貼り付け、保存します。</li>
|
||||
<li><b>ツールで選ぶ</b><span class="ui">エージェント</span> タブで、ツールの行の <code>glm-5.3</code> などの GLM モデルを選びます。</li>
|
||||
</ol>
|
||||
<div class="code"><span class="lang">ターミナル</span><button class="copy" data-copy="ex-add">コピー</button><pre id="ex-add">magpie provider add zhipu sk-… plan=coding # GLM Coding Plan(open.bigmodel.cn)
|
||||
magpie provider add zai sk-… plan=coding # GLM Coding Plan(z.ai)
|
||||
magpie provider add zhipu sk-… plan=api # 従量課金</pre></div>
|
||||
<div class="callout"><b>キーに合ったプランを選んでください。</b>Coding Plan のキーには専用のエンドポイントがあり、従量課金のエンドポイントに送ると残高がないと返されます(429、コード 1113)。そのとき magpie は Coding Plan のエンドポイントで試し直し、使えればプロバイダをプランのエンドポイントに切り替えます。両方に断られたときは、それぞれの返答と直すべき点をエラーに書きます。</div>
|
||||
|
||||
<h2 id="endpoints"><a class="anchor" href="#endpoints">プランとエンドポイント</a></h2>
|
||||
<div class="table-wrap"><table>
|
||||
<tr><th>プリセット</th><th>プラン</th><th>OpenAI Chat Completions</th><th>OpenAI Responses</th><th>Anthropic Messages</th></tr>
|
||||
<tr><td>Zhipu GLM</td><td>従量課金</td><td><code>https://open.bigmodel.cn/api/paas/v4</code></td><td>—</td><td><code>https://open.bigmodel.cn/api/anthropic</code></td></tr>
|
||||
<tr><td>Zhipu GLM</td><td>Coding Plan</td><td><code>https://open.bigmodel.cn/api/coding/paas/v4</code></td><td><code>https://open.bigmodel.cn/api/v1</code></td><td><code>https://open.bigmodel.cn/api/anthropic</code></td></tr>
|
||||
<tr><td>Z.ai</td><td>従量課金</td><td><code>https://api.z.ai/api/paas/v4</code></td><td>—</td><td><code>https://api.z.ai/api/anthropic</code></td></tr>
|
||||
<tr><td>Z.ai</td><td>Coding Plan</td><td><code>https://api.z.ai/api/coding/paas/v4</code></td><td><code>https://api.z.ai/api/v1</code></td><td><code>https://api.z.ai/api/anthropic</code></td></tr>
|
||||
</table></div>
|
||||
<p>Anthropic エンドポイントは両プラン共通で、アカウントに Coding Plan があればそのプランで課金されます。プロバイダのキーはそれぞれ自分のプランを持つので、1 つのプロバイダに従量課金と Coding Plan のキーを並べられ、キーごとのリクエスト・モデル一覧・ウィンドウはそのプランのものになります。</p>
|
||||
|
||||
<h2 id="agents"><a class="anchor" href="#agents">ツールごとの使い方</a></h2>
|
||||
<p><span class="ui">エージェント</span> タブで各ツールの行のモデルをクリックして選ぶか、ターミナルで選びます。各ガイドに、magpie がそのツールの設定に何を書くか、どう元に戻すかがあります。</p>
|
||||
<div class="code"><span class="lang">ターミナル</span><button class="copy" data-copy="ex-agents">コピー</button><pre id="ex-agents">magpie claude zhipu/glm-5.3
|
||||
magpie codex zhipu/glm-5.3
|
||||
magpie gemini model zhipu/glm-5.3
|
||||
magpie opencode zhipu/glm-5.3</pre></div>
|
||||
<ul>
|
||||
<li><b>Claude Code</b> は Anthropic Messages を話し、GLM の Anthropic エンドポイントも同じなので、リクエストはそのまま渡されます。opus・sonnet・haiku の各ティアは、個別に指定しない限り選んだモデルで動きます。<a href="/docs/ja/claude-code-models">Claude Code で他のモデル</a>。</li>
|
||||
<li><b>Codex</b> が話すのは OpenAI Responses だけです。Coding Plan は Responses API を自分で提供しているので Codex のリクエストはそのまま渡され、従量課金では magpie が Chat Completions に変換します。モデルは推論レベル付きで Codex の <code>/model</code> に並びます。<a href="/docs/ja/codex-models">Codex で他のモデル</a>。</li>
|
||||
<li><b>Gemini CLI</b> は Gemini の API を話します。magpie がゲートウェイに向けて変換します。<a href="/docs/ja/gemini-cli-models">Gemini CLI で他のモデル</a>。</li>
|
||||
<li><b>OpenCode</b> には、magpie が <code>opencode.json</code> にモデルを推論バリアントと価格つきで書きます。<a href="/docs/ja/opencode-models">OpenCode で他のモデル</a>。</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="thinking"><a class="anchor" href="#thinking">思考と推論レベル</a></h2>
|
||||
<ul>
|
||||
<li><b>GLM-5.3 は常に思考します。</b>思考をオフにするリクエストは断られます。magpie は思考をオンのまま聞き直すので、ツールにはエラーではなく返答が届きます。</li>
|
||||
<li><b>推論レベル。</b>GLM-5.2 と GLM-5.3 は推論レベルを <code>output_config.effort</code> で受け取り、magpie はツールが求めるレベルをそこに入れます。</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="usage"><a class="anchor" href="#usage">使用量ウィンドウと検索</a></h2>
|
||||
<ul>
|
||||
<li><b>Coding Plan のウィンドウ。</b>Zhipu や Z.ai から読んだプランのウィンドウ(時間単位と週単位の枠、今月の MCP ツール呼び出し回数)が行に表示されます。</li>
|
||||
<li><b>ウェブ検索。</b>Coding Plan のキーがあり、設定で検索サービスを指定していないとき、magpie はプラン専用の検索サービスで GLM モデルのためにウェブを検索します。</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">よくある質問</a></h2>
|
||||
<h3>GLM Coding Plan を Claude Code で使うには?</h3>
|
||||
<p>magpie に Zhipu GLM(open.bigmodel.cn)か Z.ai(api.z.ai)を追加し、キーのプランに Coding Plan を選んでから、Claude Code の行で <code>glm-5.3</code> などの GLM モデルを選ぶか、<code>magpie claude zhipu/glm-5.3</code> を実行します。Claude Code のリクエストは Anthropic エンドポイントに送られ、アカウントに Coding Plan があればそのプランで課金されます。</p>
|
||||
<h3>Codex で GLM は使えますか?</h3>
|
||||
<p>使えます。GLM Coding Plan は Codex が話す OpenAI Responses API を提供しているので、magpie はそのまま渡します。従量課金では、magpie が Codex のリクエストを Chat Completions に変換します。<code>magpie codex zhipu/glm-5.3</code> を実行するか、Codex の行で選んでください。</p>
|
||||
<h3>Coding Plan のキーで「残高不足」(1113)が出るのはなぜ?</h3>
|
||||
<p>Coding Plan のキーを従量課金のエンドポイント <code>https://open.bigmodel.cn/api/paas/v4</code> に送ると、429・コード 1113 が返ります。magpie は Coding Plan のエンドポイント <code>https://open.bigmodel.cn/api/coding/paas/v4</code> で試し直し、使えればプロバイダをプランのエンドポイントに切り替えます。キーを追加するときに Coding Plan を選べば起きません。</p>
|
||||
<h3>Coding Plan と従量課金のキーを一緒に使えますか?</h3>
|
||||
<p>使えます。Zhipu GLM や Z.ai のプロバイダでは、キーごとにどのプラン用かを指定できます。リクエストはそのプランのエンドポイントに送られ、モデル一覧と使用量ウィンドウもそのプランのものになります。</p>
|
||||
<h3>Zhipu GLM と Z.ai のどちらを選べば?</h3>
|
||||
<p>キーを発行したほうです。open.bigmodel.cn のキーなら Zhipu GLM、z.ai のキーなら Z.ai です。</p>
|
||||
<h3>GLM-5.3 は思考をオフにできますか?</h3>
|
||||
<p>GLM-5.3 は常に思考し、思考をオフにするリクエストを受け付けません。magpie は思考をオンのまま聞き直すので、ツールには返答が届きます。</p>
|
||||
|
||||
<p style="margin-top:48px">ツールごとのガイド:<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/opencode-models">OpenCode で他のモデル</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>
|
||||
@@ -0,0 +1,278 @@
|
||||
<!doctype html>
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Kimi K2 と Kimi Code を Claude Code・Codex・Gemini CLI・OpenCode で使う · magpie</title>
|
||||
<meta name="description" content="magpie で Kimi(Moonshot AI)の Kimi K2.6 などのモデルを Claude Code、Codex、Gemini CLI、OpenCode から使う方法:Kimi API キーか Kimi Code メンバーシップのキー、グローバル版と中国版、エンドポイント、思考、Kimi Code の使用量ウィンドウ。">
|
||||
<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/kimi">
|
||||
<link rel="alternate" hreflang="zh" href="https://usemagpie.ai/docs/zh/kimi">
|
||||
<link rel="alternate" hreflang="ja" href="https://usemagpie.ai/docs/ja/kimi">
|
||||
<link rel="alternate" hreflang="x-default" href="https://usemagpie.ai/docs/kimi">
|
||||
<link rel="canonical" href="https://usemagpie.ai/docs/ja/kimi">
|
||||
<link rel="stylesheet" href="/docs.css">
|
||||
<meta property="og:site_name" content="magpie">
|
||||
<meta property="og:title" content="Kimi K2 と Kimi Code を Claude Code・Codex・Gemini CLI・OpenCode で使う">
|
||||
<meta property="og:description" content="magpie で Kimi(Moonshot AI)の Kimi K2.6 などのモデルを Claude Code、Codex、Gemini CLI、OpenCode から使う方法:Kimi API キーか Kimi Code メンバーシップのキー、グローバル版と中国版、エンドポイント、思考、Kimi Code の使用量ウィンドウ。">
|
||||
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
|
||||
<meta property="og:url" content="https://usemagpie.ai/docs/ja/kimi">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@graph": [
|
||||
{
|
||||
"@type": "TechArticle",
|
||||
"headline": "Kimi K2 と Kimi Code を Claude Code・Codex・Gemini CLI・OpenCode で使う",
|
||||
"description": "magpie で Kimi(Moonshot AI)の Kimi K2.6 などのモデルを Claude Code、Codex、Gemini CLI、OpenCode から使う方法:Kimi API キーか Kimi Code メンバーシップのキー、グローバル版と中国版、エンドポイント、思考、Kimi Code の使用量ウィンドウ。",
|
||||
"inLanguage": "ja",
|
||||
"url": "https://usemagpie.ai/docs/ja/kimi",
|
||||
"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": "Kimi K2 を Codex で使うには?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "magpie に Kimi のキーを追加し、Codex の行で kimi-k2.6 などの Kimi モデルを選ぶか、magpie codex moonshot/kimi-k2.6 を実行します。Kimi は Codex が話す Responses API を提供していないので、magpie がリクエストと返答を変換します。ストリーミングとツール呼び出しもそのままです。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Kimi Code のメンバーシップを Claude Code や Codex で使えますか?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "使えます。Kimi Code(または Kimi Code(中国))のプリセットに Kimi Code コンソールのキーを追加します。magpie はメンバーシップ専用のエンドポイントにリクエストを送り、使用量ウィンドウを表示します。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Kimi と Kimi(中国)のどちらを選べば?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "キーを発行したほうです。platform.kimi.ai のキーは Kimi(api.moonshot.ai)、platform.kimi.com のキーは Kimi(中国)(api.moonshot.cn)。Kimi Code も kimi.ai と kimi.com の 2 つに分かれます。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Kimi Code は定額なのに、なぜ費用が表示されますか?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "Kimi Code のモデル一覧は価格を $0 としているので、magpie は同じモデルの Kimi API 価格で各呼び出しを計算します。API で同じ作業をした場合の額で、請求はされません。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Kimi Code でウェブ検索できますか?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "できます。Kimi Code のキーはメンバーシップ専用の検索エンドポイントで検索でき、magpie は自分では検索できない Kimi Code モデルにその検索を渡します。"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
</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/kimi" hreflang="en" lang="en">English</a>
|
||||
<a href="/docs/zh/kimi" hreflang="zh" lang="zh">中文</a>
|
||||
<a href="/docs/ja/kimi" 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="#add">追加する</a>
|
||||
<a href="#endpoints">プランとエンドポイント</a>
|
||||
<a href="#agents">ツールごとの使い方</a>
|
||||
<a href="#thinking">思考</a>
|
||||
<a href="#usage">残高と使用量</a>
|
||||
<a href="#faq">よくある質問</a>
|
||||
</aside>
|
||||
|
||||
<article>
|
||||
<p class="eyebrow" id="overview">ドキュメント · プロバイダ</p>
|
||||
<h1>Kimi K2 と Kimi Code を Claude Code・Codex・Gemini CLI・OpenCode で使う</h1>
|
||||
<p class="lede">Moonshot AI の Kimi には、従量課金の Kimi API と Kimi Code メンバーシップの 2 つがあり、それぞれグローバル版と中国版のエンドポイントがあります。magpie には 4 つすべてのプリセットがあります。キーを一度追加すれば、Claude Code、Codex、Gemini CLI、OpenCode などが magpie のゲートウェイ <code>127.0.0.1:3425</code> を通して Kimi のモデルを使えます。</p>
|
||||
|
||||
<h2 id="add"><a class="anchor" href="#add">Kimi を追加する</a></h2>
|
||||
<ol class="steps">
|
||||
<li><b>キーを取得</b>Kimi API は Kimi プラットフォームの API キーページ、Kimi Code は Kimi Code コンソールで取得します。下の表にそれぞれのリンクがあります。</li>
|
||||
<li><b>プロバイダを追加</b><span class="ui">プロバイダ</span> で <span class="ui">+ プロバイダを追加</span> を押し、キーを発行したプリセット(Kimi、Kimi(中国)、Kimi Code、Kimi Code(中国))を選んでキーを貼り付け、保存します。magpie が Kimi に提供モデルを問い合わせます。</li>
|
||||
<li><b>ツールで選ぶ</b><span class="ui">エージェント</span> タブでツールの行の Kimi モデルを選びます。API なら <code>kimi-k2.6</code>、Kimi Code なら <code>kimi-for-coding</code> などです。</li>
|
||||
</ol>
|
||||
<div class="code"><span class="lang">ターミナル</span><button class="copy" data-copy="ex-add">コピー</button><pre id="ex-add">magpie provider add moonshot sk-… # Kimi API(platform.kimi.ai)
|
||||
magpie provider add moonshot-cn sk-… # Kimi API 中国版(platform.kimi.com)
|
||||
magpie provider add kimi-code sk-… # Kimi Code メンバーシップ
|
||||
magpie provider add kimi-code-cn sk-… # Kimi Code メンバーシップ、中国版</pre></div>
|
||||
<p>モデル ID は <code>provider/model</code> 形式で、<code>moonshot/kimi-k2.6</code>、<code>kimi-code/kimi-for-coding</code> のようになります。並ぶのは、そのとき Kimi があなたのキーに提供しているモデルです。</p>
|
||||
|
||||
<h2 id="endpoints"><a class="anchor" href="#endpoints">プランとエンドポイント</a></h2>
|
||||
<div class="table-wrap"><table>
|
||||
<tr><th>プリセット</th><th>プラン</th><th>OpenAI Chat Completions</th><th>Anthropic Messages</th><th>キーの取得先</th></tr>
|
||||
<tr><td>Kimi</td><td>Kimi API 従量課金</td><td><code>https://api.moonshot.ai/v1</code></td><td><code>https://api.moonshot.ai/anthropic</code></td><td><a href="https://platform.kimi.ai/console/api-keys?aff=magpie">platform.kimi.ai</a></td></tr>
|
||||
<tr><td>Kimi (中国)</td><td>Kimi API 従量課金</td><td><code>https://api.moonshot.cn/v1</code></td><td><code>https://api.moonshot.cn/anthropic</code></td><td><a href="https://platform.kimi.com/console/api-keys?aff=magpie">platform.kimi.com</a></td></tr>
|
||||
<tr><td>Kimi Code</td><td>Kimi Code メンバーシップ</td><td><code>https://api.kimi.ai/coding/v1</code></td><td><code>https://api.kimi.ai/coding</code></td><td><a href="https://www.kimi.ai/code/console?aff=magpie">kimi.ai/code/console</a></td></tr>
|
||||
<tr><td>Kimi Code (中国)</td><td>Kimi Code メンバーシップ</td><td><code>https://api.kimi.com/coding/v1</code></td><td><code>https://api.kimi.com/coding</code></td><td><a href="https://www.kimi.com/code/console?aff=magpie">kimi.com/code/console</a></td></tr>
|
||||
</table></div>
|
||||
<p>キーは発行元のプランと地域のエンドポイントでしか使えないので、キーの取得先に合うプリセットを選んでください。</p>
|
||||
|
||||
<h2 id="agents"><a class="anchor" href="#agents">ツールごとの使い方</a></h2>
|
||||
<p><span class="ui">エージェント</span> タブで各ツールの行のモデルをクリックして選ぶか、ターミナルで選びます。各ガイドに、magpie がそのツールの設定に何を書くか、どう元に戻すかがあります。</p>
|
||||
<div class="code"><span class="lang">ターミナル</span><button class="copy" data-copy="ex-agents">コピー</button><pre id="ex-agents">magpie claude moonshot/kimi-k2.6
|
||||
magpie codex moonshot/kimi-k2.6
|
||||
magpie gemini model moonshot/kimi-k2.6
|
||||
magpie opencode kimi-code/kimi-for-coding</pre></div>
|
||||
<ul>
|
||||
<li><b>Claude Code</b> は Anthropic Messages を話し、Kimi の Anthropic エンドポイントも同じなので、リクエストはそのまま渡されます。opus・sonnet・haiku の各ティアは、個別に指定しない限り選んだモデルで動きます。<a href="/docs/ja/claude-code-models">Claude Code で他のモデル</a>。</li>
|
||||
<li><b>Codex</b> が話すのは OpenAI Responses だけです。Kimi は Chat Completions と Anthropic Messages を提供し、Responses は提供していないので、magpie がリクエストと返答を変換します。ストリーミングとツール呼び出しもそのままです。モデルは推論レベル付きで Codex の <code>/model</code> に並びます。<a href="/docs/ja/codex-models">Codex で他のモデル</a>。</li>
|
||||
<li><b>Gemini CLI</b> は Gemini の API を話します。magpie がゲートウェイに向けて変換します。<a href="/docs/ja/gemini-cli-models">Gemini CLI で他のモデル</a>。</li>
|
||||
<li><b>OpenCode</b> には、magpie が <code>opencode.json</code> にモデルを推論バリアントと価格つきで書きます。<a href="/docs/ja/opencode-models">OpenCode で他のモデル</a>。</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="thinking"><a class="anchor" href="#thinking">思考</a></h2>
|
||||
<p>常に思考する Kimi モデルもあります。Kimi Code(中国)の K3.1 は思考をオフにするリクエストを受け付けません。ツールがオフを求めてモデルが断ったとき、magpie は思考をオンのまま聞き直すので、ツールにはエラーではなく返答が届きます。</p>
|
||||
|
||||
<h2 id="usage"><a class="anchor" href="#usage">残高・使用量ウィンドウ・検索</a></h2>
|
||||
<ul>
|
||||
<li><b>Kimi API。</b>行に残高が表示されます。Kimi(中国)は人民元、Kimi はドルです。</li>
|
||||
<li><b>Kimi Code。</b>Kimi から読んだメンバーシップのウィンドウ(週の枠、5 時間などの短いウィンドウ、月の枠、ブースターパックの残高)が行に表示されます。</li>
|
||||
<li><b>費用。</b>Kimi Code のモデルは $0 と記載されているので、magpie の <span class="ui">使用量</span> タブは同じモデルの Kimi API 価格で計算します。</li>
|
||||
<li><b>ウェブ検索。</b>Kimi Code のキーはメンバーシップ専用の検索エンドポイントで検索でき、magpie は自分では検索できない Kimi Code モデルにそれを渡します。</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">よくある質問</a></h2>
|
||||
<h3>Kimi K2 を Codex で使うには?</h3>
|
||||
<p>magpie に Kimi のキーを追加し、Codex の行で <code>kimi-k2.6</code> などの Kimi モデルを選ぶか、<code>magpie codex moonshot/kimi-k2.6</code> を実行します。Kimi は Codex が話す Responses API を提供していないので、magpie がリクエストと返答を変換します。ストリーミングとツール呼び出しもそのままです。</p>
|
||||
<h3>Kimi Code のメンバーシップを Claude Code や Codex で使えますか?</h3>
|
||||
<p>使えます。Kimi Code(または Kimi Code(中国))のプリセットに Kimi Code コンソールのキーを追加します。magpie はメンバーシップ専用のエンドポイントにリクエストを送り、使用量ウィンドウを表示します。</p>
|
||||
<h3>Kimi と Kimi(中国)のどちらを選べば?</h3>
|
||||
<p>キーを発行したほうです。platform.kimi.ai のキーは Kimi(api.moonshot.ai)、platform.kimi.com のキーは Kimi(中国)(api.moonshot.cn)。Kimi Code も kimi.ai と kimi.com の 2 つに分かれます。</p>
|
||||
<h3>Kimi Code は定額なのに、なぜ費用が表示されますか?</h3>
|
||||
<p>Kimi Code のモデル一覧は価格を $0 としているので、magpie は同じモデルの Kimi API 価格で各呼び出しを計算します。API で同じ作業をした場合の額で、請求はされません。</p>
|
||||
<h3>Kimi Code でウェブ検索できますか?</h3>
|
||||
<p>できます。Kimi Code のキーはメンバーシップ専用の検索エンドポイントで検索でき、magpie は自分では検索できない Kimi Code モデルにその検索を渡します。</p>
|
||||
|
||||
<p style="margin-top:48px">ツールごとのガイド:<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/opencode-models">OpenCode で他のモデル</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>
|
||||
@@ -239,6 +239,8 @@ magpie visible opencode all # すべてに戻す</pre></div>
|
||||
<div class="code"><span class="lang">ターミナル</span><button class="copy" data-copy="ex-oc-back">コピー</button><pre id="ex-oc-back">magpie opencode default</pre></div>
|
||||
<p>magpie を使う前の <code>model</code> と <code>small_model</code> が戻り、<code>magpie</code> プロバイダがファイルから取り除かれます。</p>
|
||||
|
||||
<p><b>プロバイダ別:</b><a href="/docs/ja/deepseek">DeepSeek</a> · <a href="/docs/ja/kimi">Kimi と Kimi Code</a> · <a href="/docs/ja/glm">GLM Coding Plan</a></p>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">よくある質問</a></h2>
|
||||
<h3>OpenCode で DeepSeek を使うには?</h3>
|
||||
<p>magpie に API キーで DeepSeek を追加し、エージェントタブで OpenCode の行に DeepSeek のモデルを選ぶか、magpie opencode deepseek/deepseek-v4-pro を実行します。magpie が <code>opencode.json</code> に magpie プロバイダを追加し、モデルを設定します。</p>
|
||||
|
||||
@@ -0,0 +1,278 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Kimi K2 and Kimi Code in Claude Code, Codex, Gemini CLI and OpenCode · magpie</title>
|
||||
<meta name="description" content="Use Kimi (Moonshot) models such as Kimi K2.6 in Claude Code, Codex, Gemini CLI and OpenCode with magpie: a Kimi API key or a Kimi Code membership key, global or China, the endpoints magpie uses, thinking, and Kimi Code’s usage windows.">
|
||||
<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/kimi">
|
||||
<link rel="alternate" hreflang="zh" href="https://usemagpie.ai/docs/zh/kimi">
|
||||
<link rel="alternate" hreflang="ja" href="https://usemagpie.ai/docs/ja/kimi">
|
||||
<link rel="alternate" hreflang="x-default" href="https://usemagpie.ai/docs/kimi">
|
||||
<link rel="canonical" href="https://usemagpie.ai/docs/kimi">
|
||||
<link rel="stylesheet" href="/docs.css">
|
||||
<meta property="og:site_name" content="magpie">
|
||||
<meta property="og:title" content="Kimi K2 and Kimi Code in Claude Code, Codex, Gemini CLI and OpenCode">
|
||||
<meta property="og:description" content="Use Kimi (Moonshot) models such as Kimi K2.6 in Claude Code, Codex, Gemini CLI and OpenCode with magpie: a Kimi API key or a Kimi Code membership key, global or China, the endpoints magpie uses, thinking, and Kimi Code’s usage windows.">
|
||||
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
|
||||
<meta property="og:url" content="https://usemagpie.ai/docs/kimi">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@graph": [
|
||||
{
|
||||
"@type": "TechArticle",
|
||||
"headline": "Kimi K2 and Kimi Code in Claude Code, Codex, Gemini CLI and OpenCode",
|
||||
"description": "Use Kimi (Moonshot) models such as Kimi K2.6 in Claude Code, Codex, Gemini CLI and OpenCode with magpie: a Kimi API key or a Kimi Code membership key, global or China, the endpoints magpie uses, thinking, and Kimi Code’s usage windows.",
|
||||
"inLanguage": "en",
|
||||
"url": "https://usemagpie.ai/docs/kimi",
|
||||
"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": "How do I use Kimi K2 in Codex?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "Add your Kimi key in magpie, then pick a Kimi model such as kimi-k2.6 on Codex’s row, or run magpie codex moonshot/kimi-k2.6. Kimi serves Chat Completions and Anthropic Messages but not the Responses API Codex speaks, so magpie translates each request and the reply, streaming and tool calls included."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Can I use my Kimi Code membership in Claude Code or Codex?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "Yes. Add the Kimi Code preset (or Kimi Code (China)) with a key from the Kimi Code console. magpie sends requests to the membership’s own endpoints, https://api.kimi.ai/coding for Anthropic Messages and https://api.kimi.ai/coding/v1 for Chat Completions, and shows the membership’s usage windows."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Kimi or Kimi (China): which preset do I pick?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "The one that issued your key. A key from platform.kimi.ai goes with Kimi (api.moonshot.ai); one from platform.kimi.com goes with Kimi (China) (api.moonshot.cn). Kimi Code has the same two: kimi.ai and kimi.com."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Why does Kimi Code show a cost when the membership is prepaid?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "Kimi Code’s model list prices its models at $0, so magpie prices each call at the Kimi API’s price for the same model. The figure shows what the work would have cost on the API; it isn’t charged."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Can Kimi Code search the web for my agent?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "Yes. A Kimi Code key searches the web through the membership’s own search endpoint, so a Kimi Code model that can’t search by itself is given magpie’s search on your plan."
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
</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/kimi" hreflang="en" lang="en">English</a>
|
||||
<a href="/docs/zh/kimi" hreflang="zh" lang="zh">中文</a>
|
||||
<a href="/docs/ja/kimi" 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>On this page</p>
|
||||
<a href="#add">Add it</a>
|
||||
<a href="#endpoints">Plans and endpoints</a>
|
||||
<a href="#agents">In each agent</a>
|
||||
<a href="#thinking">Thinking</a>
|
||||
<a href="#usage">Balance and usage</a>
|
||||
<a href="#faq">FAQ</a>
|
||||
</aside>
|
||||
|
||||
<article>
|
||||
<p class="eyebrow" id="overview">Docs · Provider</p>
|
||||
<h1>Kimi K2 and Kimi Code in Claude Code, Codex, Gemini CLI and OpenCode</h1>
|
||||
<p class="lede">Kimi, from Moonshot AI, comes two ways: the Kimi API, paid as you go, and the Kimi Code membership, each with a global and a China endpoint. magpie has a preset for each of the four. Add a key once, and Claude Code, Codex, Gemini CLI, OpenCode and your other agents can use Kimi’s models through magpie’s gateway at <code>127.0.0.1:3425</code>.</p>
|
||||
|
||||
<h2 id="add"><a class="anchor" href="#add">Add Kimi</a></h2>
|
||||
<ol class="steps">
|
||||
<li><b>Get a key</b>For the Kimi API, from the Kimi platform’s API keys page; for Kimi Code, from the Kimi Code console. The table below links each.</li>
|
||||
<li><b>Add the provider</b>In <span class="ui">Providers</span>, press <span class="ui">+ Add provider</span> and pick the preset that issued your key: Kimi, Kimi (China), Kimi Code or Kimi Code (China). Paste the key and save. magpie asks Kimi which models it serves.</li>
|
||||
<li><b>Pick it for an agent</b>In the <span class="ui">Agents</span> tab, choose a Kimi model on the agent’s row: <code>kimi-k2.6</code> on the API, say, or <code>kimi-for-coding</code> on Kimi Code.</li>
|
||||
</ol>
|
||||
<div class="code"><span class="lang">Terminal</span><button class="copy" data-copy="ex-add">Copy</button><pre id="ex-add">magpie provider add moonshot sk-… # Kimi API (platform.kimi.ai)
|
||||
magpie provider add moonshot-cn sk-… # Kimi API, China (platform.kimi.com)
|
||||
magpie provider add kimi-code sk-… # Kimi Code membership
|
||||
magpie provider add kimi-code-cn sk-… # Kimi Code membership, China</pre></div>
|
||||
<p>Model ids are <code>provider/model</code>: <code>moonshot/kimi-k2.6</code>, <code>kimi-code/kimi-for-coding</code>. The models listed are the ones Kimi serves your key at the time.</p>
|
||||
|
||||
<h2 id="endpoints"><a class="anchor" href="#endpoints">Plans and endpoints</a></h2>
|
||||
<div class="table-wrap"><table>
|
||||
<tr><th>Preset</th><th>Plan</th><th>OpenAI Chat Completions</th><th>Anthropic Messages</th><th>Key from</th></tr>
|
||||
<tr><td>Kimi</td><td>Kimi API, pay as you go</td><td><code>https://api.moonshot.ai/v1</code></td><td><code>https://api.moonshot.ai/anthropic</code></td><td><a href="https://platform.kimi.ai/console/api-keys?aff=magpie">platform.kimi.ai</a></td></tr>
|
||||
<tr><td>Kimi (China)</td><td>Kimi API, pay as you go</td><td><code>https://api.moonshot.cn/v1</code></td><td><code>https://api.moonshot.cn/anthropic</code></td><td><a href="https://platform.kimi.com/console/api-keys?aff=magpie">platform.kimi.com</a></td></tr>
|
||||
<tr><td>Kimi Code</td><td>Kimi Code membership</td><td><code>https://api.kimi.ai/coding/v1</code></td><td><code>https://api.kimi.ai/coding</code></td><td><a href="https://www.kimi.ai/code/console?aff=magpie">kimi.ai/code/console</a></td></tr>
|
||||
<tr><td>Kimi Code (China)</td><td>Kimi Code membership</td><td><code>https://api.kimi.com/coding/v1</code></td><td><code>https://api.kimi.com/coding</code></td><td><a href="https://www.kimi.com/code/console?aff=magpie">kimi.com/code/console</a></td></tr>
|
||||
</table></div>
|
||||
<p>A key works only on the endpoints of the plan and region that issued it, so pick the preset that matches where you got it.</p>
|
||||
|
||||
<h2 id="agents"><a class="anchor" href="#agents">In each agent</a></h2>
|
||||
<p>Pick the model on an agent’s row in the <span class="ui">Agents</span> tab, or from a terminal. Each guide says what magpie writes in that agent’s config and how to switch back.</p>
|
||||
<div class="code"><span class="lang">Terminal</span><button class="copy" data-copy="ex-agents">Copy</button><pre id="ex-agents">magpie claude moonshot/kimi-k2.6
|
||||
magpie codex moonshot/kimi-k2.6
|
||||
magpie gemini model moonshot/kimi-k2.6
|
||||
magpie opencode kimi-code/kimi-for-coding</pre></div>
|
||||
<ul>
|
||||
<li><b>Claude Code</b> speaks Anthropic Messages, and so does Kimi’s Anthropic endpoint, so its requests are passed on as they are. Every tier (opus, sonnet, haiku) runs on the model you pick unless you give one its own. <a href="/docs/claude-code-models">Models in Claude Code</a>.</li>
|
||||
<li><b>Codex</b> speaks only OpenAI Responses. Kimi serves Chat Completions and Anthropic Messages but not Responses, so magpie translates each request and the reply, streaming and tool calls included. The model shows in Codex’s <code>/model</code> with its reasoning efforts. <a href="/docs/codex-models">Models in Codex</a>.</li>
|
||||
<li><b>Gemini CLI</b> speaks Gemini’s API. magpie points it at its gateway and translates. <a href="/docs/gemini-cli-models">Models in Gemini CLI</a>.</li>
|
||||
<li><b>OpenCode</b> gets the model in <code>opencode.json</code>, with its reasoning variants and cost. <a href="/docs/opencode-models">Models in OpenCode</a>.</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="thinking"><a class="anchor" href="#thinking">Thinking</a></h2>
|
||||
<p>Some Kimi models always think: Kimi Code (China)’s K3.1 turns away a request that switches thinking off. When an agent asks for it off and the model refuses, magpie asks again with thinking left on, so the agent gets an answer rather than the error.</p>
|
||||
|
||||
<h2 id="usage"><a class="anchor" href="#usage">Balance, windows and search</a></h2>
|
||||
<ul>
|
||||
<li><b>Kimi API.</b> The row shows your balance: in ¥ for Kimi (China), in $ for Kimi.</li>
|
||||
<li><b>Kimi Code.</b> The row shows the membership’s windows, read from Kimi: the weekly allowance, shorter windows such as five hours, the monthly allowance and a booster pack’s balance.</li>
|
||||
<li><b>Cost.</b> Kimi Code’s models are listed at $0, so magpie’s <span class="ui">Usage</span> tab prices their calls at the Kimi API’s price for the same model.</li>
|
||||
<li><b>Web search.</b> A Kimi Code key searches the web through the membership’s own search endpoint, and magpie gives that search to Kimi Code models that can’t search by themselves.</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">FAQ</a></h2>
|
||||
<h3>How do I use Kimi K2 in Codex?</h3>
|
||||
<p>Add your Kimi key in magpie, then pick a Kimi model such as <code>kimi-k2.6</code> on Codex’s row, or run <code>magpie codex moonshot/kimi-k2.6</code>. Kimi serves Chat Completions and Anthropic Messages but not the Responses API Codex speaks, so magpie translates each request and the reply, streaming and tool calls included.</p>
|
||||
<h3>Can I use my Kimi Code membership in Claude Code or Codex?</h3>
|
||||
<p>Yes. Add the Kimi Code preset (or Kimi Code (China)) with a key from the Kimi Code console. magpie sends requests to the membership’s own endpoints, <code>https://api.kimi.ai/coding</code> for Anthropic Messages and <code>https://api.kimi.ai/coding/v1</code> for Chat Completions, and shows the membership’s usage windows.</p>
|
||||
<h3>Kimi or Kimi (China): which preset do I pick?</h3>
|
||||
<p>The one that issued your key. A key from platform.kimi.ai goes with Kimi (api.moonshot.ai); one from platform.kimi.com goes with Kimi (China) (api.moonshot.cn). Kimi Code has the same two: kimi.ai and kimi.com.</p>
|
||||
<h3>Why does Kimi Code show a cost when the membership is prepaid?</h3>
|
||||
<p>Kimi Code’s model list prices its models at $0, so magpie prices each call at the Kimi API’s price for the same model. The figure shows what the work would have cost on the API; it isn’t charged.</p>
|
||||
<h3>Can Kimi Code search the web for my agent?</h3>
|
||||
<p>Yes. A Kimi Code key searches the web through the membership’s own search endpoint, so a Kimi Code model that can’t search by itself is given magpie’s search on your plan.</p>
|
||||
|
||||
<p style="margin-top:48px">Every agent: <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/opencode-models">Models in OpenCode</a>. Ask on <a href="https://discord.gg/vGSnD3ZKQF">Discord</a> if you get stuck.</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>
|
||||
@@ -239,6 +239,8 @@ magpie visible opencode all # every model again</pre></div>
|
||||
<div class="code"><span class="lang">Terminal</span><button class="copy" data-copy="ex-oc-back">Copy</button><pre id="ex-oc-back">magpie opencode default</pre></div>
|
||||
<p>It puts back the <code>model</code> and <code>small_model</code> OpenCode had before magpie, and takes the <code>magpie</code> provider out of the file.</p>
|
||||
|
||||
<p><b>By provider:</b> <a href="/docs/deepseek">DeepSeek</a> · <a href="/docs/kimi">Kimi and Kimi Code</a> · <a href="/docs/glm">GLM Coding Plan</a></p>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">FAQ</a></h2>
|
||||
<h3>How do I use DeepSeek in OpenCode?</h3>
|
||||
<p>Add DeepSeek with your API key in magpie, then pick a DeepSeek model on OpenCode’s row in the Agents tab, or run magpie opencode deepseek/deepseek-v4-pro. magpie adds a magpie provider to <code>opencode.json</code> and sets the model.</p>
|
||||
|
||||
@@ -251,6 +251,8 @@ magpie claude codex/gpt-5.5</pre></div>
|
||||
</ul>
|
||||
<p>各种路由方式见 <a href="/docs/zh/start#routing">快速上手</a>。</p>
|
||||
|
||||
<p><b>按供应商:</b><a href="/docs/zh/deepseek">DeepSeek</a> · <a href="/docs/zh/kimi">Kimi 与 Kimi Code</a> · <a href="/docs/zh/glm">GLM 编程套餐</a></p>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">常见问题</a></h2>
|
||||
<h3>需要自己设置 <code>ANTHROPIC_BASE_URL</code> 吗?</h3>
|
||||
<p>不需要,magpie 会写进 Claude Code 的 <code>settings.json</code>。如果你的 shell 环境变量里设了 <code>CLAUDE_CODE_USE_BEDROCK</code>、<code>CLAUDE_CODE_USE_VERTEX</code> 等云厂商开关,Claude Code 会把请求发到那个云而不是 magpie;magpie 会提示你,把它从 shell 配置里删掉即可。</p>
|
||||
|
||||
@@ -251,6 +251,8 @@ magpie codex claude/…</pre></div>
|
||||
</ul>
|
||||
<p>各种路由方式见 <a href="/docs/zh/start#routing">快速上手</a>。</p>
|
||||
|
||||
<p><b>按供应商:</b><a href="/docs/zh/deepseek">DeepSeek</a> · <a href="/docs/zh/kimi">Kimi 与 Kimi Code</a> · <a href="/docs/zh/glm">GLM 编程套餐</a></p>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">常见问题</a></h2>
|
||||
<h3>需要自己写 <code>[model_providers]</code> 吗?</h3>
|
||||
<p>不需要。选模型时 magpie 会写好 Codex 的 <code>config.toml</code>,也不用导出 <code>OPENAI_BASE_URL</code>。</p>
|
||||
|
||||
@@ -0,0 +1,284 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>DeepSeek 接入 Claude Code、Codex、Gemini CLI 和 OpenCode · magpie</title>
|
||||
<meta name="description" content="用 magpie 把 DeepSeek V4 接入 Claude Code、Codex、Gemini CLI 和 OpenCode:添加一次 DeepSeek API Key,magpie 用哪些接口地址,思考、推理强度和缓存怎么处理,以及余额。">
|
||||
<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/deepseek">
|
||||
<link rel="alternate" hreflang="zh" href="https://usemagpie.ai/docs/zh/deepseek">
|
||||
<link rel="alternate" hreflang="ja" href="https://usemagpie.ai/docs/ja/deepseek">
|
||||
<link rel="alternate" hreflang="x-default" href="https://usemagpie.ai/docs/deepseek">
|
||||
<link rel="canonical" href="https://usemagpie.ai/docs/zh/deepseek">
|
||||
<link rel="stylesheet" href="/docs.css">
|
||||
<meta property="og:site_name" content="magpie">
|
||||
<meta property="og:title" content="DeepSeek 接入 Claude Code、Codex、Gemini CLI 和 OpenCode">
|
||||
<meta property="og:description" content="用 magpie 把 DeepSeek V4 接入 Claude Code、Codex、Gemini CLI 和 OpenCode:添加一次 DeepSeek API Key,magpie 用哪些接口地址,思考、推理强度和缓存怎么处理,以及余额。">
|
||||
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
|
||||
<meta property="og:url" content="https://usemagpie.ai/docs/zh/deepseek">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@graph": [
|
||||
{
|
||||
"@type": "TechArticle",
|
||||
"headline": "DeepSeek 接入 Claude Code、Codex、Gemini CLI 和 OpenCode",
|
||||
"description": "用 magpie 把 DeepSeek V4 接入 Claude Code、Codex、Gemini CLI 和 OpenCode:添加一次 DeepSeek API Key,magpie 用哪些接口地址,思考、推理强度和缓存怎么处理,以及余额。",
|
||||
"inLanguage": "zh-CN",
|
||||
"url": "https://usemagpie.ai/docs/zh/deepseek",
|
||||
"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": "DeepSeek 怎么接入 Claude Code?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "在 magpie 里添加 DeepSeek 的 API Key(供应商 → 添加供应商 → DeepSeek),然后在 Claude Code 那一行选一个 DeepSeek 模型,比如 deepseek-v4-pro,或者运行 magpie claude deepseek/deepseek-v4-pro。magpie 会写好 Claude Code 的 settings.json,把请求转给 DeepSeek 的 Anthropic 接口 https://api.deepseek.com/anthropic。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Codex 能用 DeepSeek 吗?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "能。DeepSeek 自己就提供 Codex 说的 OpenAI Responses 接口,所以 magpie 把 Codex 的请求原样转过去。在 Codex 那一行选模型,或运行 magpie codex deepseek/deepseek-v4-pro,模型会出现在 Codex 的 /model 里。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "要自己把 ANTHROPIC_BASE_URL 设成 DeepSeek 吗?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "不用。magpie 把 Claude Code 指向本地网关 127.0.0.1:3425,DeepSeek 的 Key 留在 magpie 里。重新选回 Claude Code 自己的模型,原来的设置就回来了。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "同一个对话里能在 Claude 和 DeepSeek 之间切换吗?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "能。DeepSeek 的 Anthropic 接口要求调用工具的轮次带思考块,而在 Claude 上开始的对话没有它能读的思考块。magpie 会补上,所以路由分组可以在对话中途从 Claude 切到 DeepSeek。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "DeepSeek 支持哪些推理强度?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "DeepSeek 只有三档:low、high 和 max,写在 output_config.effort 里,不看 budget_tokens。工具要的档位或 token 预算,magpie 会对到这三档之一。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "可以用多个 DeepSeek Key 吗?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "可以。把它们都加到 DeepSeek 这个供应商里并勾选。magpie 把请求分到各个 Key 上,同一个对话留在同一个 Key 上以复用缓存,某个 Key 余额用完就换下一个。"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
</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/deepseek" hreflang="en" lang="en">English</a>
|
||||
<a href="/docs/zh/deepseek" hreflang="zh" lang="zh">中文</a>
|
||||
<a href="/docs/ja/deepseek" 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="#add">添加</a>
|
||||
<a href="#endpoints">套餐与接口地址</a>
|
||||
<a href="#agents">在各个工具里用</a>
|
||||
<a href="#thinking">思考</a>
|
||||
<a href="#usage">余额与用量</a>
|
||||
<a href="#faq">常见问题</a>
|
||||
</aside>
|
||||
|
||||
<article>
|
||||
<p class="eyebrow" id="overview">文档 · 供应商</p>
|
||||
<h1>DeepSeek 接入 Claude Code、Codex、Gemini CLI 和 OpenCode</h1>
|
||||
<p class="lede">DeepSeek 同时提供 OpenAI 兼容接口和 Anthropic 兼容接口。在 magpie 里添加一次 Key,Claude Code、Codex、Gemini CLI、OpenCode 以及你连接的其他工具,都能通过 magpie 的本地网关 <code>127.0.0.1:3425</code> 用上 DeepSeek 的模型。</p>
|
||||
|
||||
<h2 id="add"><a class="anchor" href="#add">添加 DeepSeek</a></h2>
|
||||
<ol class="steps">
|
||||
<li><b>拿到 API Key</b>在 <a href="https://platform.deepseek.com/api_keys">platform.deepseek.com/api_keys</a> 创建。</li>
|
||||
<li><b>添加供应商</b>在 magpie 的 <span class="ui">供应商</span> 页点 <span class="ui">+ 添加供应商</span>,选 DeepSeek,粘贴 Key 并保存。magpie 会向 DeepSeek 查询它提供哪些模型,比如 <code>deepseek-v4-pro</code> 和 <code>deepseek-v4-flash</code>。</li>
|
||||
<li><b>给工具选上</b>在 <span class="ui">Agent</span> 页点某个工具那一行的模型,选一个 DeepSeek 模型。</li>
|
||||
</ol>
|
||||
<div class="code"><span class="lang">终端</span><button class="copy" data-copy="ex-add">复制</button><pre id="ex-add">magpie provider add deepseek sk-…
|
||||
magpie models # 所有模型,格式是 provider/model</pre></div>
|
||||
<p>magpie 里的模型 ID 是 <code>provider/model</code>,DeepSeek 的就是 <code>deepseek/…</code>。再添加一次预设会多出第二个 DeepSeek 供应商,用另一个 Key;想让请求分到多个 Key 上,就把它们都加到同一个供应商里。</p>
|
||||
|
||||
<h2 id="endpoints"><a class="anchor" href="#endpoints">接口地址</a></h2>
|
||||
<p>DeepSeek 只有按量付费一种计费方式,magpie 用的接口是:</p>
|
||||
<div class="table-wrap"><table>
|
||||
<tr><th>协议</th><th>接口地址</th></tr>
|
||||
<tr><td>OpenAI Chat Completions 和 Responses</td><td><code>https://api.deepseek.com/v1</code></td></tr>
|
||||
<tr><td>Anthropic Messages</td><td><code>https://api.deepseek.com/anthropic</code></td></tr>
|
||||
</table></div>
|
||||
|
||||
<h2 id="agents"><a class="anchor" href="#agents">在各个工具里用</a></h2>
|
||||
<p>在 <span class="ui">Agent</span> 页里点某个工具那一行的模型来选,或者在终端里选。每篇指南都写了 magpie 在那个工具的配置里改了什么、怎么换回去。</p>
|
||||
<div class="code"><span class="lang">终端</span><button class="copy" data-copy="ex-agents">复制</button><pre id="ex-agents">magpie claude deepseek/deepseek-v4-pro
|
||||
magpie codex deepseek/deepseek-v4-pro
|
||||
magpie gemini model deepseek/deepseek-v4-flash
|
||||
magpie opencode deepseek/deepseek-v4-pro</pre></div>
|
||||
<ul>
|
||||
<li><b>Claude Code</b> 说的是 Anthropic Messages,DeepSeek 的 Anthropic 接口也说这种协议,所以请求原样转过去。opus、sonnet、haiku 三档默认都用你选的模型,也可以给某一档单独指定。<a href="/docs/zh/claude-code-models">Claude Code 接入其他模型</a>。</li>
|
||||
<li><b>Codex</b> 只说 OpenAI Responses。DeepSeek 自己就提供 Responses 接口,所以 Codex 的请求原样转过去。模型会出现在 Codex 的 <code>/model</code> 里,带着推理强度。<a href="/docs/zh/codex-models">Codex 接入其他模型</a>。</li>
|
||||
<li><b>Gemini CLI</b> 说 Gemini 的 API。magpie 把它指向本地网关并做转换。<a href="/docs/zh/gemini-cli-models">Gemini CLI 接入其他模型</a>。</li>
|
||||
<li><b>OpenCode</b>:magpie 把模型写进 <code>opencode.json</code>,带上推理档位和价格。<a href="/docs/zh/opencode-models">OpenCode 接入其他模型</a>。</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="thinking"><a class="anchor" href="#thinking">思考、推理强度和缓存</a></h2>
|
||||
<ul>
|
||||
<li><b>工具轮次的思考块。</b>DeepSeek 的 Anthropic 接口要求每个调用工具的助手轮次、以及只回传工具结果的轮次都带思考块。工具的历史里没有时,magpie 会补一个,并把 Claude 的 <code>redacted_thinking</code> 转成可用的思考块。所以路由分组可以在对话中途从 Claude 切到 DeepSeek。</li>
|
||||
<li><b>推理强度。</b>DeepSeek 只有 <code>low</code>、<code>high</code>、<code>max</code> 三档,写在 <code>output_config.effort</code> 里,不看 <code>budget_tokens</code>。工具给的 token 预算会对到这三档之一。</li>
|
||||
<li><b>缓存。</b>有多个 Key 时,magpie 会在对话最后一轮之后的一小时内,让它一直留在同一个 DeepSeek Key 上,下一轮就能读到 DeepSeek 的缓存,而不是不带缓存地发给另一个 Key。</li>
|
||||
<li><b>图片。</b>工具发给 DeepSeek API 的每张图,magpie 只上传一次,之后的轮次用文件 ID 指代。<code>magpie provider set deepseek image-files=off</code> 改成每轮都内联发送。</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="usage"><a class="anchor" href="#usage">余额与用量</a></h2>
|
||||
<p>DeepSeek 那一行会显示从 DeepSeek 读到的余额:总额、赠送金额和充值金额。<span class="ui">用量</span> 页按工具和模型统计经过 magpie 的 token、缓存命中和费用。</p>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">常见问题</a></h2>
|
||||
<h3>DeepSeek 怎么接入 Claude Code?</h3>
|
||||
<p>在 magpie 里添加 DeepSeek 的 API Key(供应商 → 添加供应商 → DeepSeek),然后在 Claude Code 那一行选一个 DeepSeek 模型,比如 <code>deepseek-v4-pro</code>,或者运行 <code>magpie claude deepseek/deepseek-v4-pro</code>。magpie 会写好 Claude Code 的 <code>settings.json</code>,把请求转给 DeepSeek 的 Anthropic 接口 <code>https://api.deepseek.com/anthropic</code>。</p>
|
||||
<h3>Codex 能用 DeepSeek 吗?</h3>
|
||||
<p>能。DeepSeek 自己就提供 Codex 说的 OpenAI Responses 接口,所以 magpie 把 Codex 的请求原样转过去。在 Codex 那一行选模型,或运行 <code>magpie codex deepseek/deepseek-v4-pro</code>,模型会出现在 Codex 的 <code>/model</code> 里。</p>
|
||||
<h3>要自己把 ANTHROPIC_BASE_URL 设成 DeepSeek 吗?</h3>
|
||||
<p>不用。magpie 把 Claude Code 指向本地网关 <code>127.0.0.1:3425</code>,DeepSeek 的 Key 留在 magpie 里。重新选回 Claude Code 自己的模型,原来的设置就回来了。</p>
|
||||
<h3>同一个对话里能在 Claude 和 DeepSeek 之间切换吗?</h3>
|
||||
<p>能。DeepSeek 的 Anthropic 接口要求调用工具的轮次带思考块,而在 Claude 上开始的对话没有它能读的思考块。magpie 会补上,所以路由分组可以在对话中途从 Claude 切到 DeepSeek。</p>
|
||||
<h3>DeepSeek 支持哪些推理强度?</h3>
|
||||
<p>DeepSeek 只有三档:low、high 和 max,写在 <code>output_config.effort</code> 里,不看 <code>budget_tokens</code>。工具要的档位或 token 预算,magpie 会对到这三档之一。</p>
|
||||
<h3>可以用多个 DeepSeek Key 吗?</h3>
|
||||
<p>可以。把它们都加到 DeepSeek 这个供应商里并勾选。magpie 把请求分到各个 Key 上,同一个对话留在同一个 Key 上以复用缓存,某个 Key 余额用完就换下一个。</p>
|
||||
|
||||
<p style="margin-top:48px">各个工具的指南:<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/opencode-models">OpenCode 接入其他模型</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>
|
||||
@@ -235,6 +235,8 @@ magpie gemini model codex/gpt-5.5</pre></div>
|
||||
</ul>
|
||||
<p>路由方式和规则详见 <a href="/docs/zh/start#routing">快速上手</a>。</p>
|
||||
|
||||
<p><b>按供应商:</b><a href="/docs/zh/deepseek">DeepSeek</a> · <a href="/docs/zh/kimi">Kimi 与 Kimi Code</a> · <a href="/docs/zh/glm">GLM 编程套餐</a></p>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">常见问题</a></h2>
|
||||
<h3>Gemini CLI 能用 Gemini 以外的模型吗?</h3>
|
||||
<p>能,需要一个提供 Gemini API 的网关。magpie 在你电脑上跑一个,并把 Gemini CLI 指向它,所以你添加的供应商的任何模型都能用:DeepSeek、Kimi、GLM、通义千问、MiniMax,或者 Claude、ChatGPT、Copilot 订阅。</p>
|
||||
|
||||
@@ -0,0 +1,288 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>GLM 编程套餐接入 Claude Code、Codex、Gemini CLI 和 OpenCode · magpie</title>
|
||||
<meta name="description" content="用 magpie 把智谱 GLM 和 Z.ai 的 GLM-5.3 等模型接入 Claude Code、Codex、Gemini CLI 和 OpenCode:GLM Coding Plan(编程套餐)或按量付费的 Key,各套餐的接口地址,1113「余额不足」的处理,思考,以及套餐的用量窗口。">
|
||||
<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/glm">
|
||||
<link rel="alternate" hreflang="zh" href="https://usemagpie.ai/docs/zh/glm">
|
||||
<link rel="alternate" hreflang="ja" href="https://usemagpie.ai/docs/ja/glm">
|
||||
<link rel="alternate" hreflang="x-default" href="https://usemagpie.ai/docs/glm">
|
||||
<link rel="canonical" href="https://usemagpie.ai/docs/zh/glm">
|
||||
<link rel="stylesheet" href="/docs.css">
|
||||
<meta property="og:site_name" content="magpie">
|
||||
<meta property="og:title" content="GLM 编程套餐接入 Claude Code、Codex、Gemini CLI 和 OpenCode">
|
||||
<meta property="og:description" content="用 magpie 把智谱 GLM 和 Z.ai 的 GLM-5.3 等模型接入 Claude Code、Codex、Gemini CLI 和 OpenCode:GLM Coding Plan(编程套餐)或按量付费的 Key,各套餐的接口地址,1113「余额不足」的处理,思考,以及套餐的用量窗口。">
|
||||
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
|
||||
<meta property="og:url" content="https://usemagpie.ai/docs/zh/glm">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@graph": [
|
||||
{
|
||||
"@type": "TechArticle",
|
||||
"headline": "GLM 编程套餐接入 Claude Code、Codex、Gemini CLI 和 OpenCode",
|
||||
"description": "用 magpie 把智谱 GLM 和 Z.ai 的 GLM-5.3 等模型接入 Claude Code、Codex、Gemini CLI 和 OpenCode:GLM Coding Plan(编程套餐)或按量付费的 Key,各套餐的接口地址,1113「余额不足」的处理,思考,以及套餐的用量窗口。",
|
||||
"inLanguage": "zh-CN",
|
||||
"url": "https://usemagpie.ai/docs/zh/glm",
|
||||
"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": "GLM 编程套餐怎么接入 Claude Code?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "在 magpie 里添加智谱 GLM(open.bigmodel.cn)或 Z.ai(api.z.ai),把 Key 的套餐选成 Coding Plan,然后在 Claude Code 那一行选 glm-5.3 这类模型,或者运行 magpie claude zhipu/glm-5.3。Claude Code 的请求走 Anthropic 接口,账号有编程套餐时按套餐计费。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "GLM 能在 Codex 里用吗?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "能。GLM Coding Plan 自己就提供 Codex 说的 OpenAI Responses 接口,magpie 原样转过去;按量付费的话,magpie 把 Codex 的请求转成 Chat Completions。运行 magpie codex zhipu/glm-5.3,或在 Codex 那一行选上。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "GLM 编程套餐的 Key 为什么提示余额不足(1113)?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "编程套餐的 Key 发到按量付费的接口 https://open.bigmodel.cn/api/paas/v4,会收到 429、错误码 1113。magpie 会改用编程套餐的接口 https://open.bigmodel.cn/api/coding/paas/v4 再试,能用的话就把这个供应商切到套餐的接口。添加 Key 时选对 Coding Plan 就不会遇到。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "编程套餐的 Key 和按量付费的 Key 能同时用吗?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "能。智谱 GLM 或 Z.ai 供应商里的每个 Key 都可以标明自己属于哪个套餐,请求发到那个套餐的接口,模型列表和用量窗口也按那个套餐来。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "智谱 GLM 和 Z.ai 选哪个?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "看 Key 是哪里发的:open.bigmodel.cn 的 Key 选智谱 GLM,z.ai 的 Key 选 Z.ai。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "GLM-5.3 能关掉思考吗?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "GLM-5.3 一直在思考,不接受关掉思考的请求。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/glm" hreflang="en" lang="en">English</a>
|
||||
<a href="/docs/zh/glm" hreflang="zh" lang="zh">中文</a>
|
||||
<a href="/docs/ja/glm" 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="#add">添加</a>
|
||||
<a href="#endpoints">套餐与接口地址</a>
|
||||
<a href="#agents">在各个工具里用</a>
|
||||
<a href="#thinking">思考</a>
|
||||
<a href="#usage">余额与用量</a>
|
||||
<a href="#faq">常见问题</a>
|
||||
</aside>
|
||||
|
||||
<article>
|
||||
<p class="eyebrow" id="overview">文档 · 供应商</p>
|
||||
<h1>GLM 编程套餐接入 Claude Code、Codex、Gemini CLI 和 OpenCode</h1>
|
||||
<p class="lede">智谱的 GLM 模型有两个入口:open.bigmodel.cn 的智谱 GLM 和 api.z.ai 的 Z.ai,每个都有两种套餐:按量付费和 GLM Coding Plan(编程套餐)。在 magpie 里添加 Key 并选好套餐,Claude Code、Codex、Gemini CLI、OpenCode 和其他工具就都能通过 magpie 的本地网关 <code>127.0.0.1:3425</code> 用 GLM。</p>
|
||||
|
||||
<h2 id="add"><a class="anchor" href="#add">添加 GLM</a></h2>
|
||||
<ol class="steps">
|
||||
<li><b>拿到 Key</b>智谱 GLM 在 <a href="https://open.bigmodel.cn/usercenter/proj-mgmt/apikeys">open.bigmodel.cn</a>,Z.ai 在 <a href="https://z.ai/manage-apikey/apikey-list">z.ai</a>。</li>
|
||||
<li><b>添加供应商并选套餐</b>在 <span class="ui">供应商</span> 页点 <span class="ui">+ 添加供应商</span>,选智谱 GLM 或 Z.ai,选 Key 对应的套餐(<span class="ui">按量付费</span> 或 <span class="ui">Coding Plan</span>),粘贴 Key 并保存。</li>
|
||||
<li><b>给工具选上</b>在 <span class="ui">Agent</span> 页给某个工具选 <code>glm-5.3</code> 这类 GLM 模型。</li>
|
||||
</ol>
|
||||
<div class="code"><span class="lang">终端</span><button class="copy" data-copy="ex-add">复制</button><pre id="ex-add">magpie provider add zhipu sk-… plan=coding # GLM 编程套餐(open.bigmodel.cn)
|
||||
magpie provider add zai sk-… plan=coding # GLM Coding Plan(z.ai)
|
||||
magpie provider add zhipu sk-… plan=api # 按量付费</pre></div>
|
||||
<div class="callout"><b>选 Key 对应的套餐。</b>编程套餐的 Key 有自己的接口地址,发到按量付费的接口会提示余额不足(429,错误码 1113)。遇到这种情况,magpie 会改用编程套餐的接口再试,能用就把供应商切到套餐的接口;两边都拒绝时,报错会写清两边各说了什么、该改哪里。</div>
|
||||
|
||||
<h2 id="endpoints"><a class="anchor" href="#endpoints">套餐与接口地址</a></h2>
|
||||
<div class="table-wrap"><table>
|
||||
<tr><th>预设</th><th>套餐</th><th>OpenAI Chat Completions</th><th>OpenAI Responses</th><th>Anthropic Messages</th></tr>
|
||||
<tr><td>智谱 GLM</td><td>按量付费</td><td><code>https://open.bigmodel.cn/api/paas/v4</code></td><td>—</td><td><code>https://open.bigmodel.cn/api/anthropic</code></td></tr>
|
||||
<tr><td>智谱 GLM</td><td>Coding Plan(编程套餐)</td><td><code>https://open.bigmodel.cn/api/coding/paas/v4</code></td><td><code>https://open.bigmodel.cn/api/v1</code></td><td><code>https://open.bigmodel.cn/api/anthropic</code></td></tr>
|
||||
<tr><td>Z.ai</td><td>按量付费</td><td><code>https://api.z.ai/api/paas/v4</code></td><td>—</td><td><code>https://api.z.ai/api/anthropic</code></td></tr>
|
||||
<tr><td>Z.ai</td><td>Coding Plan(编程套餐)</td><td><code>https://api.z.ai/api/coding/paas/v4</code></td><td><code>https://api.z.ai/api/v1</code></td><td><code>https://api.z.ai/api/anthropic</code></td></tr>
|
||||
</table></div>
|
||||
<p>两种套餐共用 Anthropic 接口,账号有编程套餐时按套餐计费。供应商里的每个 Key 都标明自己的套餐,所以一个供应商可以同时放按量付费和编程套餐的 Key,每个 Key 的请求、模型列表和用量窗口都按它自己的套餐来。</p>
|
||||
|
||||
<h2 id="agents"><a class="anchor" href="#agents">在各个工具里用</a></h2>
|
||||
<p>在 <span class="ui">Agent</span> 页里点某个工具那一行的模型来选,或者在终端里选。每篇指南都写了 magpie 在那个工具的配置里改了什么、怎么换回去。</p>
|
||||
<div class="code"><span class="lang">终端</span><button class="copy" data-copy="ex-agents">复制</button><pre id="ex-agents">magpie claude zhipu/glm-5.3
|
||||
magpie codex zhipu/glm-5.3
|
||||
magpie gemini model zhipu/glm-5.3
|
||||
magpie opencode zhipu/glm-5.3</pre></div>
|
||||
<ul>
|
||||
<li><b>Claude Code</b> 说的是 Anthropic Messages,GLM 的 Anthropic 接口也说这种协议,所以请求原样转过去。opus、sonnet、haiku 三档默认都用你选的模型,也可以给某一档单独指定。<a href="/docs/zh/claude-code-models">Claude Code 接入其他模型</a>。</li>
|
||||
<li><b>Codex</b> 只说 OpenAI Responses。编程套餐自己就提供 Responses 接口,Codex 的请求原样转过去;按量付费时,magpie 把它转成 Chat Completions。模型会出现在 Codex 的 <code>/model</code> 里,带着推理强度。<a href="/docs/zh/codex-models">Codex 接入其他模型</a>。</li>
|
||||
<li><b>Gemini CLI</b> 说 Gemini 的 API。magpie 把它指向本地网关并做转换。<a href="/docs/zh/gemini-cli-models">Gemini CLI 接入其他模型</a>。</li>
|
||||
<li><b>OpenCode</b>:magpie 把模型写进 <code>opencode.json</code>,带上推理档位和价格。<a href="/docs/zh/opencode-models">OpenCode 接入其他模型</a>。</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="thinking"><a class="anchor" href="#thinking">思考与推理强度</a></h2>
|
||||
<ul>
|
||||
<li><b>GLM-5.3 一直在思考。</b>它不接受关掉思考的请求。magpie 会保持思考开启再问一次,工具拿到的是回答而不是报错。</li>
|
||||
<li><b>推理强度。</b>GLM-5.2 和 GLM-5.3 的推理档位写在 <code>output_config.effort</code> 里,magpie 把工具要的档位放在那里。</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="usage"><a class="anchor" href="#usage">用量窗口与搜索</a></h2>
|
||||
<ul>
|
||||
<li><b>编程套餐的窗口。</b>那一行显示从智谱或 Z.ai 读到的套餐窗口:按小时和按周的额度,以及本月的 MCP 工具调用次数。</li>
|
||||
<li><b>联网搜索。</b>有编程套餐的 Key、且设置里没指定搜索服务时,magpie 用套餐自带的搜索服务给 GLM 模型联网搜索。</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">常见问题</a></h2>
|
||||
<h3>GLM 编程套餐怎么接入 Claude Code?</h3>
|
||||
<p>在 magpie 里添加智谱 GLM(open.bigmodel.cn)或 Z.ai(api.z.ai),把 Key 的套餐选成 Coding Plan,然后在 Claude Code 那一行选 <code>glm-5.3</code> 这类模型,或者运行 <code>magpie claude zhipu/glm-5.3</code>。Claude Code 的请求走 Anthropic 接口,账号有编程套餐时按套餐计费。</p>
|
||||
<h3>GLM 能在 Codex 里用吗?</h3>
|
||||
<p>能。GLM Coding Plan 自己就提供 Codex 说的 OpenAI Responses 接口,magpie 原样转过去;按量付费的话,magpie 把 Codex 的请求转成 Chat Completions。运行 <code>magpie codex zhipu/glm-5.3</code>,或在 Codex 那一行选上。</p>
|
||||
<h3>GLM 编程套餐的 Key 为什么提示余额不足(1113)?</h3>
|
||||
<p>编程套餐的 Key 发到按量付费的接口 <code>https://open.bigmodel.cn/api/paas/v4</code>,会收到 429、错误码 1113。magpie 会改用编程套餐的接口 <code>https://open.bigmodel.cn/api/coding/paas/v4</code> 再试,能用的话就把这个供应商切到套餐的接口。添加 Key 时选对 Coding Plan 就不会遇到。</p>
|
||||
<h3>编程套餐的 Key 和按量付费的 Key 能同时用吗?</h3>
|
||||
<p>能。智谱 GLM 或 Z.ai 供应商里的每个 Key 都可以标明自己属于哪个套餐,请求发到那个套餐的接口,模型列表和用量窗口也按那个套餐来。</p>
|
||||
<h3>智谱 GLM 和 Z.ai 选哪个?</h3>
|
||||
<p>看 Key 是哪里发的:open.bigmodel.cn 的 Key 选智谱 GLM,z.ai 的 Key 选 Z.ai。</p>
|
||||
<h3>GLM-5.3 能关掉思考吗?</h3>
|
||||
<p>GLM-5.3 一直在思考,不接受关掉思考的请求。magpie 会保持思考开启再问一次,工具拿到的是回答。</p>
|
||||
|
||||
<p style="margin-top:48px">各个工具的指南:<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/opencode-models">OpenCode 接入其他模型</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>
|
||||
@@ -0,0 +1,278 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Kimi K2 和 Kimi Code 套餐接入 Claude Code、Codex、Gemini CLI 和 OpenCode · magpie</title>
|
||||
<meta name="description" content="用 magpie 把 Kimi(月之暗面)的 Kimi K2.6 等模型接入 Claude Code、Codex、Gemini CLI 和 OpenCode:Kimi API Key 或 Kimi Code 会员 Key,国际版或国内版,magpie 用的接口地址、思考处理和 Kimi Code 的用量窗口。">
|
||||
<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/kimi">
|
||||
<link rel="alternate" hreflang="zh" href="https://usemagpie.ai/docs/zh/kimi">
|
||||
<link rel="alternate" hreflang="ja" href="https://usemagpie.ai/docs/ja/kimi">
|
||||
<link rel="alternate" hreflang="x-default" href="https://usemagpie.ai/docs/kimi">
|
||||
<link rel="canonical" href="https://usemagpie.ai/docs/zh/kimi">
|
||||
<link rel="stylesheet" href="/docs.css">
|
||||
<meta property="og:site_name" content="magpie">
|
||||
<meta property="og:title" content="Kimi K2 和 Kimi Code 套餐接入 Claude Code、Codex、Gemini CLI 和 OpenCode">
|
||||
<meta property="og:description" content="用 magpie 把 Kimi(月之暗面)的 Kimi K2.6 等模型接入 Claude Code、Codex、Gemini CLI 和 OpenCode:Kimi API Key 或 Kimi Code 会员 Key,国际版或国内版,magpie 用的接口地址、思考处理和 Kimi Code 的用量窗口。">
|
||||
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
|
||||
<meta property="og:url" content="https://usemagpie.ai/docs/zh/kimi">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@graph": [
|
||||
{
|
||||
"@type": "TechArticle",
|
||||
"headline": "Kimi K2 和 Kimi Code 套餐接入 Claude Code、Codex、Gemini CLI 和 OpenCode",
|
||||
"description": "用 magpie 把 Kimi(月之暗面)的 Kimi K2.6 等模型接入 Claude Code、Codex、Gemini CLI 和 OpenCode:Kimi API Key 或 Kimi Code 会员 Key,国际版或国内版,magpie 用的接口地址、思考处理和 Kimi Code 的用量窗口。",
|
||||
"inLanguage": "zh-CN",
|
||||
"url": "https://usemagpie.ai/docs/zh/kimi",
|
||||
"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": "Kimi Code 套餐能在 Codex 里用吗?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "能。在 magpie 里添加 Kimi Code(或 Kimi Code(国内))预设,填上 Kimi Code 控制台里的 Key,然后在 Codex 那一行选模型,比如 kimi-for-coding。Kimi 不提供 Codex 说的 Responses 接口,magpie 会转换请求和回复,流式输出和工具调用都保留。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Kimi K2 怎么接入 Codex?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "添加 Kimi 的 API Key,然后在 Codex 那一行选 kimi-k2.6 这类模型,或者运行 magpie codex moonshot/kimi-k2.6。magpie 把 Codex 的 Responses 请求转换成 Kimi 的接口。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Kimi 和 Kimi(国内)选哪个?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "看 Key 是哪里发的。platform.kimi.ai 的 Key 用 Kimi(api.moonshot.ai),platform.kimi.com 的用 Kimi(国内)(api.moonshot.cn)。Kimi Code 也一样分 kimi.ai 和 kimi.com 两个。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Kimi Code 是包月的,为什么用量里还有费用?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "Kimi Code 的模型列表把价格写成 $0,magpie 就按 Kimi API 上同一个模型的价格来算每次调用。这个数字表示同样的活在 API 上要花多少,并不会扣费。"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Kimi Code 能帮工具联网搜索吗?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "能。Kimi Code 的 Key 可以用会员自带的搜索接口联网搜索,magpie 会把这个搜索提供给自己不能搜索的 Kimi Code 模型。"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
</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/kimi" hreflang="en" lang="en">English</a>
|
||||
<a href="/docs/zh/kimi" hreflang="zh" lang="zh">中文</a>
|
||||
<a href="/docs/ja/kimi" 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="#add">添加</a>
|
||||
<a href="#endpoints">套餐与接口地址</a>
|
||||
<a href="#agents">在各个工具里用</a>
|
||||
<a href="#thinking">思考</a>
|
||||
<a href="#usage">余额与用量</a>
|
||||
<a href="#faq">常见问题</a>
|
||||
</aside>
|
||||
|
||||
<article>
|
||||
<p class="eyebrow" id="overview">文档 · 供应商</p>
|
||||
<h1>Kimi K2 和 Kimi Code 套餐接入 Claude Code、Codex、Gemini CLI 和 OpenCode</h1>
|
||||
<p class="lede">月之暗面的 Kimi 有两种用法:按量付费的 Kimi API,和 Kimi Code 会员套餐,各有国际版和国内版接口。magpie 给这四种都做了预设。添加一次 Key,Claude Code、Codex、Gemini CLI、OpenCode 和其他工具就都能通过 magpie 的本地网关 <code>127.0.0.1:3425</code> 用上 Kimi 的模型。</p>
|
||||
|
||||
<h2 id="add"><a class="anchor" href="#add">添加 Kimi</a></h2>
|
||||
<ol class="steps">
|
||||
<li><b>拿到 Key</b>Kimi API 的 Key 在 Kimi 开放平台的 API Key 页面;Kimi Code 的在 Kimi Code 控制台。下表有各自的链接。</li>
|
||||
<li><b>添加供应商</b>在 <span class="ui">供应商</span> 页点 <span class="ui">+ 添加供应商</span>,选发这个 Key 的预设:Kimi、Kimi(国内)、Kimi Code 或 Kimi Code(国内)。粘贴 Key 并保存,magpie 会向 Kimi 查询可用的模型。</li>
|
||||
<li><b>给工具选上</b>在 <span class="ui">Agent</span> 页给某个工具选 Kimi 模型:API 上比如 <code>kimi-k2.6</code>,Kimi Code 上比如 <code>kimi-for-coding</code>。</li>
|
||||
</ol>
|
||||
<div class="code"><span class="lang">终端</span><button class="copy" data-copy="ex-add">复制</button><pre id="ex-add">magpie provider add moonshot sk-… # Kimi API(platform.kimi.ai)
|
||||
magpie provider add moonshot-cn sk-… # Kimi API 国内版(platform.kimi.com)
|
||||
magpie provider add kimi-code sk-… # Kimi Code 会员
|
||||
magpie provider add kimi-code-cn sk-… # Kimi Code 会员,国内版</pre></div>
|
||||
<p>模型 ID 是 <code>provider/model</code>,比如 <code>moonshot/kimi-k2.6</code>、<code>kimi-code/kimi-for-coding</code>。列出的模型就是 Kimi 当时给你的 Key 提供的。</p>
|
||||
|
||||
<h2 id="endpoints"><a class="anchor" href="#endpoints">套餐与接口地址</a></h2>
|
||||
<div class="table-wrap"><table>
|
||||
<tr><th>预设</th><th>计费</th><th>OpenAI Chat Completions</th><th>Anthropic Messages</th><th>Key 在哪拿</th></tr>
|
||||
<tr><td>Kimi</td><td>Kimi API 按量付费</td><td><code>https://api.moonshot.ai/v1</code></td><td><code>https://api.moonshot.ai/anthropic</code></td><td><a href="https://platform.kimi.ai/console/api-keys?aff=magpie">platform.kimi.ai</a></td></tr>
|
||||
<tr><td>Kimi (国内)</td><td>Kimi API 按量付费</td><td><code>https://api.moonshot.cn/v1</code></td><td><code>https://api.moonshot.cn/anthropic</code></td><td><a href="https://platform.kimi.com/console/api-keys?aff=magpie">platform.kimi.com</a></td></tr>
|
||||
<tr><td>Kimi Code</td><td>Kimi Code 会员</td><td><code>https://api.kimi.ai/coding/v1</code></td><td><code>https://api.kimi.ai/coding</code></td><td><a href="https://www.kimi.ai/code/console?aff=magpie">kimi.ai/code/console</a></td></tr>
|
||||
<tr><td>Kimi Code (国内)</td><td>Kimi Code 会员</td><td><code>https://api.kimi.com/coding/v1</code></td><td><code>https://api.kimi.com/coding</code></td><td><a href="https://www.kimi.com/code/console?aff=magpie">kimi.com/code/console</a></td></tr>
|
||||
</table></div>
|
||||
<p>Key 只能用在发它的套餐和地区的接口上,所以要选和 Key 来源对应的预设。</p>
|
||||
|
||||
<h2 id="agents"><a class="anchor" href="#agents">在各个工具里用</a></h2>
|
||||
<p>在 <span class="ui">Agent</span> 页里点某个工具那一行的模型来选,或者在终端里选。每篇指南都写了 magpie 在那个工具的配置里改了什么、怎么换回去。</p>
|
||||
<div class="code"><span class="lang">终端</span><button class="copy" data-copy="ex-agents">复制</button><pre id="ex-agents">magpie claude moonshot/kimi-k2.6
|
||||
magpie codex moonshot/kimi-k2.6
|
||||
magpie gemini model moonshot/kimi-k2.6
|
||||
magpie opencode kimi-code/kimi-for-coding</pre></div>
|
||||
<ul>
|
||||
<li><b>Claude Code</b> 说的是 Anthropic Messages,Kimi 的 Anthropic 接口也说这种协议,所以请求原样转过去。opus、sonnet、haiku 三档默认都用你选的模型,也可以给某一档单独指定。<a href="/docs/zh/claude-code-models">Claude Code 接入其他模型</a>。</li>
|
||||
<li><b>Codex</b> 只说 OpenAI Responses。Kimi 提供 Chat Completions 和 Anthropic Messages,不提供 Responses,所以 magpie 会转换请求和回复,流式输出和工具调用都保留。模型会出现在 Codex 的 <code>/model</code> 里,带着推理强度。<a href="/docs/zh/codex-models">Codex 接入其他模型</a>。</li>
|
||||
<li><b>Gemini CLI</b> 说 Gemini 的 API。magpie 把它指向本地网关并做转换。<a href="/docs/zh/gemini-cli-models">Gemini CLI 接入其他模型</a>。</li>
|
||||
<li><b>OpenCode</b>:magpie 把模型写进 <code>opencode.json</code>,带上推理档位和价格。<a href="/docs/zh/opencode-models">OpenCode 接入其他模型</a>。</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="thinking"><a class="anchor" href="#thinking">思考</a></h2>
|
||||
<p>有的 Kimi 模型一直在思考:Kimi Code(国内)的 K3.1 不接受关掉思考的请求。工具要求关掉思考而模型拒绝时,magpie 会保持思考开启再问一次,工具拿到的是回答而不是报错。</p>
|
||||
|
||||
<h2 id="usage"><a class="anchor" href="#usage">余额、用量窗口和搜索</a></h2>
|
||||
<ul>
|
||||
<li><b>Kimi API。</b>那一行显示余额:Kimi(国内)用人民币,Kimi 用美元。</li>
|
||||
<li><b>Kimi Code。</b>那一行显示从 Kimi 读到的会员用量窗口:每周额度、5 小时这类更短的窗口、每月额度,以及加油包余额。</li>
|
||||
<li><b>费用。</b>Kimi Code 的模型标价是 $0,magpie 的 <span class="ui">用量</span> 页按 Kimi API 上同一模型的价格来算。</li>
|
||||
<li><b>联网搜索。</b>Kimi Code 的 Key 可以用会员自带的搜索接口,magpie 会把它提供给自己不能搜索的 Kimi Code 模型。</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">常见问题</a></h2>
|
||||
<h3>Kimi Code 套餐能在 Codex 里用吗?</h3>
|
||||
<p>能。在 magpie 里添加 Kimi Code(或 Kimi Code(国内))预设,填上 Kimi Code 控制台里的 Key,然后在 Codex 那一行选模型,比如 <code>kimi-for-coding</code>。Kimi 不提供 Codex 说的 Responses 接口,magpie 会转换请求和回复,流式输出和工具调用都保留。</p>
|
||||
<h3>Kimi K2 怎么接入 Codex?</h3>
|
||||
<p>添加 Kimi 的 API Key,然后在 Codex 那一行选 <code>kimi-k2.6</code> 这类模型,或者运行 <code>magpie codex moonshot/kimi-k2.6</code>。magpie 把 Codex 的 Responses 请求转换成 Kimi 的接口。</p>
|
||||
<h3>Kimi 和 Kimi(国内)选哪个?</h3>
|
||||
<p>看 Key 是哪里发的。platform.kimi.ai 的 Key 用 Kimi(api.moonshot.ai),platform.kimi.com 的用 Kimi(国内)(api.moonshot.cn)。Kimi Code 也一样分 kimi.ai 和 kimi.com 两个。</p>
|
||||
<h3>Kimi Code 是包月的,为什么用量里还有费用?</h3>
|
||||
<p>Kimi Code 的模型列表把价格写成 $0,magpie 就按 Kimi API 上同一个模型的价格来算每次调用。这个数字表示同样的活在 API 上要花多少,并不会扣费。</p>
|
||||
<h3>Kimi Code 能帮工具联网搜索吗?</h3>
|
||||
<p>能。Kimi Code 的 Key 可以用会员自带的搜索接口联网搜索,magpie 会把这个搜索提供给自己不能搜索的 Kimi Code 模型。</p>
|
||||
|
||||
<p style="margin-top:48px">各个工具的指南:<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/opencode-models">OpenCode 接入其他模型</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>
|
||||
@@ -239,6 +239,8 @@ magpie visible opencode all # 恢复显示全部</pre></div>
|
||||
<div class="code"><span class="lang">终端</span><button class="copy" data-copy="ex-oc-back">复制</button><pre id="ex-oc-back">magpie opencode default</pre></div>
|
||||
<p>它会恢复接入 magpie 之前的 <code>model</code> 和 <code>small_model</code>,并把 <code>magpie</code> 供应商从文件里删掉。</p>
|
||||
|
||||
<p><b>按供应商:</b><a href="/docs/zh/deepseek">DeepSeek</a> · <a href="/docs/zh/kimi">Kimi 与 Kimi Code</a> · <a href="/docs/zh/glm">GLM 编程套餐</a></p>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">常见问题</a></h2>
|
||||
<h3>OpenCode 怎么用 DeepSeek?</h3>
|
||||
<p>在 magpie 里用 API Key 添加 DeepSeek,然后在 Agent 页给 OpenCode 选一个 DeepSeek 模型,或运行 magpie opencode deepseek/deepseek-v4-pro。magpie 会在 <code>opencode.json</code> 里加上 magpie 供应商并设好模型。</p>
|
||||
|
||||
@@ -43,6 +43,9 @@ DeepSeek, Kimi (Moonshot), GLM (Zhipu), Qwen, MiniMax, Anthropic (Claude), OpenA
|
||||
- [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.
|
||||
- [DeepSeek in every agent](https://usemagpie.ai/docs/deepseek): use DeepSeek V4 in Claude Code, Codex, Gemini CLI and OpenCode; the API key, endpoints, thinking on tool turns, reasoning effort, prompt cache and balance.
|
||||
- [Kimi K2 and Kimi Code in every agent](https://usemagpie.ai/docs/kimi): Kimi API or Kimi Code membership keys, global and China endpoints, in Claude Code, Codex, Gemini CLI and OpenCode; usage windows and web search.
|
||||
- [GLM Coding Plan in every agent](https://usemagpie.ai/docs/glm): Zhipu GLM and Z.ai, pay as you go or Coding Plan, each plan's endpoints, the 1113 "insufficient balance" fix, thinking and plan windows.
|
||||
- [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.
|
||||
- [Library](https://usemagpie.ai/docs/library): instructions, MCP servers, skills, hooks and subagents for each agent.
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
<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>
|
||||
<url><loc>https://usemagpie.ai/docs/deepseek</loc></url>
|
||||
<url><loc>https://usemagpie.ai/docs/kimi</loc></url>
|
||||
<url><loc>https://usemagpie.ai/docs/glm</loc></url>
|
||||
<url><loc>https://usemagpie.ai/docs/zh/claude-code-models</loc></url>
|
||||
<url><loc>https://usemagpie.ai/docs/zh/codex-models</loc></url>
|
||||
<url><loc>https://usemagpie.ai/docs/zh/contributors</loc></url>
|
||||
@@ -42,6 +45,9 @@
|
||||
<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>
|
||||
<url><loc>https://usemagpie.ai/docs/zh/deepseek</loc></url>
|
||||
<url><loc>https://usemagpie.ai/docs/zh/kimi</loc></url>
|
||||
<url><loc>https://usemagpie.ai/docs/zh/glm</loc></url>
|
||||
<url><loc>https://usemagpie.ai/docs/ja/claude-code-models</loc></url>
|
||||
<url><loc>https://usemagpie.ai/docs/ja/codex-models</loc></url>
|
||||
<url><loc>https://usemagpie.ai/docs/ja/contributors</loc></url>
|
||||
@@ -60,4 +66,7 @@
|
||||
<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>
|
||||
<url><loc>https://usemagpie.ai/docs/ja/deepseek</loc></url>
|
||||
<url><loc>https://usemagpie.ai/docs/ja/kimi</loc></url>
|
||||
<url><loc>https://usemagpie.ai/docs/ja/glm</loc></url>
|
||||
</urlset>
|
||||
|
||||
Reference in New Issue
Block a user