跳轉到主要內容
Cohere 透過其 Compatibility API 提供與 OpenAI 相容的推論。OpenClaw 在外部化轉換期間隨附 Cohere 提供者,並也將其作為官方外部外掛發布,附帶 Command A 模型目錄。
屬性
提供者 idcohere
外掛轉換期間內建;官方外部套件
驗證環境變數COHERE_API_KEY
初始設定旗標--auth-choice cohere-api-key
直接命令列介面旗標--cohere-api-key <key>
API與 OpenAI 相容(openai-completions
基礎 URLhttps://api.cohere.ai/compatibility/v1
預設模型cohere/command-a-03-2025

開始使用

  1. Cohere 已包含在目前的 OpenClaw 套件中。如果無法使用,請安裝外部套件並重新啟動閘道:
openclaw plugins install @openclaw/cohere-provider
openclaw gateway restart
  1. 建立 Cohere API 金鑰。
  2. 執行初始設定:
openclaw onboard --non-interactive \
  --auth-choice cohere-api-key \
  --cohere-api-key "$COHERE_API_KEY"
  1. 確認目錄可用:
openclaw models list --provider cohere
只有在尚未設定主要模型時,才會設定預設模型。

僅使用環境變數設定

COHERE_API_KEY 可供閘道程序使用,然後選取 Cohere 模型:
{
  agents: {
    defaults: {
      model: { primary: "cohere/command-a-03-2025" },
    },
  },
}
如果閘道以常駐程式或在 Docker 中執行,請為該服務設定 COHERE_API_KEY。只在互動式 shell 中匯出它,並不會讓已在執行中的閘道可使用它。

相關