AI 模型配置
使用 Claude 配置 OpenClaw
在 OpenClaw(原 Moltbot)中使用 Anthropic 的 Claude 模型。Claude 以乐于助人、无害和诚实著称。
🎯 为什么选择 Claude?
- ✓出色的指令遵循能力 — Claude 擅长处理复杂的多步骤任务
- ✓200K 上下文窗口 — 处理长文档并保持对话历史
- ✓强大的编程能力 — 非常适合自动化脚本和技术任务
- ✓注重安全 — 在提供帮助的同时避免有害输出
可用的 Claude 模型
Claude 3.5 Sonnet
推荐智能和速度的最佳平衡。推荐大多数用户使用。
claude-3-5-sonnet-20241022输入: $3.00/百万token
输出: $15.00/百万token
Claude 3.5 Haiku
最快最便宜。适合简单任务和高频使用。
claude-3-5-haiku-20241022输入: $0.80/百万token
输出: $4.00/百万token
Claude 3 Opus
最强能力的模型。最适合复杂推理和分析。
claude-3-opus-20240229输入: $15.00/百万token
输出: $75.00/百万token
* 价格为每百万 token,截至 2026 年 1 月。请查看 Anthropic 的定价页面获取最新费率。
设置说明
1
获取你的 API 密钥
在 Anthropic 注册并生成 API 密钥:
- • 前往 console.anthropic.com
- • 创建账户或登录
- • 导航到 API Keys 部分
- • 点击"Create Key"并复制
2
配置 OpenClaw
将 Claude 配置添加到你的配置文件:
{
"agent": {
"provider": "anthropic",
"model": "claude-3-5-sonnet-20241022",
"apiKey": "sk-ant-api03-YOUR-KEY-HERE"
}
}3
重启 OpenClaw
应用配置:
openclaw restart高级配置
{
"agent": {
"provider": "anthropic",
"model": "claude-3-5-sonnet-20241022",
"apiKey": "sk-ant-api03-...",
"maxTokens": 4096,
"temperature": 0.7,
"systemPrompt": "You are a helpful personal assistant named OpenClaw."
}
}maxTokens— 最大响应长度(默认:4096)temperature— 创造力级别 0-1(默认:0.7)systemPrompt— 自定义个性和指令
成本估算
使用 Claude 3.5 Sonnet 配合 OpenClaw 的典型月费用:
轻度使用(约 100 条消息/天)~$5-10/mo
中度使用(约 500 条消息/天)~$25-50/mo
重度使用(约 2000 条消息/天)~$100-200/mo
想要免费 AI? 使用 Ollama 本地模型 无限使用零成本。