Skip to content

OpenClaw

OpenClaw 是一个开源的个人 AI 助手平台,支持通过终端、Web UI 等多种方式与 AI 交互。通过配置 OpenAI 兼容端点,可接入 LimAPI 使用平台上的全部模型。

安装 OpenClaw

OpenClaw 需要 Node.js 22.19.0 或更高版本(仅 npm 安装方式需要)。可通过以下命令检查 Node.js 版本:

bash
node --version

如果未安装或版本过低,请访问 Node.js 官网下载安装。

macOS / Linux

推荐使用官方安装脚本:

bash
curl -fsSL https://raw.githubusercontent.com/openclaw/openclaw/main/install.sh | bash

或通过 npm 全局安装:

bash
npm install -g openclaw@latest

Windows

在 PowerShell 或 CMD 中通过 npm 全局安装:

bash
npm install -g openclaw@latest

其他安装方式请前往 OpenClaw 官方仓库查看。

首次安装后,OpenClaw 会自动启动配置向导完成初始设置,也可以手动执行 openclaw onboard 进行配置。向导中各配置项建议如下:

配置项建议配置
I understand this is powerful and inherently risky. Continue?选择 Yes
Onboarding mode选择 QuickStart
Model/auth provider选择 Skip for now(稍后配置 LimAPI 模型)
Filter models by provider选择 All providers
Default model选择 Keep current
Select channel (QuickStart)选择 Skip for now(稍后配置渠道)
Configure skills now? (recommended)选择 No
How do you want to hatch your bot?选择 Do this later

配置接入凭证

配置项说明
API KeyPortal 创建的 LimAPI API Key(sk- 开头)
Base URLhttps://limapi.com/api/anthropic(Anthropic 兼容端点)
可用模型平台支持的任意模型,完整列表通过 GET /api/v1/models 查询或在 Portal 模型广场查看

配置文件位于 ~/.openclaw/openclaw.json,OpenClaw 启动时会自动读取。

说明:示例配置禁用了网关鉴权(auth.mode: none),仅适合单机本地使用。如需共享或远程访问,请运行 openclaw doctor --fix 启用 token 鉴权。

首次配置:复制以下内容到配置文件,将 YOUR_API_KEY 替换为 LimAPI API Key。示例预置了平台 16 个常用模型,可按需增删(完整列表见 GET /api/v1/models)。

已有配置:若需保留已有配置,请勿直接全量替换,只需将 models.providers.limapi 节点合并进 models.providers,并追加 agents.defaults 中的 limapi/ 模型条目。

