AnyRouter 上的 BYOK 是什么?
Bring Your Own Key(BYOK)让你把自有上游供应商 key 挂到 AnyRouter 账号。请求匹配到你某把 key 能伺候的模型时,AnyRouter 用你的 key 转发,你按供应商牌价直接付给他们。AnyRouter 的功能你都还在——统一 API、日志、分析、预设、路由、app 归因——叠在你已有的账号上。
AnyRouter 为 60 多家供应商开放 BYOK:OpenAI、Anthropic、Google AI Studio、Groq、NVIDIA NIM、Z.ai、Ollama Cloud,以及 Azure OpenAI、Bedrock、Vertex AI 这类企业端点。按供应商的完整设置指南在 /docs/features/byok-providers。
AnyRouter 对 BYOK 收加价吗?
不收。AnyRouter 对 BYOK 流量一分不收——没有按请求费、没有附加费、没有最低消费。经你自己供应商 key 伺候的请求从不扣 AnyRouter 额度,任何套餐都一样。你只付给供应商。若某供应商的每把 BYOK key 都耗尽,请求可以可选落到按量额度,活继续跑。
- 自有 key $0 加价——你付给供应商,不付给 AnyRouter。
- 保留自己的限流——走你账号的配额,不是共享池。
- 自动失败切换——每家供应商加不止一把 key,烧掉的 key(401/429)被隔离,下一把接上。
- 负载策略——每家供应商可选 Fallback、Round Robin、Weighted 或 Random。
- 按 key 预算——给任何一把 key 设月度封顶,跑飞的循环掏不空供应商账号。
在整池 key 上路由
加完 key 后,三个内置 id 可以不点名具体模型就在全部 key 上路由——而且它们只用你自己的 key,从不花 AnyRouter 额度:
| Model id | Routes to |
|---|---|
| anyrouter/byok | Every model your configured keys can reach |
| anyrouter/coding | The coding-capable subset |
| anyrouter/agent | The tool / function-calling subset, built for agents |
curl https://anyrouter.dev/api/v1/chat/completions \
-H "Authorization: Bearer $ANYROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anyrouter/coding",
"messages": [{ "role": "user", "content": "Refactor this function" }]
}'捐闲置 key,赚额度,免费用 Go
多数供应商额度大部分时间闲着。给符合条件的 BYOK key 打开捐赠开关,共享池经它打出去的每次请求,都会把该次名义 token 成本最多 8% 记到随时可领的 pending 余额。捐一把还能用的 key 也会在 key 保持活跃期间自动免费开通 Go——所以你跳过每月 $2。你自己的 key 仍优先接你的调用;池子只用多余容量,随时可以立刻退出。
- 捐出的 key 每服务一枚 token 最多拿回 8%——Go 上 5%,Pro/Max 上 8%,每把 key 每个 UTC 日上限 $1。这个 $1 是捐赠上限,不是 Go 价格。
- 资格看路由,不看 ToS——AnyRouter 能打到那家供应商时开关才出现。供应商条款是否允许分享 key,由你确认。
- 明确、有记录的同意——不会自动报名。
- 429 自动暂停,控制台立刻退出。
池子数字看 /pool,捐赠看 /donate,分成机制读 /blog/shared-key-pool。
我的 key 怎么保护?
BYOK key 是敏感凭证,AnyRouter 也当敏感凭证处理。静态加密带每行盐,一把 key 的密文泄漏不会削弱另一把。界面只写不读——保存后只显示别名和打码标识。它们从请求和响应日志里剥掉,保存时现场校验(然后丢掉校验响应),并且只发给它们作用域对应的上游供应商。
把你已经在付的供应商 key 经一个 API 路由,$0 加价。
接一把 key相关文章
Bring your own keys — every provider behind one API
Connect the provider keys and subscriptions you already pay for, route them through one OpenAI-compatible URL with automatic failover, and — soon — earn credits back by donating idle quota to the shared pool.
Donate an idle provider key, earn credits back: a walkthrough
Hold a provider key with headroom to spare? Donate it to the shared pool in two clicks. Every token the pool serves through your key earns pending credits — up to 8% of its notional cost, tiered by plan — claim them anytime or turn on auto-claim. Here's the step-by-step.
Get a free NVIDIA API key and route it through one URL
NVIDIA hands out a free API key with credits and no card required. Attach it to AnyRouter as BYOK and every NVIDIA-hosted model runs through one OpenAI-compatible endpoint — at $0 markup. Here's the five-minute setup.
