Skip to main content
Cohere 通过其 Compatibility API 提供 OpenAI 兼容的推理。OpenClaw 在 Cohere provider 外部化过渡期间内置它,同时也将其作为官方外部插件发布。
属性
提供商 IDcohere
插件过渡期间内置;官方外部包
凭证环境变量COHERE_API_KEY
新手引导标志--auth-choice cohere-api-key
直接 CLI 标志--cohere-api-key <key>
APIOpenAI 兼容(openai-completions
基础 URLhttps://api.cohere.ai/compatibility/v1
默认模型cohere/command-a-03-2025
上下文窗口256,000 个 token

入门指南

  1. Cohere 随当前 OpenClaw 包一起提供。如果缺失,请安装外部包并重启 Gateway 网关:
openclaw plugins install @openclaw/cohere-provider
openclaw gateway restart
  1. 创建 Cohere API key。
  2. 运行新手引导:
openclaw onboard --non-interactive \
  --auth-choice cohere-api-key \
  --cohere-api-key "$COHERE_API_KEY"
  1. 确认可用目录:
openclaw models list --provider cohere
新手引导仅在尚未配置主模型时,才会将 Cohere 设置为主模型。

仅环境变量设置

让 Gateway 网关进程可以使用 COHERE_API_KEY,然后选择 Cohere 模型:
{
  agents: {
    defaults: {
      model: { primary: "cohere/command-a-03-2025" },
    },
  },
}
如果 Gateway 网关作为守护进程运行或在 Docker 中运行,请为该服务设置 COHERE_API_KEY。仅在交互式 shell 中导出它,不会让已经运行的 Gateway 网关可用。

相关