跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://liaobots.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

OpenClaw

准备工作

参照官方文档安装 OpenClaw(旧名 Moltbot/Clawdbot)。支持macOS, Windows (WSL2), Linux。 文档全英文太难理解?使用 Liao 接入沉浸式翻译 各模型价格比例请参考 模型与价格,API 地址与备用地址请参考 API 调用示例

找到 OpenClaw 配置文件

macOS / Linux / WSL2: ~/.openclaw/openclaw.json~/.moltbot/moltbot.json~/.clawdbot/clawdbot.json

修改配置文件

将以下内容写入配置文件,替换 您的登录码 为您的实际登录码:
{
  "models": {
    "mode": "merge",
    "providers": {
      "anthropic": {
        "baseUrl": "https://ai.liaobots.work",
        "apiKey": "您的登录码",
        "models": []
      },
      "google": {
        "baseUrl": "https://ai.liaobots.work/v1beta",
        "apiKey": "您的登录码",
        "models": []
      },
      "openai-codex": {
        "baseUrl": "https://ai.liaobots.work/codex/v1",
        "apiKey": "您的登录码",
        "api": "openai-responses",
        "models": []
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "anthropic/claude-sonnet-4-6"
      },
      "models": {
        "anthropic/claude-sonnet-4-6": {}
      }
    }
  }
}
说明:
  • models 部分配置了三个 provider,分别对应 Claude、Gemini 和 OpenAI Codex 系列模型
  • models: [] 表示不做过滤,该 provider 下所有可用模型均可使用
  • agents 部分设置默认模型为 anthropic/claude-sonnet-4-6

在 OpenClaw 中切换当前使用模型

配置完成后,可使用以下命令切换模型:
openclaw models set anthropic/claude-sonnet-4-6
openclaw models set google/gemini-2.5-pro
openclaw models set openai-codex/o3-pro