providers: AIGoCode is a preset that takes a key (MindfulReturn on X)
MindfulReturn on X asked why magpie's plugins have no AIGoCode sign-in
and whether they have to add the provider by hand. AIGoCode has no
sign-in to plug in: it hands out API keys, each bound to one group. So
the answer is a preset, like 鱼鱼连线's, not a plugin: Add provider ›
AIGoCode asks only for the key.
From AIGoCode's own docs (www.aigocode.net/docs/api, openai-compatible,
anthropic-compatible, responses): one root, https://api.aigocode.dev,
with Chat Completions and Responses at /v1 and Messages at the root.
It runs on sub2api ("Model ... is not available for this group",
API_KEY_REQUIRED from /v1/models and /v1/usage, /api/v1/settings/public
answers), so a key's balance is read at sub2api's /v1/usage by the
relay probe already there; no BalanceURL is needed. A key spends its
plan (Pro/Max/Ultra) and then its balance, so its billing is unsaid,
like MiniMax's Coding Plan keys. Website is the invite AIGoCode
sponsors magpie with (site/sponsors.js has the same one); it is not
badged Sponsored, as 鱼鱼连线 isn't. Keys page: /dashboard/keys.
- presets.go: the aigocode preset (KindRelay, icon aigocode).
- billing.go: aigocode in unsaidPresets.
- icons/aigocode.png and pngIcons: AIGoCode's own logo
(www.aigocode.net/images/algocode-logo.png), trimmed to 124 in 128.
- core_budget_test.go: +12 for the name in pngIcons; main was at the
budget to the byte, and the list is read wherever an icon draws.
- site docs (en, zh, ja): import's preset ids and relay's preset list.
Not wired: AIGoCode's Gemini-native endpoint (PresetDef has no Gemini
field). A key serves only its group's models, so a third-party
("可外接") group such as Claude API(AWS) or ChatGPT API(Azure) is
the one to use. If AIGoCode later takes the in-app seat, its partner
entry needs an id other than aigocode (checkPartner).
Tests: TestAIGoCodePresetTakesAKey: kind, key, endpoints as documented,
keys page, balance probed at api.aigocode.dev, billing unsaid. Broken
by hand: without aigocode in unsaidPresets it is red (billing "payg").
Run on mote (mica and mote both over their cores, so no full suite;
CI runs it), at origin/main 24effac0e + this change:
- gofmt -l clean; GOOS=linux go vet ./internal/provider and
GOOS=windows go vet ./internal/provider ./internal/gui: ok.
- go test -count=1 ./internal/provider: ok (147s);
go test -count=1 ./internal/gui (whole package, budget included): ok.
- node --test, Chromium and WebKit: icon-tile, icon-one-tone,
add-sheet, add-sheet-custom, preset-name, icon-builtin-over-address
(en, zh): 113/113 at a4937f8ff; i18n-keys, gui-de, gui-ja,
gui-zh-tw, add-sheet, icon-tile: 19/19 each engine.
- Real use, sandbox HOME, built binary: `magpie presets` lists
"AIGoCode aigocode magpie provider add aigocode <key>";
`magpie provider add aigocode <fake key>` writes the preset's
chat/responses/anthropic/website/keysUrl, and AIGoCode itself
answers /v1/models with 401 "Invalid API key".
Not tried: a real AIGoCode key (models listed, a request, the balance).
This commit is contained in:
@@ -366,7 +366,7 @@ function toneCheck(img) {
|
||||
swap();
|
||||
}, { once: true });
|
||||
}
|
||||
const pngIcons = new Set(["crush", "zcode", "alma", "hanako", "cindy", "lody", "typesafe", "atomcode", "snow", "mlx-serve", "gpustack", "mothx", "zoo-code", "kimi-code-desktop", "openbot", "avibe", "kun"]);
|
||||
const pngIcons = new Set(["aigocode", "crush", "zcode", "alma", "hanako", "cindy", "lody", "typesafe", "atomcode", "snow", "mlx-serve", "gpustack", "mothx", "zoo-code", "kimi-code-desktop", "openbot", "avibe", "kun"]);
|
||||
|
||||
// lazy: a picture in a long list (Plugins' rows) is asked for near the
|
||||
// screen: each SVG an <img> draws is a ~0.6 MB webview document, kept (#909)
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@@ -18,7 +18,7 @@ import (
|
||||
// `git log -L` of this file.
|
||||
const (
|
||||
appScriptBudget = 1_086_267 // app.js: 1,080,614 at 8016205e3, with the 5,653 of room it had
|
||||
coreScriptBudget = 1_269_028 // every core script at 8016205e3, the old measure 682 over its cap there (#5918); +367 for the model test on a chosen account (tmr11235), no page left to move it to; +151 for the provider menu's "Only on this device" item and its four translations; +458 for Settings › About's Report a problem row and its translations; +113 for withScheme, the one rule every typed address goes through (eachg0 on X), cut to the shortest form that keeps it whole; +10 for the kept whole's tooltip (Musikrv77852 on X), the past-cycle line reused for it, no page left to move it to; +1,112 for Codex's Open button and its Open Codex with menu (Yink88564391 on X), packed to the shortest form, no page left to move them to; +168 for Discover's long lists drawn in part (the owner, 11-13), after the rest of its hook moved into plugingrid.js, imported when Plugins first draws; +296 for the cap toggle and Smart sentences that say what they do and the Sign in on another computer row (Wing8Aqua on X), packed to the shortest form, no page left to move them to; +333 for In turn's figure in a provider's editor and its words naming the message that goes round (Wing8Aqua on X), the figure itself in rotfig.js, imported when In turn is first shown, the hook packed to the shortest form; +236 for a lone capped Codex account's row saying its turns go to the fallbacks when Codex is connected (not_4O4 on X), the two helpers inlined, no page left to move it to; +717 for omp's advisor (Awad_Yoo on X, #6408): its three rows moved into ompadvisor.js, imported when an omp's settings show, and what is left is the import, the role's " · off" and the Settings line's name, packed to the shortest form; +468 for a plugin's own file import (auth.import) in the import sheet, in the plugin's words (marchen_cc on X), packed to one statement; importSay is read as the Providers rows draw, so it has no lazy page to go to, and nothing else was moved out; +180 for Claude Magpie's own Claude Code folder (xMopf7RF on X, #6459): its Advanced fold in claudemagpie.js, imported when it first shows, and what is left is the import and the fold's place in the Separate app line, 216 bytes packed to the shortest form, less the 36 of room there was; +81 for the Use Claude Magpie button on Claude Desktop's row (xMopf7RF on X), drawn by claudemagpie.js too, what is left the one line that places it (#2710); +225 for the Hermes row's Other profiles lines (Norethcy on X), which 1d60b165c took out while each profile had a row and c96f33d65 left with no place at all, packed to the shortest form; the dead hermes# Default note went with it, and the Agents rows draw it, so there is no page to move it to; +397 for a key's own price rate (tnt12231 on X): its lines, check and placeholder in keyrates.js, imported when a provider with two or more keys opens, and what is left is the import, the draft's copy, Advanced opening for it, the save's one line and proxyLines drawing another kind of line; +316 for an image or video model's chip saying what it makes from its right-click (iceloon on X): the chat chip's Makes… now shared with it, and the media chip's Copy model ID left out, packed to the shortest form; the provider's editor draws it, so there is no page to move it to; +67 for the Claude Code · Claude Magpie row saying it is on magpie through Claude Magpie (xMopf7RF on X), one line in connectLine with the shortest words that say it; the Agents rows draw it, so there is no page to move it to
|
||||
coreScriptBudget = 1_269_040 // every core script at 8016205e3, the old measure 682 over its cap there (#5918); +367 for the model test on a chosen account (tmr11235), no page left to move it to; +151 for the provider menu's "Only on this device" item and its four translations; +458 for Settings › About's Report a problem row and its translations; +113 for withScheme, the one rule every typed address goes through (eachg0 on X), cut to the shortest form that keeps it whole; +10 for the kept whole's tooltip (Musikrv77852 on X), the past-cycle line reused for it, no page left to move it to; +1,112 for Codex's Open button and its Open Codex with menu (Yink88564391 on X), packed to the shortest form, no page left to move them to; +168 for Discover's long lists drawn in part (the owner, 11-13), after the rest of its hook moved into plugingrid.js, imported when Plugins first draws; +296 for the cap toggle and Smart sentences that say what they do and the Sign in on another computer row (Wing8Aqua on X), packed to the shortest form, no page left to move them to; +333 for In turn's figure in a provider's editor and its words naming the message that goes round (Wing8Aqua on X), the figure itself in rotfig.js, imported when In turn is first shown, the hook packed to the shortest form; +236 for a lone capped Codex account's row saying its turns go to the fallbacks when Codex is connected (not_4O4 on X), the two helpers inlined, no page left to move it to; +717 for omp's advisor (Awad_Yoo on X, #6408): its three rows moved into ompadvisor.js, imported when an omp's settings show, and what is left is the import, the role's " · off" and the Settings line's name, packed to the shortest form; +468 for a plugin's own file import (auth.import) in the import sheet, in the plugin's words (marchen_cc on X), packed to one statement; importSay is read as the Providers rows draw, so it has no lazy page to go to, and nothing else was moved out; +180 for Claude Magpie's own Claude Code folder (xMopf7RF on X, #6459): its Advanced fold in claudemagpie.js, imported when it first shows, and what is left is the import and the fold's place in the Separate app line, 216 bytes packed to the shortest form, less the 36 of room there was; +81 for the Use Claude Magpie button on Claude Desktop's row (xMopf7RF on X), drawn by claudemagpie.js too, what is left the one line that places it (#2710); +225 for the Hermes row's Other profiles lines (Norethcy on X), which 1d60b165c took out while each profile had a row and c96f33d65 left with no place at all, packed to the shortest form; the dead hermes# Default note went with it, and the Agents rows draw it, so there is no page to move it to; +397 for a key's own price rate (tnt12231 on X): its lines, check and placeholder in keyrates.js, imported when a provider with two or more keys opens, and what is left is the import, the draft's copy, Advanced opening for it, the save's one line and proxyLines drawing another kind of line; +316 for an image or video model's chip saying what it makes from its right-click (iceloon on X): the chat chip's Makes… now shared with it, and the media chip's Copy model ID left out, packed to the shortest form; the provider's editor draws it, so there is no page to move it to; +67 for the Claude Code · Claude Magpie row saying it is on magpie through Claude Magpie (xMopf7RF on X), one line in connectLine with the shortest words that say it; the Agents rows draw it, so there is no page to move it to; +12 for AIGoCode's logo in pngIcons (MindfulReturn on X), the list every drawn icon is looked up in
|
||||
)
|
||||
|
||||
// codeBytes is how many bytes of b are code: its blank lines, its lines
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package provider
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// AIGoCode is a preset that takes a key (MindfulReturn on X, 11-14: "do I
|
||||
// have to add the provider myself?"): its endpoints are the ones its own
|
||||
// docs give (www.aigocode.net/docs/api: OpenAI SDKs at /v1, Anthropic's at
|
||||
// the root), it is a relay, so a key's balance is looked for at sub2api's
|
||||
// /v1/usage, and its keys draw on a plan before the balance, so magpie
|
||||
// says neither.
|
||||
func TestAIGoCodePresetTakesAKey(t *testing.T) {
|
||||
pr := Preset("aigocode")
|
||||
if pr == nil {
|
||||
t.Fatal("no aigocode preset")
|
||||
}
|
||||
if pr.Kind != KindRelay || pr.NoKey || pr.Sponsored {
|
||||
t.Errorf("kind %s, noKey %v, sponsored %v: want a relay taking a key, listed as any other", pr.Kind, pr.NoKey, pr.Sponsored)
|
||||
}
|
||||
if pr.Chat != "https://api.aigocode.dev/v1" || pr.Responses != "https://api.aigocode.dev/v1" || pr.Anthropic != "https://api.aigocode.dev" {
|
||||
t.Errorf("endpoints %q %q %q", pr.Chat, pr.Responses, pr.Anthropic)
|
||||
}
|
||||
if pr.KeysURL != "https://www.aigocode.net/dashboard/keys" {
|
||||
t.Errorf("keys page %q", pr.KeysURL)
|
||||
}
|
||||
p := Provider{ID: "aigocode", Preset: "aigocode", Chat: pr.Chat, Responses: pr.Responses, Anthropic: pr.Anthropic, Key: "sk-k"}
|
||||
if !probesBalance(p) {
|
||||
t.Error("its balance is not looked for")
|
||||
}
|
||||
if got := strings.Join(probeOrigins(p), ","); got != "https://api.aigocode.dev" {
|
||||
t.Errorf("balance looked for at %q", got)
|
||||
}
|
||||
if b := p.BillingKind(); b != "" {
|
||||
t.Errorf("billing %q, want unsaid (plan first, then balance, on one key)", b)
|
||||
}
|
||||
}
|
||||
@@ -31,12 +31,13 @@ var planPresets = map[string]bool{
|
||||
|
||||
// unsaidPresets are vendors and relays whose one endpoint takes a plan's
|
||||
// keys and pay as you go's alike, or that are free, so magpie can't say
|
||||
// which a key is (MiniMax's Coding Plan keys, ModelScope's daily quota),
|
||||
// which a key is (MiniMax's Coding Plan keys, ModelScope's daily quota,
|
||||
// an AIGoCode key spending its plan and then its balance),
|
||||
// and decision models, which bill as their own provider does.
|
||||
var unsaidPresets = map[string]bool{
|
||||
"minimax": true, "minimax-cn": true, "ollama-cloud": true, "modelscope": true,
|
||||
"nvidia": true, "longcat": true, "commandcode": true,
|
||||
"typesafe": true, "vercel-jev": true, "cloudflare-jev": true,
|
||||
"typesafe": true, "vercel-jev": true, "cloudflare-jev": true, "aigocode": true,
|
||||
"bailian-decision": true, "qwen-decision": true, "volcengine-decision": true,
|
||||
}
|
||||
|
||||
|
||||
@@ -679,6 +679,15 @@ var presets = []PresetDef{
|
||||
{ID: "global", Name: "Global", Chat: "https://global.yylx.io/v1", Anthropic: "https://global.yylx.io"},
|
||||
{ID: "cn", Name: "China Mainland", Chat: "https://cn.yylx.io/v1", Anthropic: "https://cn.yylx.io"},
|
||||
}},
|
||||
// a sub2api relay (MindfulReturn on X, 11-14): one root for every
|
||||
// protocol, as its docs/api page gives it, Chat and Responses at /v1
|
||||
// and Messages at the root; a key serves its group's models alone,
|
||||
// which /v1/models lists, and its balance is sub2api's /v1/usage
|
||||
// (balance_probe.go). Its site carries the invite AIGoCode sponsors
|
||||
// magpie with, as Kimi's do.
|
||||
{ID: "aigocode", Name: "AIGoCode", Icon: "aigocode", Kind: KindRelay,
|
||||
Chat: "https://api.aigocode.dev/v1", Responses: "https://api.aigocode.dev/v1", Anthropic: "https://api.aigocode.dev",
|
||||
Website: "https://www.aigocode.net/invite/MAGPIE?utm_source=magpie&utm_medium=app", KeysURL: "https://www.aigocode.net/dashboard/keys"},
|
||||
|
||||
// Jev answers no conversation: it decides which of a routing group's
|
||||
// models takes a turn, and how hard it thinks
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
<h3 id="presets">Presets</h3>
|
||||
<p>Vendors magpie already knows. <code>magpie presets</code> prints the current list.</p>
|
||||
<div class="chips">
|
||||
<span class="chip"><code>anthropic</code></span><span class="chip"><code>openai</code></span><span class="chip"><code>google</code></span><span class="chip"><code>deepseek</code></span><span class="chip"><code>xai</code></span><span class="chip"><code>moonshot</code><span>Kimi</span></span><span class="chip"><code>moonshot-cn</code></span><span class="chip"><code>kimi-code</code></span><span class="chip"><code>kimi-code-cn</code></span><span class="chip"><code>zhipu</code><span>GLM · api · coding</span></span><span class="chip"><code>zai</code><span>api · coding</span></span><span class="chip"><code>minimax</code></span><span class="chip"><code>minimax-cn</code></span><span class="chip"><code>stepfun</code><span>plan · api</span></span><span class="chip"><code>stepfun-cn</code><span>plan · api</span></span><span class="chip"><code>xiaomi</code><span>MiMo</span></span><span class="chip"><code>longcat</code></span><span class="chip"><code>baidu-qianfan</code><span>千帆 · personal · team · api</span></span><span class="chip"><code>tencent-cloud</code><span>plan · cn · intl · enterprise · enterprise-intl</span></span><span class="chip"><code>huaweicloud</code><span>plan · api</span></span><span class="chip"><code>volcengine</code><span>火山方舟 · coding · agent · api</span></span><span class="chip"><code>qwen</code></span><span class="chip"><code>qwen-cn</code></span><span class="chip"><code>qwen-token-plan</code></span><span class="chip"><code>bailian-token-plan</code></span><span class="chip"><code>qwencloud</code><span>ap-southeast-1 · us-east-1 · eu-central-1 · ap-northeast-1 · cn-hongkong · cn-beijing</span></span><span class="chip"><code>qwencloud-token-plan</code></span><span class="chip"><code>mistral</code></span><span class="chip"><code>voyage</code></span><span class="chip"><code>groq</code></span><span class="chip"><code>bedrock</code></span><span class="chip"><code>ollama-cloud</code></span><span class="chip"><code>openrouter</code></span><span class="chip"><code>vercel</code></span><span class="chip"><code>opencode-go</code></span><span class="chip"><code>clinepass</code></span><span class="chip"><code>opencode-zen</code></span><span class="chip"><code>kilo</code></span><span class="chip"><code>commandcode</code></span><span class="chip"><code>together</code></span><span class="chip"><code>fireworks</code></span><span class="chip"><code>siliconflow</code><span>cn · intl</span></span><span class="chip"><code>nvidia</code></span><span class="chip"><code>modelscope</code><span>魔搭</span></span><span class="chip"><code>aihubmix</code></span><span class="chip"><code>pipellm</code></span><span class="chip"><code>302ai</code></span><span class="chip"><code>cherryin</code></span><span class="chip"><code>yylx</code><span>auto · global · cn</span></span><span class="chip"><code>ollama</code></span><span class="chip"><code>lmstudio</code></span>
|
||||
<span class="chip"><code>anthropic</code></span><span class="chip"><code>openai</code></span><span class="chip"><code>google</code></span><span class="chip"><code>deepseek</code></span><span class="chip"><code>xai</code></span><span class="chip"><code>moonshot</code><span>Kimi</span></span><span class="chip"><code>moonshot-cn</code></span><span class="chip"><code>kimi-code</code></span><span class="chip"><code>kimi-code-cn</code></span><span class="chip"><code>zhipu</code><span>GLM · api · coding</span></span><span class="chip"><code>zai</code><span>api · coding</span></span><span class="chip"><code>minimax</code></span><span class="chip"><code>minimax-cn</code></span><span class="chip"><code>stepfun</code><span>plan · api</span></span><span class="chip"><code>stepfun-cn</code><span>plan · api</span></span><span class="chip"><code>xiaomi</code><span>MiMo</span></span><span class="chip"><code>longcat</code></span><span class="chip"><code>baidu-qianfan</code><span>千帆 · personal · team · api</span></span><span class="chip"><code>tencent-cloud</code><span>plan · cn · intl · enterprise · enterprise-intl</span></span><span class="chip"><code>huaweicloud</code><span>plan · api</span></span><span class="chip"><code>volcengine</code><span>火山方舟 · coding · agent · api</span></span><span class="chip"><code>qwen</code></span><span class="chip"><code>qwen-cn</code></span><span class="chip"><code>qwen-token-plan</code></span><span class="chip"><code>bailian-token-plan</code></span><span class="chip"><code>qwencloud</code><span>ap-southeast-1 · us-east-1 · eu-central-1 · ap-northeast-1 · cn-hongkong · cn-beijing</span></span><span class="chip"><code>qwencloud-token-plan</code></span><span class="chip"><code>mistral</code></span><span class="chip"><code>voyage</code></span><span class="chip"><code>groq</code></span><span class="chip"><code>bedrock</code></span><span class="chip"><code>ollama-cloud</code></span><span class="chip"><code>openrouter</code></span><span class="chip"><code>vercel</code></span><span class="chip"><code>opencode-go</code></span><span class="chip"><code>clinepass</code></span><span class="chip"><code>opencode-zen</code></span><span class="chip"><code>kilo</code></span><span class="chip"><code>commandcode</code></span><span class="chip"><code>together</code></span><span class="chip"><code>fireworks</code></span><span class="chip"><code>siliconflow</code><span>cn · intl</span></span><span class="chip"><code>nvidia</code></span><span class="chip"><code>modelscope</code><span>魔搭</span></span><span class="chip"><code>aihubmix</code></span><span class="chip"><code>pipellm</code></span><span class="chip"><code>302ai</code></span><span class="chip"><code>cherryin</code></span><span class="chip"><code>yylx</code><span>auto · global · cn</span></span><span class="chip"><code>aigocode</code></span><span class="chip"><code>ollama</code></span><span class="chip"><code>lmstudio</code></span>
|
||||
</div>
|
||||
<p>A vendor with a preset only needs to add the key: <code>magpie://import?preset=deepseek&key=sk-…</code>. Want yours on the list? <a href="https://github.com/yetone/magpie/issues">Open an issue</a>.</p>
|
||||
|
||||
@@ -378,7 +378,7 @@ href = <span class="s">"https://usemagpie.ai/import#"</span> + urlencode({
|
||||
["mistral", "Mistral"], ["voyage", "Voyage AI"], ["groq", "Groq"], ["bedrock", "Amazon Bedrock"], ["ollama-cloud", "Ollama Cloud"], ["nous", "Nous Portal"], ["openrouter", "OpenRouter"], ["vercel", "Vercel AI Gateway"],
|
||||
["opencode-go", "OpenCode Go"], ["clinepass", "ClinePass"], ["opencode-zen", "OpenCode Zen"], ["kilo", "Kilo Gateway"], ["commandcode", "Command Code"],
|
||||
["together", "Together AI"], ["fireworks", "Fireworks"], ["siliconflow", "SiliconFlow"], ["nvidia", "NVIDIA NIM"], ["modelscope", "ModelScope"],
|
||||
["aihubmix", "AiHubMix"], ["pipellm", "PipeLLM"], ["302ai", "302.AI"], ["cherryin", "CherryIN"], ["yylx", "鱼鱼连线"],
|
||||
["aihubmix", "AiHubMix"], ["pipellm", "PipeLLM"], ["302ai", "302.AI"], ["cherryin", "CherryIN"], ["yylx", "鱼鱼连线"], ["aigocode", "AIGoCode"],
|
||||
["ollama", "Ollama"], ["lmstudio", "LM Studio"],
|
||||
];
|
||||
const REGIONS = {
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
<h3 id="presets">プリセット</h3>
|
||||
<p>magpie が組み込みで知っているベンダーです。<code>magpie presets</code> で最新の一覧を表示できます。</p>
|
||||
<div class="chips">
|
||||
<span class="chip"><code>anthropic</code></span><span class="chip"><code>openai</code></span><span class="chip"><code>google</code></span><span class="chip"><code>deepseek</code></span><span class="chip"><code>xai</code></span><span class="chip"><code>moonshot</code><span>Kimi</span></span><span class="chip"><code>moonshot-cn</code></span><span class="chip"><code>kimi-code</code></span><span class="chip"><code>kimi-code-cn</code></span><span class="chip"><code>zhipu</code><span>GLM · api · coding</span></span><span class="chip"><code>zai</code><span>api · coding</span></span><span class="chip"><code>minimax</code></span><span class="chip"><code>minimax-cn</code></span><span class="chip"><code>stepfun</code><span>plan · api</span></span><span class="chip"><code>stepfun-cn</code><span>plan · api</span></span><span class="chip"><code>xiaomi</code><span>MiMo</span></span><span class="chip"><code>longcat</code></span><span class="chip"><code>baidu-qianfan</code><span>千帆 · personal · team · api</span></span><span class="chip"><code>tencent-cloud</code><span>plan · cn · intl · enterprise · enterprise-intl</span></span><span class="chip"><code>huaweicloud</code><span>plan · api</span></span><span class="chip"><code>volcengine</code><span>火山方舟 · coding · agent · api</span></span><span class="chip"><code>qwen</code></span><span class="chip"><code>qwen-cn</code></span><span class="chip"><code>qwen-token-plan</code></span><span class="chip"><code>bailian-token-plan</code></span><span class="chip"><code>qwencloud</code><span>ap-southeast-1 · us-east-1 · eu-central-1 · ap-northeast-1 · cn-hongkong · cn-beijing</span></span><span class="chip"><code>qwencloud-token-plan</code></span><span class="chip"><code>mistral</code></span><span class="chip"><code>voyage</code></span><span class="chip"><code>groq</code></span><span class="chip"><code>bedrock</code></span><span class="chip"><code>ollama-cloud</code></span><span class="chip"><code>openrouter</code></span><span class="chip"><code>vercel</code></span><span class="chip"><code>opencode-go</code></span><span class="chip"><code>clinepass</code></span><span class="chip"><code>opencode-zen</code></span><span class="chip"><code>kilo</code></span><span class="chip"><code>commandcode</code></span><span class="chip"><code>together</code></span><span class="chip"><code>fireworks</code></span><span class="chip"><code>siliconflow</code><span>cn · intl</span></span><span class="chip"><code>nvidia</code></span><span class="chip"><code>modelscope</code><span>魔搭</span></span><span class="chip"><code>aihubmix</code></span><span class="chip"><code>pipellm</code></span><span class="chip"><code>302ai</code></span><span class="chip"><code>cherryin</code></span><span class="chip"><code>yylx</code><span>auto · global · cn</span></span><span class="chip"><code>ollama</code></span><span class="chip"><code>lmstudio</code></span>
|
||||
<span class="chip"><code>anthropic</code></span><span class="chip"><code>openai</code></span><span class="chip"><code>google</code></span><span class="chip"><code>deepseek</code></span><span class="chip"><code>xai</code></span><span class="chip"><code>moonshot</code><span>Kimi</span></span><span class="chip"><code>moonshot-cn</code></span><span class="chip"><code>kimi-code</code></span><span class="chip"><code>kimi-code-cn</code></span><span class="chip"><code>zhipu</code><span>GLM · api · coding</span></span><span class="chip"><code>zai</code><span>api · coding</span></span><span class="chip"><code>minimax</code></span><span class="chip"><code>minimax-cn</code></span><span class="chip"><code>stepfun</code><span>plan · api</span></span><span class="chip"><code>stepfun-cn</code><span>plan · api</span></span><span class="chip"><code>xiaomi</code><span>MiMo</span></span><span class="chip"><code>longcat</code></span><span class="chip"><code>baidu-qianfan</code><span>千帆 · personal · team · api</span></span><span class="chip"><code>tencent-cloud</code><span>plan · cn · intl · enterprise · enterprise-intl</span></span><span class="chip"><code>huaweicloud</code><span>plan · api</span></span><span class="chip"><code>volcengine</code><span>火山方舟 · coding · agent · api</span></span><span class="chip"><code>qwen</code></span><span class="chip"><code>qwen-cn</code></span><span class="chip"><code>qwen-token-plan</code></span><span class="chip"><code>bailian-token-plan</code></span><span class="chip"><code>qwencloud</code><span>ap-southeast-1 · us-east-1 · eu-central-1 · ap-northeast-1 · cn-hongkong · cn-beijing</span></span><span class="chip"><code>qwencloud-token-plan</code></span><span class="chip"><code>mistral</code></span><span class="chip"><code>voyage</code></span><span class="chip"><code>groq</code></span><span class="chip"><code>bedrock</code></span><span class="chip"><code>ollama-cloud</code></span><span class="chip"><code>openrouter</code></span><span class="chip"><code>vercel</code></span><span class="chip"><code>opencode-go</code></span><span class="chip"><code>clinepass</code></span><span class="chip"><code>opencode-zen</code></span><span class="chip"><code>kilo</code></span><span class="chip"><code>commandcode</code></span><span class="chip"><code>together</code></span><span class="chip"><code>fireworks</code></span><span class="chip"><code>siliconflow</code><span>cn · intl</span></span><span class="chip"><code>nvidia</code></span><span class="chip"><code>modelscope</code><span>魔搭</span></span><span class="chip"><code>aihubmix</code></span><span class="chip"><code>pipellm</code></span><span class="chip"><code>302ai</code></span><span class="chip"><code>cherryin</code></span><span class="chip"><code>yylx</code><span>auto · global · cn</span></span><span class="chip"><code>aigocode</code></span><span class="chip"><code>ollama</code></span><span class="chip"><code>lmstudio</code></span>
|
||||
</div>
|
||||
<p>プリセットのあるベンダーなら、キーを付けるだけです:<code>magpie://import?preset=deepseek&key=sk-…</code>。一覧に追加したい場合は <a href="https://github.com/yetone/magpie/issues">issue を作成</a>してください。</p>
|
||||
|
||||
@@ -378,7 +378,7 @@ href = <span class="s">"https://usemagpie.ai/import#"</span> + urlencode({
|
||||
["mistral", "Mistral"], ["voyage", "Voyage AI"], ["groq", "Groq"], ["bedrock", "Amazon Bedrock"], ["ollama-cloud", "Ollama Cloud"], ["nous", "Nous Portal"], ["openrouter", "OpenRouter"], ["vercel", "Vercel AI Gateway"],
|
||||
["opencode-go", "OpenCode Go"], ["clinepass", "ClinePass"], ["opencode-zen", "OpenCode Zen"], ["kilo", "Kilo Gateway"], ["commandcode", "Command Code"],
|
||||
["together", "Together AI"], ["fireworks", "Fireworks"], ["siliconflow", "SiliconFlow"], ["nvidia", "NVIDIA NIM"], ["modelscope", "ModelScope"],
|
||||
["aihubmix", "AiHubMix"], ["pipellm", "PipeLLM"], ["302ai", "302.AI"], ["cherryin", "CherryIN"], ["yylx", "鱼鱼连线"],
|
||||
["aihubmix", "AiHubMix"], ["pipellm", "PipeLLM"], ["302ai", "302.AI"], ["cherryin", "CherryIN"], ["yylx", "鱼鱼连线"], ["aigocode", "AIGoCode"],
|
||||
["ollama", "Ollama"], ["lmstudio", "LM Studio"],
|
||||
];
|
||||
const REGIONS = {
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
"name": "magpie で API 中継サービスを使えますか?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "使えます。AiHubMix・PipeLLM・302.AI・CherryIN・鱼鱼连线はキーを入れるだけのプリセットで、ほかの中継は magpie provider add で OpenAI 互換と Anthropic 互換のアドレスを指定します。"
|
||||
"text": "使えます。AiHubMix・PipeLLM・302.AI・CherryIN・鱼鱼连线・AIGoCodeはキーを入れるだけのプリセットで、ほかの中継は magpie provider add で OpenAI 互換と Anthropic 互換のアドレスを指定します。"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -183,7 +183,7 @@
|
||||
<p class="lede">中継サービスは 1 つのキーで多くのベンダーのモデルを売り、価格もモデル名も独自のことがよくあります。magpie は中継を 1 つのプロバイダーとして扱い、エージェントは <code>中継/モデル</code> で使えます。価格・名前・コンテキスト長は中継の実際に合わせて設定できます。</p>
|
||||
<h2 id="add"><a class="anchor" href="#add">中継を追加する</a></h2>
|
||||
<ol class="steps">
|
||||
<li><b>プリセットの中継。</b>AiHubMix・PipeLLM・302.AI・CherryIN・鱼鱼连线はプリセットで、<span class="ui">APIキー</span> を入れるだけです。鱼鱼连线は Auto・Global・China Mainland の回線も選べます。</li>
|
||||
<li><b>プリセットの中継。</b>AiHubMix・PipeLLM・302.AI・CherryIN・鱼鱼连线・AIGoCodeはプリセットで、<span class="ui">APIキー</span> を入れるだけです。鱼鱼连线は Auto・Global・China Mainland の回線も選べます。</li>
|
||||
<li><b>そのほかの中継。</b>アドレスを指定します。<code>url=</code> は OpenAI 互換、<code>anthropic=</code> は Anthropic 互換で、両方あれば両方、Responses に別アドレスがあれば <code>responses=</code> も加えます。</li>
|
||||
</ol>
|
||||
<div class="code"><span class="lang">ターミナル</span><button class="copy" data-copy="relay-add">コピー</button><pre id="relay-add">magpie presets
|
||||
@@ -215,7 +215,7 @@ magpie provider auto-include relay 'gpt-*' 're:claude-.*'</pre></div>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">よくある質問</a></h2>
|
||||
<h3>magpie で API 中継サービスを使えますか?</h3>
|
||||
<p>使えます。AiHubMix・PipeLLM・302.AI・CherryIN・鱼鱼连线はキーを入れるだけのプリセットで、ほかの中継は magpie provider add で OpenAI 互換と Anthropic 互換のアドレスを指定します。</p>
|
||||
<p>使えます。AiHubMix・PipeLLM・302.AI・CherryIN・鱼鱼连线・AIGoCodeはキーを入れるだけのプリセットで、ほかの中継は magpie provider add で OpenAI 互換と Anthropic 互換のアドレスを指定します。</p>
|
||||
<h3>中継経由の Claude モデルでキャッシュが効かないのはなぜ?</h3>
|
||||
<p>多くの中継は Chat で cache_control を落とします。中継の Anthropic アドレスを指定すれば、magpie は Claude モデルを Messages に送り、キャッシュと思考が保たれます。</p>
|
||||
<h3>中継が割引価格のとき、費用を正しく数えるには?</h3>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
"name": "Can magpie use an API relay?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "Yes. AiHubMix, PipeLLM, 302.AI, CherryIN and 鱼鱼连线 are presets that take a key; any other relay is added with magpie provider add and its OpenAI- and Anthropic-compatible addresses."
|
||||
"text": "Yes. AiHubMix, PipeLLM, 302.AI, CherryIN, 鱼鱼连线 and AIGoCode are presets that take a key; any other relay is added with magpie provider add and its OpenAI- and Anthropic-compatible addresses."
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -183,7 +183,7 @@
|
||||
<p class="lede">A relay sells many vendors' models on one key, often at its own prices and under its own model names. magpie treats a relay as a provider: an agent asks for <code>relay/model</code>, and prices, names and windows can be set to what the relay really does.</p>
|
||||
<h2 id="add"><a class="anchor" href="#add">Add a relay</a></h2>
|
||||
<ol class="steps">
|
||||
<li><b>A preset relay.</b>AiHubMix, PipeLLM, 302.AI, CherryIN and 鱼鱼连线 are presets: give an <span class="ui">API key</span>. 鱼鱼连线 also takes an Auto, Global or China Mainland line.</li>
|
||||
<li><b>A preset relay.</b>AiHubMix, PipeLLM, 302.AI, CherryIN, 鱼鱼连线 and AIGoCode are presets: give an <span class="ui">API key</span>. 鱼鱼连线 also takes an Auto, Global or China Mainland line.</li>
|
||||
<li><b>Any other relay.</b>Give its addresses: <code>url=</code> for an OpenAI-compatible base, <code>anthropic=</code> for an Anthropic-compatible one, both when it has both, and <code>responses=</code> when Responses has an address of its own.</li>
|
||||
</ol>
|
||||
<div class="code"><span class="lang">Terminal</span><button class="copy" data-copy="relay-add">Copy</button><pre id="relay-add">magpie presets
|
||||
@@ -215,7 +215,7 @@ magpie provider auto-include relay 'gpt-*' 're:claude-.*'</pre></div>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">FAQ</a></h2>
|
||||
<h3>Can magpie use an API relay?</h3>
|
||||
<p>Yes. AiHubMix, PipeLLM, 302.AI, CherryIN and 鱼鱼连线 are presets that take a key; any other relay is added with magpie provider add and its OpenAI- and Anthropic-compatible addresses.</p>
|
||||
<p>Yes. AiHubMix, PipeLLM, 302.AI, CherryIN, 鱼鱼连线 and AIGoCode are presets that take a key; any other relay is added with magpie provider add and its OpenAI- and Anthropic-compatible addresses.</p>
|
||||
<h3>Why does caching miss for Claude models through a relay?</h3>
|
||||
<p>Many relays drop cache_control on Chat. Give the relay's Anthropic address, and magpie sends Claude models to Messages, keeping caching and thinking.</p>
|
||||
<h3>The relay sells at a discount. How do I count the right cost?</h3>
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
<h3 id="presets">预设</h3>
|
||||
<p>magpie 已经内置的厂商。<code>magpie presets</code> 会打印当前的列表。</p>
|
||||
<div class="chips">
|
||||
<span class="chip"><code>anthropic</code></span><span class="chip"><code>openai</code></span><span class="chip"><code>google</code></span><span class="chip"><code>deepseek</code></span><span class="chip"><code>xai</code></span><span class="chip"><code>moonshot</code><span>Kimi</span></span><span class="chip"><code>moonshot-cn</code></span><span class="chip"><code>kimi-code</code></span><span class="chip"><code>kimi-code-cn</code></span><span class="chip"><code>zhipu</code><span>GLM · api · coding</span></span><span class="chip"><code>zai</code><span>api · coding</span></span><span class="chip"><code>minimax</code></span><span class="chip"><code>minimax-cn</code></span><span class="chip"><code>stepfun</code><span>plan · api</span></span><span class="chip"><code>stepfun-cn</code><span>plan · api</span></span><span class="chip"><code>xiaomi</code><span>MiMo</span></span><span class="chip"><code>longcat</code></span><span class="chip"><code>baidu-qianfan</code><span>千帆 · personal · team · api</span></span><span class="chip"><code>tencent-cloud</code><span>plan · cn · intl · enterprise · enterprise-intl</span></span><span class="chip"><code>huaweicloud</code><span>plan · api</span></span><span class="chip"><code>volcengine</code><span>火山方舟 · coding · agent · api</span></span><span class="chip"><code>qwen</code></span><span class="chip"><code>qwen-cn</code></span><span class="chip"><code>qwen-token-plan</code></span><span class="chip"><code>bailian-token-plan</code></span><span class="chip"><code>qwencloud</code><span>ap-southeast-1 · us-east-1 · eu-central-1 · ap-northeast-1 · cn-hongkong · cn-beijing</span></span><span class="chip"><code>qwencloud-token-plan</code></span><span class="chip"><code>mistral</code></span><span class="chip"><code>voyage</code></span><span class="chip"><code>groq</code></span><span class="chip"><code>bedrock</code></span><span class="chip"><code>ollama-cloud</code></span><span class="chip"><code>openrouter</code></span><span class="chip"><code>vercel</code></span><span class="chip"><code>opencode-go</code></span><span class="chip"><code>clinepass</code></span><span class="chip"><code>opencode-zen</code></span><span class="chip"><code>kilo</code></span><span class="chip"><code>commandcode</code></span><span class="chip"><code>together</code></span><span class="chip"><code>fireworks</code></span><span class="chip"><code>siliconflow</code><span>cn · intl</span></span><span class="chip"><code>nvidia</code></span><span class="chip"><code>modelscope</code><span>魔搭</span></span><span class="chip"><code>aihubmix</code></span><span class="chip"><code>pipellm</code></span><span class="chip"><code>302ai</code></span><span class="chip"><code>cherryin</code></span><span class="chip"><code>yylx</code><span>auto · global · cn</span></span><span class="chip"><code>ollama</code></span><span class="chip"><code>lmstudio</code></span>
|
||||
<span class="chip"><code>anthropic</code></span><span class="chip"><code>openai</code></span><span class="chip"><code>google</code></span><span class="chip"><code>deepseek</code></span><span class="chip"><code>xai</code></span><span class="chip"><code>moonshot</code><span>Kimi</span></span><span class="chip"><code>moonshot-cn</code></span><span class="chip"><code>kimi-code</code></span><span class="chip"><code>kimi-code-cn</code></span><span class="chip"><code>zhipu</code><span>GLM · api · coding</span></span><span class="chip"><code>zai</code><span>api · coding</span></span><span class="chip"><code>minimax</code></span><span class="chip"><code>minimax-cn</code></span><span class="chip"><code>stepfun</code><span>plan · api</span></span><span class="chip"><code>stepfun-cn</code><span>plan · api</span></span><span class="chip"><code>xiaomi</code><span>MiMo</span></span><span class="chip"><code>longcat</code></span><span class="chip"><code>baidu-qianfan</code><span>千帆 · personal · team · api</span></span><span class="chip"><code>tencent-cloud</code><span>plan · cn · intl · enterprise · enterprise-intl</span></span><span class="chip"><code>huaweicloud</code><span>plan · api</span></span><span class="chip"><code>volcengine</code><span>火山方舟 · coding · agent · api</span></span><span class="chip"><code>qwen</code></span><span class="chip"><code>qwen-cn</code></span><span class="chip"><code>qwen-token-plan</code></span><span class="chip"><code>bailian-token-plan</code></span><span class="chip"><code>qwencloud</code><span>ap-southeast-1 · us-east-1 · eu-central-1 · ap-northeast-1 · cn-hongkong · cn-beijing</span></span><span class="chip"><code>qwencloud-token-plan</code></span><span class="chip"><code>mistral</code></span><span class="chip"><code>voyage</code></span><span class="chip"><code>groq</code></span><span class="chip"><code>bedrock</code></span><span class="chip"><code>ollama-cloud</code></span><span class="chip"><code>openrouter</code></span><span class="chip"><code>vercel</code></span><span class="chip"><code>opencode-go</code></span><span class="chip"><code>clinepass</code></span><span class="chip"><code>opencode-zen</code></span><span class="chip"><code>kilo</code></span><span class="chip"><code>commandcode</code></span><span class="chip"><code>together</code></span><span class="chip"><code>fireworks</code></span><span class="chip"><code>siliconflow</code><span>cn · intl</span></span><span class="chip"><code>nvidia</code></span><span class="chip"><code>modelscope</code><span>魔搭</span></span><span class="chip"><code>aihubmix</code></span><span class="chip"><code>pipellm</code></span><span class="chip"><code>302ai</code></span><span class="chip"><code>cherryin</code></span><span class="chip"><code>yylx</code><span>auto · global · cn</span></span><span class="chip"><code>aigocode</code></span><span class="chip"><code>ollama</code></span><span class="chip"><code>lmstudio</code></span>
|
||||
</div>
|
||||
<p>有预设的厂商只需带上密钥:<code>magpie://import?preset=deepseek&key=sk-…</code>。想加入列表?<a href="https://github.com/yetone/magpie/issues">提个 issue</a>。</p>
|
||||
|
||||
@@ -378,7 +378,7 @@ href = <span class="s">"https://usemagpie.ai/import#"</span> + urlencode({
|
||||
["mistral", "Mistral"], ["voyage", "Voyage AI"], ["groq", "Groq"], ["bedrock", "Amazon Bedrock"], ["ollama-cloud", "Ollama Cloud"], ["nous", "Nous Portal"], ["openrouter", "OpenRouter"], ["vercel", "Vercel AI Gateway"],
|
||||
["opencode-go", "OpenCode Go"], ["clinepass", "ClinePass"], ["opencode-zen", "OpenCode Zen"], ["kilo", "Kilo Gateway"], ["commandcode", "Command Code"],
|
||||
["together", "Together AI"], ["fireworks", "Fireworks"], ["siliconflow", "硅基流动"], ["nvidia", "NVIDIA NIM"], ["modelscope", "魔搭 ModelScope"],
|
||||
["aihubmix", "AiHubMix"], ["pipellm", "PipeLLM"], ["302ai", "302.AI"], ["cherryin", "CherryIN"], ["yylx", "鱼鱼连线"],
|
||||
["aihubmix", "AiHubMix"], ["pipellm", "PipeLLM"], ["302ai", "302.AI"], ["cherryin", "CherryIN"], ["yylx", "鱼鱼连线"], ["aigocode", "AIGoCode"],
|
||||
["ollama", "Ollama"], ["lmstudio", "LM Studio"],
|
||||
];
|
||||
const REGIONS = {
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
"name": "magpie 能接 API 中转站吗?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "能。AiHubMix、PipeLLM、302.AI、CherryIN、鱼鱼连线是预设,填 Key 即可;其他中转站用 magpie provider add 填 OpenAI 兼容地址和 Anthropic 兼容地址。"
|
||||
"text": "能。AiHubMix、PipeLLM、302.AI、CherryIN、鱼鱼连线、AIGoCode是预设,填 Key 即可;其他中转站用 magpie provider add 填 OpenAI 兼容地址和 Anthropic 兼容地址。"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -183,7 +183,7 @@
|
||||
<p class="lede">中转站用一把 Key 卖很多家的模型,价格常常和官方不一样,模型名也常常带着自己的前缀。magpie 把中转站当成一个供应商:Agent 里写 <code>中转站/模型</code> 就能用,价格、模型名和窗口都可以按中转站的实际情况改。</p>
|
||||
<h2 id="add"><a class="anchor" href="#add">添加中转站</a></h2>
|
||||
<ol class="steps">
|
||||
<li><b>内置的中转站。</b>AiHubMix、PipeLLM、302.AI、CherryIN、鱼鱼连线已经是预设,填一把 <span class="ui">API 密钥</span> 就行。鱼鱼连线还可以选 Auto、Global 或 China Mainland 线路。</li>
|
||||
<li><b>内置的中转站。</b>AiHubMix、PipeLLM、302.AI、CherryIN、鱼鱼连线、AIGoCode已经是预设,填一把 <span class="ui">API 密钥</span> 就行。鱼鱼连线还可以选 Auto、Global 或 China Mainland 线路。</li>
|
||||
<li><b>其他中转站。</b>填它的地址:<code>url=</code> 是 OpenAI 兼容的地址,<code>anthropic=</code> 是 Anthropic 兼容的地址,两个都有就都填;另有单独 Responses 地址的再加 <code>responses=</code>。</li>
|
||||
</ol>
|
||||
<div class="code"><span class="lang">终端</span><button class="copy" data-copy="relay-add">复制</button><pre id="relay-add">magpie presets
|
||||
@@ -215,7 +215,7 @@ magpie provider auto-include relay 'gpt-*' 're:claude-.*'</pre></div>
|
||||
|
||||
<h2 id="faq"><a class="anchor" href="#faq">常见问题</a></h2>
|
||||
<h3>magpie 能接 API 中转站吗?</h3>
|
||||
<p>能。AiHubMix、PipeLLM、302.AI、CherryIN、鱼鱼连线是预设,填 Key 即可;其他中转站用 magpie provider add 填 OpenAI 兼容地址和 Anthropic 兼容地址。</p>
|
||||
<p>能。AiHubMix、PipeLLM、302.AI、CherryIN、鱼鱼连线、AIGoCode是预设,填 Key 即可;其他中转站用 magpie provider add 填 OpenAI 兼容地址和 Anthropic 兼容地址。</p>
|
||||
<h3>通过中转站用 Claude 模型,缓存为什么不命中?</h3>
|
||||
<p>很多中转站在 Chat 接口上会丢掉 cache_control。填上中转站的 Anthropic 地址,magpie 就把 Claude 模型都发到 Messages,缓存和思考都能保住。</p>
|
||||
<h3>中转站打折,花费怎么算才对?</h3>
|
||||
|
||||
Reference in New Issue
Block a user