跳到主要内容

OpenClaw

OpenClaw 是一个自托管网关,将聊天应用和渠道界面连接到 AI 智能体。 官方网站:docs.openclaw.ai

1.1 使用方法

方式一:配置文件或引导向导(推荐)

  1. 运行 openclaw onboard 进行引导式设置,或直接编辑 ~/.openclaw/openclaw.json

  2. 如果您的安装使用自定义位置,使用 openclaw config file 检查。

  3. models.providers 下添加自定义提供商。

  4. 将提供商设置为使用 OpenAI 兼容传输:

    • apiopenai-completions

    • baseUrlhttps://api.luchentech.com/inference/v1

  5. 将默认模型指向提供商/模型对。

  6. apiKey 设置为您的 Luchentech 密钥,或使用 OpenClaw 文档中记录的 SecretRef 或环境变量替换流程。

配置示例

{
models: {
providers: {
luchentech: {
baseUrl: "https://api.luchentech.com/inference/v1",
api: "openai-completions",
apiKey: "your-luchentech-key",
models: [
{
id: "minimax/minimax-m2.5",
name: "Luchentech Minimax M2.5",
reasoning: false,
input: ["text"],
contextWindow: 128000,
maxTokens: 8192
}
]
}
}
},
agents: {
defaults: {
model: { primary: "luchentech/minimax/minimax-m2.5" }
}
}
}

方式二:非交互式引导

export CUSTOM_API_KEY="your-luchentech-key"

openclaw onboard --non-interactive \
--auth-choice custom-api-key \
--custom-base-url "https://api.luchentech.com/inference/v1" \
--custom-model-id "minimax/minimax-m2.5" \
--custom-api-key "$CUSTOM_API_KEY" \
--secret-input-mode plaintext \
--custom-compatibility openai

1.2 参考