跳转至

Cohere

Cohere 通过其兼容性 API 提供与 OpenAI 兼容的推理服务。OpenClaw 将 Cohere 作为官方外部插件提供。

Property Value
Provider id cohere
插件 @openclaw/cohere-provider
认证环境变量 COHERE_API_KEY
初始化标志 --auth-choice cohere-api-key
直接 CLI 标志 --cohere-api-key <key>
API OpenAI 兼容(openai-completions)
基础 URL https://api.cohere.ai/compatibility/v1
默认模型 cohere/command-a-plus-05-2026
上下文窗口 128,000 个 token

内置目录

Model ref Visibility Input Context Max output Notes
cohere/command-a-plus-05-2026 可见 文本、图像 128,000 64,000 默认;旗舰级智能体与推理模型
cohere/command-a-03-2025 隐藏 文本 256,000 8,000 上一代;已被 Command A+ 取代
cohere/command-a-reasoning-08-2025 隐藏 文本 256,000 32,000 上一代;已被 Command A+ 取代
cohere/command-a-vision-07-2025 隐藏 文本、图像 128,000 8,000 上一代;已被 Command A+ 取代
cohere/north-mini-code-1-0 可见 文本、图像 256,000 64,000 智能体编码;推理;免费限额

支持推理的 Cohere 模型支持两种兼容性 API 推理模式。OpenClaw 将 off 映射为 none,并将所有已启用的思考级别映射为 high。Command A Vision 不支持工具调用,因此 OpenClaw 会为该模型禁用智能体工具。

开始使用

  1. 安装官方插件:
openclaw plugins install @openclaw/cohere-provider

安装会自动应用于正在运行的 Gateway;否则将在下次启动时生效。参见 应用更改并检查。

  1. 创建一个 Cohere API 密钥。
  2. 运行初始化:
openclaw onboard --non-interactive --accept-risk --skip-health \
  --auth-choice cohere-api-key \
  --cohere-api-key "$COHERE_API_KEY"
  1. 确认目录可用:
openclaw models list --provider cohere

仅当尚未配置主模型时,初始化才会将 Cohere 设置为主模型。

初始化会保留你的模型条目,并将生成的目录行留给自动发现处理。使用 models.mode: "replace" 时,它还会写入内置目录,因为该模式会跳过自动发现。

仅环境变量设置

将 COHERE_API_KEY 提供给 Gateway 进程,然后选择 Cohere 模型:

{
  agents: {
    defaults: {
      model: { primary: "cohere/command-a-plus-05-2026" },
    },
  },
}

Note

如果 Gateway 以守护进程或 Docker 方式运行,请为该服务设置 COHERE_API_KEY。仅在交互式 shell 中导出该变量,并不会使其对正在运行的 Gateway 可用。

本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 cl/openclaw