功能: - 激活码管理 (Pro/Auto 两种类型) - 账号池管理 - 设备绑定记录 - 使用日志 - 搜索/筛选功能 - 禁用/启用功能 (支持退款参考) - 全局设置 (换号间隔、额度消耗等) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
220 lines
3.8 KiB
Markdown
220 lines
3.8 KiB
Markdown
# CursorPro API 接口文档
|
|
|
|
**服务器地址**: `http://111.170.7.59:5000`
|
|
**请求超时**: 15000ms (15秒)
|
|
**Content-Type**: `application/json`
|
|
|
|
---
|
|
|
|
## 1. 认证相关
|
|
|
|
### 1.1 验证 Key
|
|
```
|
|
POST /api/verify-key
|
|
```
|
|
**请求体**:
|
|
```json
|
|
{
|
|
"key": "用户激活码"
|
|
}
|
|
```
|
|
**功能**: 验证用户激活码是否有效
|
|
|
|
---
|
|
|
|
### 1.2 切换账号
|
|
```
|
|
POST /api/switch-account
|
|
```
|
|
**请求体**:
|
|
```json
|
|
{
|
|
"key": "用户激活码"
|
|
}
|
|
```
|
|
**功能**: 切换到指定激活码对应的账号
|
|
|
|
---
|
|
|
|
## 2. 代理配置
|
|
|
|
### 2.1 获取代理配置
|
|
```
|
|
GET /api/proxy-config
|
|
```
|
|
**功能**: 获取当前代理设置
|
|
|
|
---
|
|
|
|
### 2.2 更新代理配置
|
|
```
|
|
PUT /api/proxy-config
|
|
```
|
|
**请求体**:
|
|
```json
|
|
{
|
|
"is_enabled": true,
|
|
"proxy_url": "http://proxy:port"
|
|
}
|
|
```
|
|
**功能**: 更新代理服务器配置
|
|
|
|
---
|
|
|
|
## 3. 无感换号 (Seamless Mode)
|
|
|
|
### 3.1 获取无感换号状态
|
|
```
|
|
GET /api/seamless/status
|
|
```
|
|
**功能**: 检查用户是否有权使用无感换号功能
|
|
|
|
---
|
|
|
|
### 3.2 获取用户切换状态
|
|
```
|
|
GET /api/seamless/user-status?userKey={userKey}
|
|
```
|
|
**参数**: `userKey` - URL编码的用户标识
|
|
**功能**: 获取指定用户的切换状态
|
|
|
|
---
|
|
|
|
### 3.3 获取无感换号配置
|
|
```
|
|
GET /api/seamless/config
|
|
```
|
|
**功能**: 获取无感换号功能的配置信息
|
|
|
|
---
|
|
|
|
### 3.4 更新无感换号配置
|
|
```
|
|
POST /api/seamless/config
|
|
```
|
|
**请求体**: 配置对象
|
|
**功能**: 更新无感换号配置
|
|
|
|
---
|
|
|
|
### 3.5 注入无感模式
|
|
```
|
|
POST /api/seamless/inject
|
|
```
|
|
**请求体**:
|
|
```json
|
|
{
|
|
"api_url": "API地址",
|
|
"user_key": "用户Key"
|
|
}
|
|
```
|
|
**功能**: 注入无感换号模式到 Cursor
|
|
|
|
---
|
|
|
|
### 3.6 恢复无感模式
|
|
```
|
|
POST /api/seamless/restore
|
|
```
|
|
**功能**: 恢复/还原无感换号设置
|
|
|
|
---
|
|
|
|
### 3.7 获取无感账号列表
|
|
```
|
|
GET /api/seamless/accounts
|
|
```
|
|
**功能**: 获取所有配置的无感换号账号
|
|
|
|
---
|
|
|
|
### 3.8 同步无感账号
|
|
```
|
|
POST /api/seamless/sync-accounts
|
|
```
|
|
**请求体**:
|
|
```json
|
|
{
|
|
"accounts": [账号数组]
|
|
}
|
|
```
|
|
**功能**: 同步本地账号列表到服务器
|
|
|
|
---
|
|
|
|
### 3.9 获取无感 Token
|
|
```
|
|
GET /api/seamless/get-token?userKey={userKey}
|
|
```
|
|
**参数**: `userKey` - URL编码的用户标识
|
|
**功能**: 获取指定用户的认证 Token
|
|
|
|
---
|
|
|
|
### 3.10 切换无感 Token
|
|
```
|
|
POST /api/seamless/switch-token
|
|
```
|
|
**请求体**:
|
|
```json
|
|
{
|
|
"mode": "manual",
|
|
"userKey": "用户Key"
|
|
}
|
|
```
|
|
**功能**: 手动切换到指定用户的 Token
|
|
|
|
---
|
|
|
|
## 4. 版本信息
|
|
|
|
### 4.1 获取最新版本
|
|
```
|
|
GET /api/version
|
|
```
|
|
**功能**: 获取插件最新版本信息
|
|
|
|
---
|
|
|
|
## 接口调用流程
|
|
|
|
```
|
|
1. 用户输入激活码
|
|
└─> POST /api/verify-key
|
|
└─> 验证成功后获取账号信息
|
|
|
|
2. 无感换号流程
|
|
└─> GET /api/seamless/status (检查权限)
|
|
└─> GET /api/seamless/accounts (获取账号池)
|
|
└─> POST /api/seamless/inject (注入模式)
|
|
└─> POST /api/seamless/switch-token (切换账号)
|
|
|
|
3. 本地数据写入
|
|
└─> 写入 Cursor SQLite 数据库
|
|
└─> 更新 storage.json
|
|
└─> 更新 machineid 文件
|
|
```
|
|
|
|
---
|
|
|
|
## 本地数据存储位置
|
|
|
|
| 平台 | 数据库路径 |
|
|
|------|-----------|
|
|
| Windows | `%APPDATA%\Cursor\User\globalStorage\state.vscdb` |
|
|
| macOS | `~/Library/Application Support/Cursor/User/globalStorage/state.vscdb` |
|
|
| Linux | `~/.config/Cursor/User/globalStorage/state.vscdb` |
|
|
|
|
**存储的 Key**:
|
|
- `cursorAuth/accessToken` - 访问令牌
|
|
- `cursorAuth/refreshToken` - 刷新令牌
|
|
- `cursorAuth/WorkosCursorSessionToken` - WorkOS 会话令牌
|
|
- `cursorAuth/cachedEmail` - 缓存的邮箱
|
|
- `cursorAuth/stripeMembershipType` - 会员类型
|
|
- `cursorAuth/cachedSignUpType` - 注册类型
|
|
- `storage.serviceMachineId` - 服务机器ID
|
|
- `telemetry.machineId` - 遥测机器ID
|
|
- `telemetry.macMachineId` - Mac机器ID
|
|
- `telemetry.devDeviceId` - 开发设备ID
|
|
- `telemetry.sqmId` - SQM ID
|