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

# 在 Continue 中使用 CometAPI

> 使用本指南，通过设置 base URL、API key 以及 model 或 provider 选项，在 Continue 中配置 CometAPI。

[Continue](https://continue.dev) 是一个开源的 VS Code 扩展，用于提供 AI 驱动的编码辅助。它提供第一方 CometAPI provider——无需手动配置 URL。

## 前提条件

* 在 VS Code 中安装 [Continue](https://marketplace.visualstudio.com/items?itemName=Continue.continue)
* 拥有一个已启用 API key 的 [CometAPI](https://www.cometapi.com) 账户

## 设置

<Steps>
  <Step title="在 VS Code 中安装 Continue">
    在 VS Code 扩展面板中搜索 **Continue** 并安装。

    <Frame>
      <img src="https://mintcdn.com/cometapi/SZhlxZhCnMLn__BW/images/integrations/810968_362621.png?fit=max&auto=format&n=SZhlxZhCnMLn__BW&q=85&s=6e94ab329f18d8e02387dc6fe8c798e3" alt="显示 Continue 扩展的 VS Code 扩展面板" width="1194" height="800" data-path="images/integrations/810968_362621.png" />
    </Frame>
  </Step>

  <Step title="获取你的 CometAPI API 密钥">
    登录 [CometAPI 控制台](https://www.cometapi.com/console)。点击 **Add API Key** 并复制你的密钥。

    <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 密钥和 base URL" width="2434" height="1232" data-path="images/overview/810968_364193.png" />
    </Frame>
  </Step>

  <Step title="将 CometAPI 添加为 provider">
    打开 Continue 的 **Settings** → **Models** → **+**。在 provider 列表中搜索 `cometapi` 并选择它。粘贴你的 API 密钥，并选择你要使用的模型。

    <Frame>
      <img src="https://mintcdn.com/cometapi/SZhlxZhCnMLn__BW/images/integrations/810968_362622.png?fit=max&auto=format&n=SZhlxZhCnMLn__BW&q=85&s=7d9ad8d97240036f8eabad68ac872f7e" alt="Continue 设置 — 已选择 cometapi 的 provider 搜索" width="1736" height="965" data-path="images/integrations/810968_362622.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/cometapi/SZhlxZhCnMLn__BW/images/integrations/810968_362623.png?fit=max&auto=format&n=SZhlxZhCnMLn__BW&q=85&s=53d3b5b690328196cbc0c7aeeb39ad9b" alt="Continue 中的 CometAPI provider 配置" width="1915" height="944" data-path="images/integrations/810968_362623.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/cometapi/SZhlxZhCnMLn__BW/images/integrations/810968_362624.png?fit=max&auto=format&n=SZhlxZhCnMLn__BW&q=85&s=e9fee9dd542d42a4415f0a41827124e5" alt="Continue 中使用 CometAPI provider 的模型选择" width="526" height="486" data-path="images/integrations/810968_362624.png" />
    </Frame>
  </Step>

  <Step title="测试连接">
    打开一个文件，并通过 Continue 发送测试 Prompt。成功返回响应即表示集成工作正常。

    <Frame>
      <img src="https://mintcdn.com/cometapi/SZhlxZhCnMLn__BW/images/integrations/810968_362626.png?fit=max&auto=format&n=SZhlxZhCnMLn__BW&q=85&s=765ce3c34f80b122bab7b763d970bd4f" alt="显示来自 CometAPI 成功响应的 Continue 聊天界面" width="629" height="998" data-path="images/integrations/810968_362626.png" />
    </Frame>
  </Step>
</Steps>

<Note>
  如果 provider 列表中没有显示 CometAPI，请将 Continue 切换到 **Preview** 版本，然后重新打开该扩展。

  <Frame>
    <img src="https://mintcdn.com/cometapi/SZhlxZhCnMLn__BW/images/integrations/810968_362627.png?fit=max&auto=format&n=SZhlxZhCnMLn__BW&q=85&s=54d4157b18c9134ec966daf66ec36e45" alt="显示 Preview 版本切换开关的 Continue 扩展面板" width="649" height="239" data-path="images/integrations/810968_362627.png" />
  </Frame>
</Note>

<script type="application/ld+json">
  {`
    {
    "@context": "https://schema.org",
    "@graph": [
      {
        "@type": "HowTo",
        "@id": "https://apidoc.cometapi.com/integrations/continue#howto",
        "name": "将 Continue 与 CometAPI 一起使用",
        "description": "使用本指南可通过设置 base URL、API 密钥以及模型或 provider 选项来配置 Continue 与 CometAPI 的集成。",
        "step": [
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/continue#step-1",
            "position": 1,
            "name": "在 VS Code 中安装 Continue",
            "text": "完成“将 Continue 与 CometAPI 一起使用”指南中的“在 VS Code 中安装 Continue”步骤。"
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/continue#step-2",
            "position": 2,
            "name": "获取你的 CometAPI API 密钥",
            "text": "创建或打开你的 CometAPI 账户，然后从控制台复制一个有效的 API 密钥。"
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/continue#step-3",
            "position": 3,
            "name": "将 CometAPI 添加为 provider",
            "text": "完成“将 Continue 与 CometAPI 一起使用”指南中的“将 CometAPI 添加为 provider”步骤。"
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/continue#step-4",
            "position": 4,
            "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": "将 Continue 与 CometAPI 一起使用",
            "item": "https://apidoc.cometapi.com/integrations/continue"
          }
        ]
      }
    ]
    }
    `}
</script>
