JIMMYGGG commited on
Commit
87ecfb4
·
verified ·
1 Parent(s): 4f9d50f

Create readme.md

Browse files
Files changed (1) hide show
  1. readme.md +66 -0
readme.md ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # cursor-api
2
+
3
+ 将 Cursor 编辑器转换为 OpenAI 兼容的 API 接口服务。
4
+
5
+ ## 项目简介
6
+
7
+ 本项目提供了一个代理服务,可以将 Cursor 编辑器的 AI 能力转换为与 OpenAI API 兼容的接口,让您能够在其他应用中复用 Cursor 的 AI 能力。
8
+
9
+ ## 使用前准备
10
+
11
+ 1. 访问 [www.cursor.com](https://www.cursor.com) 并完成注册登录(赠送 500 次快速响应,可通过删除账号再注册重置)
12
+ 2. 在浏览器中打开开发者工具(F12)
13
+ 3. 找到 应用-Cookies 中名为 `WorkosCursorSessionToken` 的值并保存(相当于 openai 的密钥)
14
+
15
+ ## 接口说明
16
+
17
+ ### 基础配置
18
+
19
+ - 接口地址:`http://localhost:3000/v1/chat/completions`
20
+ - 请求方法:POST
21
+ - 认证方式:Bearer Token(使用 WorkosCursorSessionToken 的值,支持英文逗号分隔的 key 入参)
22
+
23
+ ### 请求格式和响应格式参考 openai
24
+
25
+ ## 生产环境部署
26
+
27
+ ### 方式一:docker-compose 部署(推荐)
28
+
29
+ ```bash
30
+ docker compose up -d
31
+ ```
32
+
33
+ ### 方式二:docker 部署
34
+
35
+ ```bash
36
+ docker run -d --name cursor-api -p 3000:3000 waitkafuka/cursor-api:latest
37
+ ```
38
+
39
+ ### 方式三:pm2 部署
40
+
41
+ ```bash
42
+ cd cursor-api
43
+ npm install
44
+ pm2 start ecosystem.config.js
45
+ ```
46
+
47
+ ## 本地开发
48
+
49
+ ```bash
50
+ cd cursor-api
51
+ npm install
52
+ npm run dev
53
+ ```
54
+
55
+ ## 注意事项
56
+
57
+ - 请妥善保管您的 WorkosCursorSessionToken,不要泄露给他人
58
+ - 本项目仅供学习研究使用,请遵守 Cursor 的使用条款
59
+
60
+ ## 原始项目
61
+
62
+ - 本项目基于 [cursorToApi](https://github.com/luolazyandlazy/cursorToApi) 项目进行优化,感谢原作者的贡献
63
+
64
+ ## 许可证
65
+
66
+ MIT License