> ## 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.

# 將 avante.nvim 搭配 CometAPI 使用

> 使用本指南，透過設定 base URL、API key，以及 model 或 provider 選項來將 avante.nvim 設定為使用 CometAPI。

[avante.nvim](https://github.com/yetone/avante.nvim) 是一個 Neovim 外掛，可將 AI 程式設計輔助功能帶入你的編輯器。將其設定為使用 CometAPI 作為後端，即可存取 GPT、Claude 與其他模型。

## 先決條件

* 已在 Neovim 中安裝 [avante.nvim](https://github.com/yetone/avante.nvim)
* 擁有一個 API key 已啟用的 [CometAPI](https://www.cometapi.com) 帳戶

## 設定

<Steps>
  <Step title="取得你的 CometAPI API key">
    登入 [CometAPI 控制台](https://www.cometapi.com/console)。點擊 **Add API 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="編輯你的 avante.nvim 設定">
    開啟你的 Neovim 設定檔，並將 API 端點設為 `https://api.cometapi.com/v1`。將你的 CometAPI 金鑰貼到 `openai` key 欄位中。

    <Frame>
      <img src="https://mintcdn.com/cometapi/mA1ovj6s0e3RM42l/images/integrations/810968_351623.png?fit=max&auto=format&n=mA1ovj6s0e3RM42l&q=85&s=160170230bf813b8887bbb94ffaeafc9" alt="包含 CometAPI base URL 與 API key 的 avante.nvim 設定檔" width="942" height="305" data-path="images/integrations/810968_351623.png" />
    </Frame>
  </Step>

  <Step title="重新載入並測試">
    重新載入 Neovim 並觸發 avante.nvim。成功的回應即表示設定運作正常。
  </Step>
</Steps>

<script type="application/ld+json">
  {`
    {
    "@context": "https://schema.org",
    "@graph": [
      {
        "@type": "HowTo",
        "@id": "https://apidoc.cometapi.com/integrations/avante-nvim#howto",
        "name": "將 avante.nvim 搭配 CometAPI 使用",
        "description": "使用本指南，透過設定 base URL、API key，以及 model 或 provider 選項來將 avante.nvim 設定為使用 CometAPI。",
        "step": [
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/avante-nvim#step-1",
            "position": 1,
            "name": "取得你的 CometAPI API key",
            "text": "建立或開啟你的 CometAPI 帳戶，然後從控制台複製一組啟用中的 API key。"
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/avante-nvim#step-2",
            "position": 2,
            "name": "編輯你的 avante.nvim 設定",
            "text": "完成「將 avante.nvim 搭配 CometAPI 使用」指南中的「編輯你的 avante.nvim 設定」步驟。"
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/avante-nvim#step-3",
            "position": 3,
            "name": "重新載入並測試",
            "text": "完成「將 avante.nvim 搭配 CometAPI 使用」指南中的「重新載入並測試」步驟。"
          }
        ]
      },
      {
        "@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": "將 avante.nvim 搭配 CometAPI 使用",
            "item": "https://apidoc.cometapi.com/integrations/avante-nvim"
          }
        ]
      }
    ]
    }
    `}
</script>
