Appearance
在 OpenClaw 中使用 AgentRouter
OpenClaw 通过模型配置文件接入 AgentRouter,支持 Anthropic Messages(Claude Opus 系列)与 OpenAI Completions(gpt-5.5 / glm-5.2)两类 Provider。
1. 下载与安装
bash
curl -fsSL https://openclaw.ai/install.sh | bash或使用 npm(网络问题可换源):
bash
# Install OpenClaw
npm i -g openclaw
# Meet your lobster®
openclaw onboard2. 配置(onboard 向导)
在命令行里输入 openclaw 打开,首次会弹出提示框。如果以前配置过,也可以直接输入 openclaw onboard 打开。按下表选择:
| 配置内容 | 操作 |
|---|---|
| I understand this is powerful and inherently risky. Continue? | Yes |
| Onboarding mode | QuickStart |
| Model/auth provider | Skip for now |
| Filter models by provider | All providers |
| Default model | Keep current |
| Select channel (QuickStart) | Skip for now |
| Configure skills now? (recommended) | No |
| Enable hooks? | Skip for now |
| How do you want to hatch your bot? | 都行 |
3. 模型文件配置
访问 https://agentrouter.org/console/token 获取你的 API Key,可以直接按下面配置贴入(记得把 sk- 替换为你自己的 AgentRouter Key):
json
{
"meta": {
"lastTouchedVersion": "2026.2.3",
"lastTouchedAt": "2026-02-12T08:58:20.664Z"
},
"models": {
"mode": "merge",
"providers": {
"agentrouter-messages": {
"baseUrl": "https://agentrouter.org",
"apiKey": "sk-",
"auth": "token",
"api": "anthropic-messages",
"models": [
{
"id": "claude-opus-4-6",
"name": "claude-opus-4-6",
"reasoning": false,
"input": ["text", "image"],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 200000,
"maxTokens": 16384
}
]
},
"agentrouter-completions": {
"baseUrl": "https://agentrouter.org/v1",
"apiKey": "sk-",
"auth": "token",
"api": "openai-completions",
"models": [
{
"id": "gpt-5.5",
"name": "gpt-5.5",
"reasoning": false,
"input": ["text"],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 100000,
"maxTokens": 8192
}
]
}
},
"bedrockDiscovery": {
"enabled": true,
"providerFilter": []
}
},
"nodeHost": {
"browserProxy": {
"allowProfiles": [""]
}
},
"agents": {
"defaults": {
"model": {
"primary": "agentrouter-completions/gpt-5.5"
},
"compaction": {
"mode": "safeguard"
},
"maxConcurrent": 4,
"subagents": {
"maxConcurrent": 8
}
}
},
"commands": {
"native": "auto",
"nativeSkills": "auto"
}
}IMPORTANT
请把 apiKey 中的 sk- 替换为你自己的 AgentRouter Key。
4. 测试
进入 chat 模块,发送"只回复 OK"测试自己的 Key 是否生效。