跳轉到主要內容
使用本指南將 Claude Desktop Cowork 的第三方推論連接到 CometAPI。此設定可讓 Claude Desktop 從 Cowork、Projects 與支援的桌面工作流程,將 Claude Messages API 請求傳送到 CometAPI。 官方參考資料:
Claude Desktop 第三方推論需要 Anthropic 相容的 gateway。CometAPI 透過 Anthropic 訊息 API 支援 Claude 模型。
你從 Claude Desktop 傳送的內容會由 CometAPI 與所選模型供應商處理。除非你的組織允許這種工作流程,否則請勿傳送機密資料。

先決條件

  • 已從 claude.com/download 安裝 Claude Desktop
  • 包含 Developer modeConfigure third-party inference 的 Claude Desktop 版本
  • 擁有有效 API key 的 CometAPI 帳戶
  • 可在 CometAPI 中存取 Claude 模型
  • 可連線至 https://api.cometapi.com 的網路路徑
從 Claude Desktop 的登入畫面開始。如果你已使用 Anthropic 帳戶登入,請先登出再設定第三方推論。

設定

1

啟用開發者模式

開啟 Claude Desktop 並停留在登入畫面。在應用程式選單中,開啟 HelpTroubleshooting,然後選擇 Enable Developer Mode在 Windows 上,登入前可能較難操作選單。請先聚焦電子郵件欄位,按 Tab 直到選單取得焦點,再按 Enter
2

開啟第三方推論設定

啟用開發者模式後,開啟 DeveloperConfigure third-party inference設定視窗開啟後,左側側邊欄會顯示多個區段。請使用 Connection 區段來設定 CometAPI。
3

設定 gateway

Connection 區段中,輸入下列 CometAPI 值:
FieldValue
Inference providerGateway
GatewayAnthropic-compatible
Gateway base URLhttps://api.cometapi.com
Gateway API key你的 CometAPI API key,例如 <COMETAPI_KEY>
Gateway auth schemeBearer
Gateway extra headers留空
請務必完全依照上方內容填寫 base URL。Claude Desktop 要求使用 HTTPS base URL。下方截圖顯示已填入 CometAPI 值的 Connection 區段。已填入 CometAPI gateway base URL、API key 欄位與 bearer 驗證方案的 Claude Desktop Connection 設定
4

新增 model ID

Model list 中,手動加入以下 model ID:
Model ID建議用途
claude-opus-4-7複雜規劃與 agent 任務
claude-sonnet-4-6一般桌面使用
claude-haiku-4-5-20251001輕量 Prompt 與快速草稿
清單中的第一個模型會成為預設模型。如果你想要一般用途的預設模型,請將 claude-sonnet-4-6 放在第一個。
模型可用性可能會變動。如果設定後模型沒有出現在 Claude Desktop 中,請到 CometAPI Models 頁面 確認存取權限。
下方截圖顯示已為 CometAPI 設定三個 Claude model ID 的模型清單。Claude Desktop 模型清單顯示為 CometAPI 設定的 claude-opus-4-7、claude-sonnet-4-6 與 claude-haiku-4-5-20251001
5

在本機套用設定

點擊 Apply locally。Claude Desktop 會將選定的設定寫入本機使用者設定檔,並重新啟動應用程式。如果應用程式沒有重新啟動,請完全關閉 Claude Desktop,然後再次開啟。
6

開始 Cowork 工作階段

在登入畫面中,選擇用於第三方推論的 Cowork 選項。開啟 Cowork 或 Projects,選擇其中一個已設定的 Claude 模型,並送出簡短的測試 Prompt。成功收到回應即表示 Claude Desktop 正在使用 CometAPI 進行模型呼叫。

驗證設定

使用一個不需要外部工具的簡短 Prompt:
Reply with one sentence: Claude Desktop is connected through CometAPI.
如果 Claude Desktop 回傳回應,代表 base URL、API key 與模型清單都已正確設定。 下方截圖顯示透過 CometAPI 成功收到的 Cowork 回覆。 完成第三方推論設定後,Claude Desktop 透過 CometAPI 的 Cowork 回覆 若要檢查偵測到的設定,請開啟 HelpTroubleshootingCopy Managed Configuration Report。複製出的報告中,機密值會被遮蔽。

疑難排解

請確認你已選擇 HelpTroubleshootingEnable Developer Mode。接著完全關閉 Claude Desktop,然後重新開啟。如果找不到此選項,請安裝包含第三方推論設定功能的 Claude Desktop 版本。
請檢查以下項目:
  • Inference provider 已設為 Gateway
  • Gateway base URLhttps://api.cometapi.com
  • Gateway API key 包含你的 CometAPI API key,且沒有多餘空格。
  • 你已點擊 Apply locally,並完整重新啟動 Claude Desktop。
請確認 base URL 是以 https:// 開頭。Claude Desktop 不接受純 HTTP 的 gateway URL。也請確認你的 CometAPI 帳戶可存取 Claude 模型,且 API key 未被刪除或停用。
重新開啟 DeveloperConfigure third-party inference,並檢查 Model list 項目。model ID 必須與 CometAPI 提供的 ID 完全一致。每個 model ID 都要作為獨立項目加入。請勿在 UI 欄位中加入引號、逗號或多餘空格。
Claude Desktop 的第三方推論在此流程中需要 Anthropic 相容的 gateway。請使用 https://api.cometapi.com 與上方列出的 Claude model ID。
Code 分頁在 Claude Desktop 內使用 Claude Code 引擎。某些桌面設定套用到 Code 工作階段的方式,可能與套用到 Cowork 的方式不同。若要獨立在終端機中使用,請參閱 Claude Code 整合指南