OpenClaw 支持几乎所有主流 LLM 提供商。选择提供商、认证后,以 provider/model 格式设置默认模型即可。
快速开始
bash
# 通过引导向导配置(推荐)
openclaw onboard
# 手动配置默认模型json
{
"agents": {
"defaults": {
"model": { "primary": "anthropic/claude-opus-4-6" }
}
}
}支持的提供商(A-Z)
Anthropic
Claude 系列模型,OpenClaw 的首选提供商:
json
{
"agents": {
"defaults": {
"model": { "primary": "anthropic/claude-sonnet-4-6" }
}
}
}Amazon Bedrock
通过 AWS 访问 Claude 和其他模型:
json
{
"providers": {
"bedrock": {
"region": "us-east-1"
}
}
}Ollama(本地模型)
在本地运行开源模型,完全私密:
json
{
"providers": {
"ollama": {
"baseUrl": "http://localhost:11434"
}
}
}json
{
"agents": {
"defaults": {
"model": { "primary": "ollama/llama3.1:8b" }
}
}
}OpenAI(含 Codex)
json
{
"agents": {
"defaults": {
"model": { "primary": "openai/gpt-4o" }
}
}
}OpenRouter
通过一个 API Key 访问数百个模型:
json
{
"agents": {
"defaults": {
"model": { "primary": "openrouter/anthropic/claude-opus-4-6" }
}
}
}Cloudflare AI Gateway
通过 Cloudflare 代理模型请求,获得缓存和分析:
json
{
"providers": {
"cloudflare-ai-gateway": {
"accountId": "your-account-id",
"gatewayId": "your-gateway-id"
}
}
}LiteLLM(统一网关)
自托管 LiteLLM 代理,统一管理多个提供商:
json
{
"providers": {
"litellm": {
"baseUrl": "http://localhost:4000",
"apiKey": "your-litellm-key"
}
}
}vLLM(本地高性能推理)
json
{
"providers": {
"vllm": {
"baseUrl": "http://localhost:8000"
}
}
}GitHub Copilot
复用 GitHub Copilot 订阅:
json
{
"agents": {
"defaults": {
"model": { "primary": "github-copilot/gpt-4o" }
}
}
}中国区提供商
OpenClaw 支持多个中国主流提供商:
| 提供商 | 代表模型 | 说明 |
|---|---|---|
| Qwen(通义千问) | qwen/qwen-plus | 阿里云,OAuth 认证 |
| MiniMax | minimax/abab6.5s-chat | 国内领先多模态 |
| Moonshot AI(Kimi) | moonshot/moonshot-v1-8k | 长上下文 |
| GLM | glm/glm-4 | 清华 ChatGLM |
| Qianfan(文心) | qianfan/ernie-4.0 | 百度文心 |
| Xiaomi MiMo | xiaomi/mimo | 小米 MiMo |
| Z.AI | zai/... | Z.AI 平台 |
其他提供商
| 提供商 | 特点 |
|---|---|
| Mistral | 高效欧洲模型 |
| NVIDIA | NIM 推理服务 |
| Together AI | 开源模型云端推理 |
| Hugging Face | 数万个开源模型 |
| Venice AI | 隐私优先,去中心化 |
| Vercel AI Gateway | 与 Vercel 集成 |
| Kilocode | 专为代码优化 |
| OpenCode Zen | 轻量级 AI 编程 |
音频转写提供商
| 提供商 | 说明 |
|---|---|
| Deepgram | 高精度实时语音转文字 |
社区工具
- Claude Max API Proxy:通过 Claude 订阅凭证访问 API 的社区代理(使用前请核查 Anthropic 政策)
多提供商故障转移
json
{
"agents": {
"defaults": {
"model": {
"primary": "anthropic/claude-sonnet-4-6",
"fallback": "openai/gpt-4o"
}
}
}
}主提供商失败时自动切换,详见 Model Failover 文档。
原文:Model Providers - OpenClaw | 来源:OpenClaw 官方文档