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

# Cursor

> 了解如何在 Cursor BYOK 设置中配置 OpenAI API key 和 Base URL override，接入 siflow endpoint，让 Cursor Chat 使用算秩模型。

[Cursor](https://cursor.com) 是一款 AI IDE。通过 bring-your-own-key（BYOK）设置，您可以配置 OpenAI API key 和 Base URL override，让 Cursor chat 使用算秩模型。

需要先了解 Cursor 官方文档中的两个产品边界：

* Custom API keys 仅适用于 chat models。Tab completion 以及其他依赖 Cursor 自有模型的功能仍然使用 Cursor 内置模型。
* BYOK 请求会通过 Cursor backend 转发到配置的 endpoint，Cursor 的 Zero Data Retention policy 不适用于 BYOK 使用。

## 配置

在 [API 密钥](https://console.siflow.cn/model-inference/api_keys) 页面创建 API Key，然后打开 **Cursor Settings → Models**。

1. 在模型列表中取消勾选 pre-configured models。

   Pre-configured models 会通过 Cursor 自有通道请求，而不是使用您的 key。

2. 单击 **Add Custom Model**，添加 `DeepSeek-V4-Flash`。

   不要在这里添加 `glm-5.2`。Cursor 内置 catalog 已经包含 *GLM 5.2* entry，重复名称会被拒绝。该内置 entry 使用 Cursor 官方通道，而不是您的 key。请选择不会与 [Cursor 内置列表](https://cursor.com/docs/models) 冲突的算秩模型 ID，例如 `DeepSeek-V4-Pro` 或 `DeepSeek-V4-Flash`。

3. 滚动到 **API Keys → OpenAI API Key**，粘贴您的算秩 API Key。

4. 启用 **Override OpenAI Base URL**，并设置为：

   ```text theme={null}
   https://api.siflow.cn/model-api/v1
   ```

5. 打开 **OpenAI API Key** toggle。

<img src="https://mintcdn.com/siflow/MnqDOrFLyFtwF7sA/model-inference/media/cursor-byok-settings.png?fit=max&auto=format&n=MnqDOrFLyFtwF7sA&q=85&s=c63de448c86a1df55c6e9e86fab8a82d" alt="Cursor 中配置自定义模型、API Key 和算秩 Base URL" width="1632" height="1202" data-path="model-inference/media/cursor-byok-settings.png" />

<Info>
  Cursor 官方文档中已不再描述 Base URL override，其 UI 位置可能随版本变化。截至 2026 年 7 月底，该设置位于 **Cursor Settings → Models → API Keys**。
</Info>

## 验证

打开 Chat（`Cmd/Ctrl+L`），在模型选择器中选择您添加的模型，然后发送消息。如果正常回复，即表示连接成功。

这些模型 ID 只存在于算秩，因此收到回复即可证明 override 生效。您也可以在算秩控制台的用量页面查看调用记录。

## 常见问题

* **选择 built-in model 时没有回复**：如果只配置了 BYOK key，built-in entries（例如 catalog 中的 GLM 5.2）不会通过 Base URL override 请求。请使用通过 **Add Custom Model** 添加的模型。
* **Tab completion 无法使用算秩模型**：这是 custom keys 的产品限制，是预期行为，不是配置错误。