json
{
  "meta": {
    "lastTouchedVersion": "2026.2.1",
    "lastTouchedAt": "2026-08-10T00:00:00.000Z"
  },
  "models": {
    "mode": "merge",
    "providers": {
      "limapi": {
        "baseUrl": "https://limapi.com/api/anthropic",
        "apiKey": "YOUR_API_KEY",
        "api": "anthropic-messages",
        "models": [
          {
            "id": "qwen3.8-max",
            "name": "qwen3.8-max",
            "reasoning": false,
            "input": ["text", "image"],
            "contextWindow": 1048576,
            "maxTokens": 16384,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
          },
          {
            "id": "qwen3.7-max",
            "name": "qwen3.7-max",
            "reasoning": true,
            "input": ["text"],
            "contextWindow": 1048576,
            "maxTokens": 16384,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
          },
          {
            "id": "qwen3.7-plus",
            "name": "qwen3.7-plus",
            "reasoning": true,
            "input": ["text"],
            "contextWindow": 1048576,
            "maxTokens": 16384,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
          },
          {
            "id": "qwen3.6-plus",
            "name": "qwen3.6-plus",
            "reasoning": true,
            "input": ["text"],
            "contextWindow": 1048576,
            "maxTokens": 16384,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
          },
          {
            "id": "qwen3.6-flash",
            "name": "qwen3.6-flash",
            "reasoning": true,
            "input": ["text"],
            "contextWindow": 1048576,
            "maxTokens": 16384,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
          },
          {
            "id": "claude-opus-5",
            "name": "claude-opus-5",
            "reasoning": false,
            "input": ["text"],
            "contextWindow": 1000000,
            "maxTokens": 32768,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
          },
          {
            "id": "claude-sonnet-4-6",
            "name": "claude-sonnet-4-6",
            "reasoning": false,
            "input": ["text"],
            "contextWindow": 200000,
            "maxTokens": 8192,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
          },
          {
            "id": "deepseek-v4-pro",
            "name": "deepseek-v4-pro",
            "reasoning": true,
            "input": ["text"],
            "contextWindow": 1048576,
            "maxTokens": 16384,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
          },
          {
            "id": "deepseek-v4-flash",
            "name": "deepseek-v4-flash",
            "reasoning": true,
            "input": ["text"],
            "contextWindow": 1048576,
            "maxTokens": 16384,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
          },
          {
            "id": "deepseek-v3.2",
            "name": "deepseek-v3.2",
            "reasoning": true,
            "input": ["text"],
            "contextWindow": 131072,
            "maxTokens": 16384,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
          },
          {
            "id": "kimi-k2.7-code",
            "name": "kimi-k2.7-code",
            "reasoning": true,
            "input": ["text"],
            "contextWindow": 262144,
            "maxTokens": 16384,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
          },
          {
            "id": "kimi-k2.6",
            "name": "kimi-k2.6",
            "reasoning": false,
            "input": ["text"],
            "contextWindow": 131072,
            "maxTokens": 16384,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
          },
          {
            "id": "glm-5.2",
            "name": "glm-5.2",
            "reasoning": true,
            "input": ["text"],
            "contextWindow": 1048576,
            "maxTokens": 16384,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
          },
          {
            "id": "glm-5.1",
            "name": "glm-5.1",
            "reasoning": true,
            "input": ["text"],
            "contextWindow": 202752,
            "maxTokens": 16384,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
          },
          {
            "id": "glm-5",
            "name": "glm-5",
            "reasoning": true,
            "input": ["text"],
            "contextWindow": 202752,
            "maxTokens": 16384,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
          },
          {
            "id": "MiniMax-M2.5",
            "name": "MiniMax-M2.5",
            "reasoning": true,
            "input": ["text"],
            "contextWindow": 196608,
            "maxTokens": 16384,
            "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "limapi/qwen3.8-max"
      },
      "models": {
        "limapi/qwen3.8-max": {},
        "limapi/qwen3.7-max": {},
        "limapi/qwen3.7-plus": {},
        "limapi/qwen3.6-plus": {},
        "limapi/qwen3.6-flash": {},
        "limapi/claude-opus-5": {},
        "limapi/claude-sonnet-4-6": {},
        "limapi/deepseek-v4-pro": {},
        "limapi/deepseek-v4-flash": {},
        "limapi/deepseek-v3.2": {},
        "limapi/kimi-k2.7-code": {},
        "limapi/kimi-k2.6": {},
        "limapi/glm-5.2": {},
        "limapi/glm-5.1": {},
        "limapi/glm-5": {},
        "limapi/MiniMax-M2.5": {}
      }
    }
  },
  "gateway": {
    "mode": "local",
    "auth": { "mode": "none" }
  }
}
字段说明
models.providers.limapi.baseUrlLimAPI Anthropic 兼容端点,固定为 https://limapi.com/api/anthropic
models.providers.limapi.apiKeyPortal 创建的 API Key
models.providers.limapi.api协议类型,固定为 anthropic-messages
models.providers.limapi.models向 OpenClaw 声明的模型清单,含上下文窗口、最大输出等元信息
agents.defaults.model.primary默认使用的模型,格式为 limapi/<模型名称>

写入后重启网关使配置生效:

bash
openclaw gateway restart

验证

启动 OpenClaw 进入交互界面:

bash
openclaw

在交互界面中发送一条消息(如「你好」),模型正常返回响应即配置成功。也可输入 /status 查看当前模型与连接状态。如需切换模型,输入 /model <模型名称>

常见命令

命令说明示例
/help显示可用命令的快速摘要/help
/status查看当前模型、会话、网关等状态信息/status
/model <模型名称>切换当前会话使用的模型/model qwen3.8-max
/new开始一个新会话/new
/compact压缩对话历史,释放上下文窗口空间/compact
/skills展示全部可用的 Skill/skills

常见问题

报错 "HTTP 401: Incorrect API key provided."

可能原因:

  1. API Key 无效、过期、为空或格式错误。请在 Portal 的「API Keys」页面确认 Key 状态,并确保复制完整且无空格。
  2. API Key 与 Base URL 不匹配。LimAPI 的 Anthropic 兼容端点固定为 https://limapi.com/api/anthropic,请勿使用其他平台地址。
  3. 历史配置缓存导致配置错误。可检查 ~/.openclaw/openclaw.jsonmodels.providers.limapi 节点后重新写入。

配置后仍连接 OpenClaw 官方服务

修改配置文件后需重启网关使配置生效:

bash
openclaw gateway restart

如何查看已配置的模型?

在终端输入 openclaw 进入交互界面,接着输入 /model 查看模型列表。按回车键选中模型,按 Esc 键退出模型列表。

一键配置

使用 LimAPI Agent 桌面客户端 可自动合并写入 ~/.openclaw/openclaw.json

LimAPI — 大模型聚合网关