Local OpenAI-compatible chat completions API backed by the official Cursor TypeScript SDK. Runs in the system tray.
- Node.js 22.13+
- A Cursor API key from Dashboard → API Keys
npm install
npm run devProduction:
npm run build
npm startBackground (hidden window on Windows):
npm run build
npm run start:bgEvery OpenAI client must send your Cursor key as a Bearer token:
Authorization: Bearer cursor_...| Endpoint | Behavior |
|---|---|
GET / or GET /v1 |
200 only if Bearer auth works and Cursor API is reachable (Cursor.me) |
GET /v1/models |
Models from Cursor.models.list() (Bearer required) |
POST /v1/chat/completions |
Chat via @cursor/sdk Agent (Bearer required) |
Status UI: http://127.0.0.1:4646/ui/
Config file: %APPDATA%\cursor-openai-proxy\config.json (host/port only).
- Base URL:
http://127.0.0.1:4646/v1 - API key: your Cursor API key (the client sends it as
Authorization: Bearer …)
curl http://127.0.0.1:4646/v1/chat/completions ^
-H "Authorization: Bearer %CURSOR_API_KEY%" ^
-H "Content-Type: application/json" ^
-d "{\"model\":\"auto\",\"messages\":[{\"role\":\"user\",\"content\":\"Say hi in one sentence.\"}]}"Live auth check:
curl -i http://127.0.0.1:4646/ ^
-H "Authorization: Bearer %CURSOR_API_KEY%"Requests are handled with @cursor/sdk:
- Auth probe →
Cursor.me({ apiKey }) - Models →
Cursor.models.list({ apiKey }) - Chat →
Agent.create+agent.send(local runtime, isolated workspace under the config dir)
- Host/port changes in config require a restart.
- Default listen address:
127.0.0.1:4646 - SDK usage follows the same Cursor billing / privacy rules as IDE and Cloud Agents.