Skip to content

OpenClaw配置

OpenClaw(龙虾bot)是一款开源本地AI助手。您可使用npm install -g openclaw@latest命令安装OpenClaw。

修改配置文件(推荐)

OpenClaw的配置文件位于~/.openclaw/openclaw.json

我们建议您修改models配置项:

json
{
  "models": {
    "mode": "merge",
    "providers": {
      "anthropic": {
        "baseUrl": "https://beta2.meeta.tech",
        "apiKey": "您生成的令牌",
        "models": []
      },
      "google": {
        "baseUrl": "https://beta2.meeta.tech/v1beta",
        "apiKey": "您生成的令牌",
        "models": []
      },
      "openai-codex": {
        "baseUrl": "https://beta2.meeta.tech/v1",
        "apiKey": "您生成的令牌",
        "api": "openai-responses",
        "models": []
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "anthropic/claude-sonnet-4-6"
      },
      "models": {
        "anthropic/claude-sonnet-4-6": {}
      }
    }
  }
}

在命令行中切换模型的命令示例:

shell
openclaw models set anthropic/claude-sonnet-4-6
openclaw models set google/gemini-3.1-pro-preview
openclaw models set openai-codex/gpt-5.4