Appearance
OpenClaw 配置指南
OpenClaw 是一个自托管的消息网关,可以将 WhatsApp、Telegram、Discord、iMessage 等聊天平台与 AI Agent 连接起来。
以下配置以默认端点 iina.ai 为例,如需使用国内加速端点,请将 iina.ai 替换为 acc.iina.ai。
安装 OpenClaw
shell
# 安装(需要 Node 22+)
curl -fsSL https://openclaw.ai/install.sh | bash配置 API 密钥
获取 API 密钥:登录控制台新建令牌,建议留空
模型限制列表以支持所有模型。编辑配置文件,修改
auth和models部分:json{ "auth": { "profiles": { "anthropic:default": { "provider": "anthropic", "mode": "api_key" } } }, "models": { "mode": "merge", "providers": { "iina": { "baseUrl": "https://iina.ai/", "apiKey": "<API_KEY>", "auth": "api-key", "api": "anthropic-messages", "authHeader": true, "models": [ { "id": "claude-opus-4-6", "name": "claude-opus-4-6", "reasoning": true, "input": [ "text", "image" ], "cost": { "input": 5, "output": 25, "cacheRead": 0.5, "cacheWrite": 6.5 }, "contextWindow": 200000, "maxTokens": 64000, "compat": { "supportsStore": true, "supportsDeveloperRole": true, "supportsReasoningEffort": true } } ] } } }, }设置默认模型,在
~/.openclaw/openclaw.json中将agents.defaults.model.primary设置为iina/claude-opus-4-6:json{ "agents": { "defaults": { "model": { "primary": "iina/claude-opus-4-6" }, ... } } }删除已有的模型缓存文件并重启网关:
shellrm ~/.openclaw/agents/main/agent/models.json openclaw gateway restart
使用 OpenClaw
其他配置请参考 OpenClaw 官方文档。
