---
url: https://limapi.com/docs/agents/cursor.md
---
# Cursor

Cursor 是 AI 原生代码编辑器。通过自定义 OpenAI 兼容端点接入 LimAPI。

## 安装

* **macOS**：`brew install --cask cursor` 或从 [官网](https://cursor.com) 下载
* **Windows**：`winget install -e --id Cursor.Cursor` 或从官网下载

## 配置接入凭证

在 Cursor 中，点击设置图标，进入 **Cursor Settings → Models**，开启 **OpenAI API Key** 和 **Override OpenAI Base URL**，填入以下配置：

| 配置项 | 填写内容 |
| --- | --- |
| API Key | [Portal](https://limapi.com/) 创建的 LimAPI API Key（`sk-` 开头） |
| Base URL | `https://limapi.com/api/v1` |
| 可用模型 | 点击 Verify 校验连通性，或在模型列表中手动添加模型 ID（如 `qwen3.8-max`），完整列表通过 `GET /api/v1/models` 查询或在 Portal 模型广场查看 |

## 验证配置

在聊天面板关闭 Auto 模式，在模型下拉栏选择刚添加的模型，发送一条消息，正常回复即配置成功。

## 常见问题

### 在 Cursor 中无法调用已添加的模型

报错信息如下：

* The model xxx does not work with your current plan or api key.
* Named models unavailable Free plans can only use Auto. Switch to Auto or upgrade plans to continue.

原因：Cursor 免费版仅支持 Auto 模式，不支持调用自定义模型。

解决方案：请升级至 Cursor Pro 及以上套餐。

### 配置完成后找不到添加的模型

请在聊天面板点击并关闭 Auto 模式，在模型下拉栏选择所需模型。

### 调用模型报错 "We're having trouble connecting to the model provider." 或 "Unauthorized User API key"

请逐项排查：

* 检查 API Key、Base URL 和模型名称是否填写正确，Base URL 为 `https://limapi.com/api/v1`，末尾 `/v1` 不可省略；
* 确认 API Key 复制完整、无首尾空格，且在 Portal 状态正常。
