你在搭什么
Hermes 3 405B 是 Nous Research 的开源通用模型——推理、多轮对话、工具调用都强,适合当 agent 大脑。AnyRouter 用 nousresearch/hermes-3-llama-3.1-405b 经一个兼容 OpenAI 的端点提供它,任何会说 OpenAI API 的客户端或 agent 框架都能驱动。
模型跑在你自己的免费 Hugging Face token(BYOK)上,对你推理免费,AnyRouter 加价为零。上面仍有统一 API、日志、分析和自动故障切换。全程大约三分钟。
1. 拿免费 Hugging Face token
登录 huggingface.co,打开 Settings → Access Tokens。建一把带 Inference Providers 权限的 token(免费档够起步)。复制——以 hf_ 开头。
2. 加成 BYOK
在 AnyRouter 控制台打开 /byok 的 BYOK & Key Balancing,供应商选 Hugging Face,粘贴 hf_ token,保存。key 静态加密,界面只写不读——保存后只看到掩码标识。
几下点击接上免费 Hugging Face token。
连接一把 key3. 开一把 AnyRouter API key
到 /keys 建一把 AnyRouter key(以 sk-ar- 开头)。agent 只用这一把鉴权——AnyRouter 在背后映射到 Hugging Face token,agent 从不直接碰供应商 key。
4. 把 agent 指到 AnyRouter
base URL 用 https://anyrouter.dev/api/v1,模型用 nousresearch/hermes-3-llama-3.1-405b。一行 curl 确认能通:
curl https://anyrouter.dev/api/v1/chat/completions \
-H "Authorization: Bearer $ANYROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nousresearch/hermes-3-llama-3.1-405b",
"messages": [{ "role": "user", "content": "You are a helpful agent. Say hi." }]
}'因为兼容 OpenAI,官方 SDK 不用改——只换 base URL 和 key:
from openai import OpenAI
client = OpenAI(
base_url="https://anyrouter.dev/api/v1",
api_key="sk-ar-...", # your AnyRouter key
)
resp = client.chat.completions.create(
model="nousresearch/hermes-3-llama-3.1-405b",
messages=[{"role": "user", "content": "You are a helpful agent. Say hi."}],
)
print(resp.choices[0].message.content)把 Claude Code、Codex、Cursor 或你自己的循环指到同一 base URL 和 model id,Hermes agent 就在跑。
还有一件事:闲着也能赚
Hugging Face 配额多半闲着。打开捐献开关:共享池经这把 key 走的每次请求,会把该请求名义成本的最多 8% 记到可兑换额度(Go 5%,Pro/Max 8%)——捐一把还能用的 key,只要它保持活跃,就能免费开通 Go。你自己的调用优先;池子只借闲余容量,随时可退出。
用一个 API 跑 Hermes agent,加价 $0。
开始相关文章
Point Claude Code at a custom base URL
Claude Code reads ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY, so pointing it at AnyRouter takes two environment variables — no plugin, no fork. You get every model in the catalog behind the same key, automatic failover when a provider is rate-limited, and one audit log shared with Codex, Cursor, and every other agent you run.
MCP servers for AI agents: what they are and how to connect one
An MCP server lets an AI agent call a workspace's tools — keys, credits, models, status — over one standard interface instead of custom glue code per service. Here's what MCP is and how to connect AnyRouter's managed MCP server to Claude Desktop, Claude Code, Cursor, or your own agent.
