进阶教程 较易 15分钟

配置多个 AI 模型

为不同任务配置不同的 AI 模型,优化成本和效果

#AI Models #Configuration #Claude

准备工作

  • OpenClaw deployed
  • API keys for AI models

操作步骤

1

获取 API Key

从各个模型提供商获取 API Key。

命令 / 操作

Claude
访问 https://console.anthropic.com → 注册 → API Keys → 创建 Key
OpenAI
访问 https://platform.openai.com → 注册 → API Keys → 创建 Key
Google Gemini
访问 https://aistudio.google.com → 注册 → Get API Key

小提示

  • Gemini has free quota, good for beginners
  • Claude 3.5 Sonnet is powerful but more expensive
  • You can configure multiple models at the same time
2

添加模型配置

在 OpenClaw 中添加模型。

命令 / 操作

All Systems
OpenClaw 管理界面 → 设置 → 模型配置 → 添加模型 → 选择模型类型 → 填入 API Key

小提示

  • You can add multiple models of the same type (e.g., multiple Claude models)
  • Each model can have different parameters (temperature, max tokens, etc.)
3

设置默认模型

选择主要使用的模型。

命令 / 操作

All Systems
模型配置 → 选择一个模型 → 设为默认

小提示

  • Default model will handle most requests
  • For complex tasks, you can temporarily switch to a stronger model
4

配置模型策略(可选)

为不同类型的任务指定不同模型。

命令 / 操作

All Systems
设置 → 模型策略 → 添加规则(如:简单问题用 Haiku,复杂推理用 Sonnet)

小提示

  • This balances performance and cost
  • Use cheaper models for simple tasks, stronger models for complex tasks

常见问题

API Key 无效?
检查是否正确复制,确认没有多余的空格。部分模型需要绑定支付方式
调用超时?
可能是网络问题,考虑使用代理或切换到国内模型