Windows 安装 OpenClaw + MiniMax 教程

一、安装 OpenClaw

1. 前置要求

  • Node.js >=22
  • 下载地址:https://nodejs.org (选择 LTS 版本)

检查版本:

node -v

2. 安装 OpenClaw

方式一:使用 PowerShell 安装脚本(推荐)

以管理员身份运行 PowerShell:

iwr -useb https://openclaw.ai/install.ps1 | iex

方式二:手动 npm 安装

npm install -g openclaw@latest

3. 初始化配置

# 运行安装向导
openclaw onboard --install-daemon

# 检查安装状态
openclaw doctor
openclaw status
openclaw health

二、配置 MiniMax 模型

MiniMax 提供两个版本:

  • MiniMax M2.1 - 标准版
  • MiniMax M2.1 Lightning - 快速版

方法 1:使用 OAuth(推荐,无需 API Key)

# 启用 MiniMax OAuth 插件
openclaw plugins enable minimax-portal-auth
openclaw gateway restart
openclaw onboard --auth-choice minimax-portal

系统会提示选择节点:

  • Global - 国际用户 (api.minimax.io)
  • CN - 中国用户 (api.minimaxi.com)

方法 2:使用 API Key

步骤 1:获取 MiniMax API Key
  1. 访问:https://platform.minimax.io
  2. 注册账号并获取 API Key
步骤 2:配置环境变量
# 设置 API Key(临时)
$env:MINIMAX_API_KEY = "sk-你的API密钥"

或永久保存到系统环境变量。

步骤 3:运行配置向导
openclaw configure

依次选择:

  1. Model/auth
  2. MiniMax M2.1
  3. 设置默认模型
步骤 4:手动编辑配置文件

如果需要手动配置,编辑 ~/.openclaw/openclaw.json

{
  env: { 
    MINIMAX_API_KEY: "sk-你的API密钥" 
  },
  agents: { 
    defaults: { 
      model: { 
        primary: "minimax/MiniMax-M2.1" 
      } 
    } 
  },
  models: {
    mode: "merge",
    providers: {
      minimax: {
        baseUrl: "https://api.minimax.io/anthropic",
        apiKey: "${MINIMAX_API_KEY}",
        api: "anthropic-messages",
        models: [
          {
            id: "MiniMax-M2.1",
            name: "MiniMax M2.1",
            reasoning: false,
            input: ["text"],
            cost: { input: 15, output: 60, cacheRead: 2, cacheWrite: 10 },
            contextWindow: 200000,
            maxTokens: 8192,
          },
          {
            id: "MiniMax-M2.1-lightning",
            name: "MiniMax M2.1 Lightning",
            reasoning: false,
            input: ["text"],
            cost: { input: 15, output: 80, cacheRead: 2, cacheWrite: 10 },
            contextWindow: 200000,
            maxTokens: 8192,
          }
        ],
      },
    },
  },
}

方法 3:MiniMax 作为备用模型(Opus 为主)

{
  env: { MINIMAX_API_KEY: "sk-..." },
  agents: {
    defaults: {
      models: {
        "anthropic/claude-opus-4-5": { alias: "opus" },
        "minimax/MiniMax-M2.1": { alias: "minimax" },
      },
      model: {
        primary: "anthropic/claude-opus-4-5",
        fallbacks: ["minimax/MiniMax-M2.1"],
      },
    },
  },
}

三、验证配置

# 列出可用模型
openclaw models list

# 切换到 MiniMax
openclaw models set minimax/MiniMax-M2.1

# 测试模型
openclaw chat "你好,请介绍一下你自己"

四、常见问题

问题 解决方案
openclaw: command not found npm prefix -g 路径加入 PATH
未知模型 minimax/MiniMax-M2.1 检查 API Key 或启用 OAuth 插件
认证失败 确认 API Key 正确或重新运行 OAuth 认证

Logo

小龙虾开发者社区是 CSDN 旗下专注 OpenClaw 生态的官方阵地,聚焦技能开发、插件实践与部署教程,为开发者提供可直接落地的方案、工具与交流平台,助力高效构建与落地 AI 应用

更多推荐