OpenRouter
OpenRouter 多模型聚合服务。
概述
OpenRouter 提供统一 API 访问多个模型提供商。
认证
- 获取 API 密钥:https://openrouter.ai/keys
- 配置:
bash
openclaw onboard --openrouter-api-key sk-xxx
# 或
openclaw models auth add
# 选择 OpenRouter API Key可用模型
通过 OpenRouter 可以访问:
- Anthropic Claude
- OpenAI GPT
- Google Gemini
- Meta Llama
- Mistral
- 更多...
查看完整列表:https://openrouter.ai/models
配置
json
{
"agents": {
"defaults": {
"model": {
"primary": "openrouter/anthropic/claude-3-opus"
}
}
}
}区域选择
OpenRouter 提供区域选择的模型:
json
{
"agents": {
"defaults": {
"model": {
"primary": "openrouter/anthropic/claude-3-opus:us"
}
}
}
}优势
- 单一 API 访问多个提供商
- 自动故障转移
- 统一计费
- 区域选择