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

# Cursor

> 在 Cursor 中使用 S2 模型进行 AI 编程

## 安装 Cursor

1. 前往 [Cursor 官网](https://cursor.com/) 下载并安装。
2. 打开 Cursor，右上角 **设置**，点击 **Sign in** 登录 Cursor 账户。

<img src="https://mintcdn.com/sa-5efeb1e4/m2WapRcvQNphFdgf/images/token-plan/ebf6631f-1d76-432c-b307-59b0b805e5cd.png?fit=max&auto=format&n=m2WapRcvQNphFdgf&q=85&s=f70184fd8307a7a75a6eb2c785418450" alt="Cursor Sign in" width="1229" height="893" data-path="images/token-plan/ebf6631f-1d76-432c-b307-59b0b805e5cd.png" />

## 配置 SenseAudio API

<Warning>
  **配置前请清除以下 OpenAI 相关环境变量**，避免冲突：

  * `OPENAI_API_KEY`
  * `OPENAI_BASE_URL`
</Warning>

<Steps>
  <Step title="进入模型设置">
    点击左侧栏 **Models**，进入模型配置页面。
  </Step>

  <Step title="配置 API Key">
    展开 **API Keys**：

    * 勾选 **Override OpenAI Base URL**
    * 下方输入 SenseAudio 调用地址：`https://api.senseaudio.cn/v1`
    * **OpenAI API Key** 输入 Token Plan API Key
    * 点击 **OpenAI API Key** 栏右侧按钮

          <img src="https://mintcdn.com/sa-5efeb1e4/m2WapRcvQNphFdgf/images/token-plan/ebf48187-f00f-48df-a479-d9c17df67f71.jpeg?fit=max&auto=format&n=m2WapRcvQNphFdgf&q=85&s=fe7f3ab6f84834a8571822a5bba76c8b" alt="API Key 配置" width="1201" height="789" data-path="images/token-plan/ebf48187-f00f-48df-a479-d9c17df67f71.jpeg" />

    在弹窗中点击 **Enable OpenAI API Key** 完成验证。

    <img src="https://mintcdn.com/sa-5efeb1e4/2ItCS6POxcu0zOQm/images/token-plan/67d40b7c-1a18-4553-a0f8-9ceb2dc610a4.png?fit=max&auto=format&n=2ItCS6POxcu0zOQm&q=85&s=8ded9225e22f517bafa8bdcc6d655b66" alt="Enable API Key" width="1280" height="518" data-path="images/token-plan/67d40b7c-1a18-4553-a0f8-9ceb2dc610a4.png" />
  </Step>

  <Step title="添加自定义模型">
    在 **Models** 面板点击 **View All Models** → **Add Custom Model**：

    <img src="https://mintcdn.com/sa-5efeb1e4/2ItCS6POxcu0zOQm/images/token-plan/0c4bebfb-2859-482e-872b-11d6d361bc63.jpeg?fit=max&auto=format&n=2ItCS6POxcu0zOQm&q=85&s=5c33c8f2320d3c7a1760f6e16ebc9442" alt="Add Custom Model" width="1150" height="1094" data-path="images/token-plan/0c4bebfb-2859-482e-872b-11d6d361bc63.jpeg" />

    输入模型名称 `senseaudio-s2`，点击 **Add**。

    <img src="https://mintcdn.com/sa-5efeb1e4/2ItCS6POxcu0zOQm/images/token-plan/d2623e83-bf5d-4bf3-9c72-b1993823e10c.png?fit=max&auto=format&n=2ItCS6POxcu0zOQm&q=85&s=a1168d49cdb448ba8a9da0a46a79f6e7" alt="输入模型名" width="1296" height="96" data-path="images/token-plan/d2623e83-bf5d-4bf3-9c72-b1993823e10c.png" />
  </Step>

  <Step title="启用并使用">
    启用刚添加的模型，在聊天面板中选择 `senseaudio-s2` 即可开始使用。

    <img src="https://mintcdn.com/sa-5efeb1e4/2uwj4t1TiXTu6X9i/images/token-plan/ffca72ea-ea19-4e7f-8ac7-3f9b647c6e65.png?fit=max&auto=format&n=2uwj4t1TiXTu6X9i&q=85&s=bebfdb352319a4c22746eeea9d88b42a" width="100%" data-path="images/token-plan/ffca72ea-ea19-4e7f-8ac7-3f9b647c6e65.png" />
  </Step>
</Steps>

<Note>
  如模型没有返回任何内容，可尝试将 Cursor 的 **Network** 设置改为 **HTTP/1.0** 解决。

  <img src="https://mintcdn.com/sa-5efeb1e4/2ItCS6POxcu0zOQm/images/token-plan/00abf9ab-12b6-4374-9cef-09074d21d23d.png?fit=max&auto=format&n=2ItCS6POxcu0zOQm&q=85&s=f65d19a4c02bf693a2572e8fc085e272" width="100%" data-path="images/token-plan/00abf9ab-12b6-4374-9cef-09074d21d23d.png" />
</Note>

## 相关资源

<CardGroup cols={2}>
  <Card title="Claude Code 接入" icon="sparkles" href="/guides/token-plan/claude-code" />

  <Card title="S2 使用技巧" icon="lightbulb" href="/guides/token-plan/best-practices" />

  <Card title="常见问题" icon="circle-question" href="/guides/token-plan/faq">
    订阅、限额、切换、开票等问题解答。
  </Card>
</CardGroup>
