> ## Documentation Index
> Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 使用 Open WebUI 搭配 CometAPI

> 使用本指南透過設定 base URL、API key，以及 model 或 provider 選項，將 Open WebUI 設定為搭配 CometAPI 使用。

[Open WebUI](https://openwebui.com/) 是一個適用於 AI 模型的自架 Web 介面。將它設定為使用 CometAPI 作為外部的 OpenAI 相容連線。

## 先決條件

* [Open WebUI](https://openwebui.com/) 已在執行中（自行架設，或透過示範站 [open.zetatechs.online](https://openwebui.com/)）
* 一個具備有效 API key 的 [CometAPI](https://www.cometapi.com) 帳戶

## 設定

<Steps>
  <Step title="取得你的 CometAPI API key">
    登入 [CometAPI 控制台](https://www.cometapi.com/console)。點擊 **Add API Key**，並複製你的 key 和 base URL（`https://api.cometapi.com`）。

    <Frame>
      <img src="https://mintcdn.com/cometapi/SZhlxZhCnMLn__BW/images/overview/810968_364191.png?fit=max&auto=format&n=SZhlxZhCnMLn__BW&q=85&s=aef81a83f29f8eb16655ed4060425f50" alt="CometAPI 控制台 — Add API Key" width="3824" height="1892" data-path="images/overview/810968_364191.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/cometapi/HhtmQffktazbxUvS/images/overview/810968_364193.png?fit=max&auto=format&n=HhtmQffktazbxUvS&q=85&s=d893f659267150d0faf45f99eb5dffc1" alt="CometAPI API key 和 base URL" width="2434" height="1232" data-path="images/overview/810968_364193.png" />
    </Frame>
  </Step>

  <Step title="新增外部 OpenAI 連線">
    在 Open WebUI 中，前往 **Admin Panel** → **Settings** → **External Connections**。啟用 **External Link OpenAI API**，在 **API Address** 欄位輸入 `https://api.cometapi.com/v1`，將你的 key 貼到 **Key** 欄位中，然後點擊 **Save**。

    <Frame>
      <img src="https://mintcdn.com/cometapi/mA1ovj6s0e3RM42l/images/integrations/810968_351624.png?fit=max&auto=format&n=mA1ovj6s0e3RM42l&q=85&s=4878931888f1deeda5365545bc35a01a" alt="已輸入 CometAPI URL 的 Open WebUI 外部連線設定" width="1265" height="346" data-path="images/integrations/810968_351624.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/cometapi/mA1ovj6s0e3RM42l/images/integrations/810968_351625.png?fit=max&auto=format&n=mA1ovj6s0e3RM42l&q=85&s=40e7df7cb60b43a4b585ededa36847f2" alt="已儲存設定且 CometAPI 連線啟用中的 Open WebUI" width="1265" height="408" data-path="images/integrations/810968_351625.png" />
    </Frame>
  </Step>

  <Step title="測試連線">
    開始一個聊天並送出測試訊息。若成功收到回覆，即表示整合運作正常。
  </Step>
</Steps>

<script type="application/ld+json">
  {`
    {
    "@context": "https://schema.org",
    "@graph": [
      {
        "@type": "HowTo",
        "@id": "https://apidoc.cometapi.com/integrations/open-webui#howto",
        "name": "使用 Open WebUI 搭配 CometAPI",
        "description": "使用本指南透過設定 base URL、API key，以及 model 或 provider 選項，將 Open WebUI 設定為搭配 CometAPI 使用。",
        "step": [
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/open-webui#step-1",
            "position": 1,
            "name": "取得你的 CometAPI API key",
            "text": "建立或開啟你的 CometAPI 帳戶，然後從控制台複製一組有效的 API key。"
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/open-webui#step-2",
            "position": 2,
            "name": "新增外部 OpenAI 連線",
            "text": "完成「使用 Open WebUI 搭配 CometAPI」指南中的「新增外部 OpenAI 連線」步驟。"
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/open-webui#step-3",
            "position": 3,
            "name": "測試連線",
            "text": "從 CometAPI Models 頁面選擇目前可用的 model ID，然後從整合中送出測試請求。"
          }
        ]
      },
      {
        "@type": "BreadcrumbList",
        "itemListElement": [
          {
            "@type": "ListItem",
            "position": 1,
            "name": "CometAPI 文件",
            "item": "https://apidoc.cometapi.com/"
          },
          {
            "@type": "ListItem",
            "position": 2,
            "name": "整合",
            "item": "https://apidoc.cometapi.com/integrations"
          },
          {
            "@type": "ListItem",
            "position": 3,
            "name": "使用 Open WebUI 搭配 CometAPI",
            "item": "https://apidoc.cometapi.com/integrations/open-webui"
          }
        ]
      }
    ]
    }
    `}
</script>
