Documentation

cursor-api docs

Run a local Windows daemon that exposes Cursor Composer through OpenAI-compatible and Anthropic-compatible API shapes for agent clients.

Client settings

Use these values in agent clients that support a custom local API endpoint.

Base URL
http://127.0.0.1:6903/v1
API key
cursor-local
Primary model
composer-2.5
Fast model
composer-2.5-fast
Bind address
127.0.0.1
Default port
6903

Quick start

Install the release bundle, store your Cursor key, then start the local daemon.

1. Install
irm https://cursor-api-windows.mynameistito.com/install.ps1 | iex
2. Save your Cursor key
cursor-api key set
3. Start the daemon
cursor-api start
4. Verify the server
cursor-api health
5. Copy the base URL
cursor-api url

Agent clients

Any client that can set an OpenAI-compatible base URL can point at the daemon.

Use cursor-local as the local API key and choose either Composer model name.

OPENAI_BASE_URL=http://127.0.0.1:6903/v1
OPENAI_API_KEY=cursor-local
OPENAI_MODEL=composer-2.5-fast

The CLI also includes an agent configuration command for supported clients, starting with OpenCode.

cursor-api configure agent opencode

Request examples

The server accepts common agent request shapes and translates them through the same Composer path.

OpenAI-compatible

Use the same shape most OpenAI-compatible agents already emit. Set stream when your client expects server-sent events.

POST http://127.0.0.1:6903/v1/chat/completions
Authorization: Bearer cursor-local
Content-Type: application/json

{
  "model": "composer-2.5-fast",
  "messages": [
    { "role": "user", "content": "Inspect this repo and suggest a fix." }
  ],
  "stream": true
}

Anthropic-compatible

The local server also accepts the Anthropic Messages shape for Claude Code-style clients and translates it through the same Composer path.

POST http://127.0.0.1:6903/v1/messages
x-api-key: cursor-local
anthropic-version: 2023-06-01
Content-Type: application/json

{
  "model": "composer-2.5",
  "max_tokens": 1200,
  "messages": [
    { "role": "user", "content": "Plan the next edit." }
  ]
}

API surface

The daemon binds to loopback and exposes only the local /v1 surface.

GET/v1/modelsList composer-2.5 and composer-2.5-fast.
POST/v1/chat/completionsOpenAI chat completions.
POST/v1/responsesOpenAI Responses API shape.
POST/v1/messagesAnthropic Messages shape for Claude Code-style clients.
POST/v1/messages/count_tokensAnthropic token counting shape.

Model choice

Use composer-2.5 when an agent needs a more thorough planning or editing pass.

Use composer-2.5-fast when you want quicker turn-taking for iterative agent work.

Runtime lifecycle

The release bundle keeps the Bun-compiled CLI and Node bridge separate.

Install location
%LOCALAPPDATA%\Programs\cursor-api\
Runtime layout
cursor-api.exe plus a bundled bridge directory
Server process
Background daemon with PID state under AppData
Bridge process
Node runtime for local @cursor/sdk calls
Updates
Stop daemon, replace release files, preserve AppData config

Troubleshooting

Use these checks before changing client configuration or reinstalling.

401 or auth errors
Run cursor-api key status, then cursor-api key set if needed.
Client cannot connect
Run cursor-api status and confirm the client uses /v1 in the base URL.
Port conflict
Use cursor-api port set <port>, then restart the daemon.
Need logs
Run cursor-api logs -f while reproducing the client request.
Agent config drift
Re-run cursor-api configure agent opencode after changing the port.

Command reference

The CLI command surface is grouped by daemon control, configuration, and operations.

cursor-api startcursor-api stopcursor-api restartcursor-api statuscursor-api logs -f

Where data lives

User configuration lives under AppData and is preserved across release updates.

Install
%LOCALAPPDATA%\Programs\cursor-api\
Settings
%APPDATA%\cursor-api\settings.json
Encrypted key
%APPDATA%\cursor-api\api-key.enc
PID / state
%APPDATA%\cursor-api\run\
Logs
%APPDATA%\cursor-api\logs\

Credits and scope

cursor-api-cli-windows is independent and builds on prior MIT work.

standardagents/composer-api

OpenAI-compatible translation, Cursor API adapters, the local bridge, and the sidecar server design.

API for Cursor Windows port

Two-process architecture, bridge runtime constraints, agent config shapes, and local defaults.

@cursor/sdk

Official Cursor SDK used by the bundled Node bridge to drive Composer agents.

Cursor Composer models

Model names and capabilities are provided by Cursor. This project is independent.