# Cursor 配置指南

![Windows](https://img.shields.io/badge/Windows-%E6%94%AF%E6%8C%81-blue?logo=windows\&logoColor=white) ![MacOS](https://img.shields.io/badge/MacOS-%E6%94%AF%E6%8C%81-black?logo=apple\&logoColor=white)

## 一、下载安装Cursor

1. 进入[Cursor官网](https://www.cursor.com/)，点击`Download for Free`下载
2. 下载完成后直接安装

## 二、配置

1. 点击顶栏设置按钮
2. 点击侧栏`Models`
3. 找到`OpenAI API Key`
4. 填入你的API Key
5. 点击API Key输入框下方的`Override OpenAI Base URL`
6. 输入以下任一API站地址并点击`Save`:

```
https://one.ooo.cool/v1
```

或

```
https://one.ocoolai.com/v1
```

7. 点击API Key输入框右侧的`Verify`验证连通性，没问题即配置完成
8. 如果弹出提示点击`Dismiss`即可

![Cursor配置示意图](https://vip.123pan.cn/1821083851/ocoolai/pic/cursor-2.png)

完整配置图示:

![Cursor完整配置](https://vip.123pan.cn/1821083851/ocoolai/pic/cursor1.png)

## 三、模型添加

> **注意**: cursor请求匹配规则是模型名中带"claude-"的会走Anthropic的路线，带"gemini-"等谷歌系的会走Google路线，其他的和带"gpt-"的会走OpenAI路线

### GPT系列

* 直接填写名称即可

### Claude系列

使用自定义API暂时需要将模型名称映射成符合OpenAI路线匹配规则的样子。映射后的模型名在请求到API站点后会自动重定向到正经模型上。

映射规则如下:

* claude-3-5-sonnet-20240620 映射为:

```
gpt-4-claude3.5-sonnet
```

* claude-3-opus-20240229 映射为:

```
gpt-4-claude3-opus
```

* claude-3-sonnet-20240229 映射为:

```
gpt-4-claude3-sonnet
```

* claude-3-haiku-20240307 映射为:

```
gpt-4-claude3-haiku
```

### Gemini系列

* gemini-1.5-pro-latest 映射为:

```
gpt-4-gemini1.5-pro-latest
```

### 其他模型

* 直接填模型名即可

## 视频教程

[查看Bilibili视频教程](https://www.bilibili.com/video/BV1A3HnekE4x)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.ocoolai.com/app_guides/app/cursor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
