> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/welcome/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/welcome/cn/ai-gateway/ai-gateway-integration/continue.md).

# Continue

Continue 是一款开发工具（VS Code 扩展和 CLI），使用 AI 模型来辅助完成诸如自动补全、代码解释、重构等编程任务。\
为了发起 AI 请求，Continue 需要配置一个 **模型提供方（model provider）**，该提供方可以指向你的 AI 网关。

你可以查看 [**帮助文档**](https://docs.continue.dev/) 了解更多详情。

## API Endpoint 管理

1. 在 VS Code 中安装 **Continue** 扩展（如尚未安装）。
2. 打开 Continue 的设置界面：
   * 按 **Ctrl/Cmd + P** 打开命令面板。
   * 输入：`Continue: Open Settings`。
   * 或打开扩展侧边栏，点击 Continue 的 **齿轮 / 设置图标**。
3. 打开（或创建）Continue 的配置文件：

   ```bash
   vim ~/.continue/config.json
   ```

   如果该文件不存在，请手动创建。
4. 粘贴以下示例配置，并将其中的 `apiKey` 替换为你自己的值：

   ```json
   {
     "models": [
       {
         "title": "AI Gateway Chat Model",
         "provider": "openai",
         "model": "gpt-4o",
         "apiKey": "sk-xxxxxxxxxxxxxx",
         "apiBase": "https://gateway.theturbo.ai"
       }
     ],
     "tabAutocompleteModel": {
       "title": "AI Gateway Autocomplete",
       "provider": "openai",
       "model": "gpt-4o-mini",
       "apiKey": "sk-xxxxxxxxxxxxxx",
       "apiBase": "https://gateway.theturbo.ai"
       }
   }
   ```

Continue 会根据**不同用途使用不同模型**：

* **`models`**\
  用于 **聊天和通用 AI 交互**，例如：
  * 提问
  * 代码解释
  * 代码重构
  * 生成代码片段
* **`tabAutocompleteModel`**\
  专用于 **代码自动补全**，例如：
  * 输入过程中显示的补全建议
  * 按下 `Tab` 键完成代码补全

你可以根据实际需求，为两者使用**相同的模型**，也可以配置为**不同的模型**。
