Get started

3 步接入 ClawBrain —
让你的龙虾更聪明

兼容 OpenAI & Anthropic 双协议。不改源码,5 分钟完成配置,tool calling 成功率从 60% 提升到 95%。

01 · Why

通用大模型不够用,ClawBrain 才够

tool calling 经常失败、多步任务中途崩溃 — ClawBrain 针对 Agent 场景专项训练,从根本上解决这些问题

通用大模型
~60%
成功率

参数错、工具选错、任务中断

通用大模型没有针对 Agent 场景优化。复杂 tool calling 经常出现参数格式错误,多步骤任务中途就崩了。

ClawBrain 大模型
95%
成功率

专为 Agent 场景训练

针对 tool calling、多步规划、错误恢复专项训练,内置智能适配、自动纠错、任务链保护 — 让每一次调用都稳。

02 · Setup

3 步接入,零代码改动

ClawBrain 完全兼容 OpenAI API 格式,只需要修改 OpenClaw 的配置文件

1

注册获取 API Key

前往 ClawBrain 控制台注册账号,免费获取 API Key。每天 30 Credits 免费额度,足够体验和开发使用。

前往控制台注册
2

配置 OpenClaw

编辑 ~/.openclaw/openclaw.json,把下面这段加进去,替换你的 API Key:

~/.openclaw/openclaw.json
{
  "models": {
    "providers": {
      "clawbrain": {
        "baseUrl": "https://api.clawbrain.dev/v1",
        "apiKey": "你的 API Key",
        "api": "openai-completions",
        "models": [{
          "id": "clawbrain-auto",
          "name": "ClawBrain Auto",
          "input": ["text", "image"],
          "contextWindow": 128000,
          "maxTokens": 32768
        }]
      }
    }
  },
  "agents": {
    "defaults": { "model": { "primary": "clawbrain/clawbrain-auto" } }
  }
}
视觉理解已开启 · "input": ["text", "image"] 表示支持图片输入,接入后可直接给龙虾发图片,它会自动识别内容。

四个模型 ID 可选

模型 ID 场景 Credits
clawbrain-auto 推荐 智能分发,简单任务秒回,复杂任务自动深思 动态
clawbrain-flash 简单问答、日常对话,省钱首选 0.5
clawbrain-pro 代码编写、文件操作、搜索等日常任务 1
clawbrain-max 复杂推理、多步规划、深度分析 3
3

重启验证

运行重启命令,然后执行一个简单任务测试:

terminal
# 1. 重启 gateway
openclaw gateway restart

# 2. 在 OpenClaw 中执行测试
> 帮我查看当前目录下的文件

如果返回结果正常,说明接入成功。也可以在 控制台 查看 API 调用记录确认。

想跳过手动配置?

安装 ClawBrain Boost Skill 自动完成全部配置,包含智能适配 / SOUL 优化 / 记忆压缩 / 垂直规则注入。

clawhub install clawbrain-boost
03 · SDK & IDE

不止 OpenClaw — 主流工具都能接

Python / curl / Continue / Claude Code / Cursor — 选你用的工具,一键查看配置

使用 OpenAI 官方 SDK,只需要改 base_urlapi_key:

demo.py
from openai import OpenAI

client = OpenAI(
    api_key="你的 API Key",
    base_url="https://api.clawbrain.dev/v1"
)

response = client.chat.completions.create(
    model="clawbrain-auto",  # 推荐:自动选择最优模型
    messages=[{"role": "user", "content": "分析这段代码的性能问题"}],
    stream=True
)

for chunk in response:
    print(chunk.choices[0].delta.content or "", end="")

命令行直接测试,快速验证 API 连通性:

terminal
curl https://api.clawbrain.dev/v1/chat/completions \
  -H "Authorization: Bearer 你的API-Key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "clawbrain-auto",
    "messages": [{"role": "user", "content": "你好"}]
  }'

Continue — VS Code + 全系列 JetBrains IDE 都支持,是最推荐的方案。在插件市场搜 Continue 安装,然后编辑 ~/.continue/config.json:

~/.continue/config.json
{
  "models": [{
    "title": "ClawBrain Auto",
    "provider": "openai",
    "model": "clawbrain-auto",
    "apiBase": "https://api.clawbrain.dev/v1",
    "apiKey": "你的 API Key"
  }, {
    "title": "ClawBrain Max",
    "provider": "openai",
    "model": "clawbrain-max",
    "apiBase": "https://api.clawbrain.dev/v1",
    "apiKey": "你的 API Key"
  }]
}

Claude Code — Anthropic 官方 CLI。ClawBrain 已兼容 Anthropic Messages API,编辑 ~/.claude/settings.json 添加环境变量:

~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.clawbrain.dev",
    "ANTHROPIC_AUTH_TOKEN": "你的 API Key",
    "ANTHROPIC_MODEL": "clawbrain-pro"
  }
}
模型推荐 · clawbrain-pro 日常编码 · clawbrain-max 复杂重构 · clawbrain-auto 自动判断(推荐)

Cursor — Settings → Models → Add Model → 选 OpenAI API。
Cline — Settings → 选 "OpenAI Compatible" → 填入 Base URL 和 API Key。

settings
# Base URL
https://api.clawbrain.dev/v1

# API Key
ct-你的key

# Model (推荐)
clawbrain-auto     # 自动选择
clawbrain-max      # 深度推理
协议说明 · OpenAI 兼容工具(Continue / Cursor / Cline)Base URL 用 https://api.clawbrain.dev/v1;Anthropic 兼容工具(Claude Code)用 https://api.clawbrain.dev
Ready

准备好让你的龙虾更聪明了吗?

免费注册,5 分钟完成接入

免费开始使用 先看它怎么工作 →