Documentation

cursor-api docs

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

The daemon binds to loopback, keeps your Cursor key encrypted under AppData, and translates common agent client requests through the bundled Cursor SDK bridge.

Quick reference

Available
Base URL
http://127.0.0.1:6903/v1
API key
cursor-local
Primary model
composer-2.5
Fast model
composer-2.5-fast

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 setup

Each setup below includes the fields to save, the order to configure them, and the checks to run when a client hides connection errors.

These values are for agent configuration, not for a one-off prompt. Use cursor-local as the API key and choose either Composer model in the client settings.

OpenCode

Use the bundled configurator. It writes the local OpenAI-compatible provider into OpenCode so future sessions can select the Composer model directly.

Available

Required settings

ProviderOpenAI-compatible local provider
Base URLhttp://127.0.0.1:6903/v1
API keycursor-local
Modelscomposer-2.5, composer-2.5-fast

Setup steps

  1. 1
    Start the daemon
    cursor-api start
  2. 2
    Write OpenCode config
    cursor-api configure agent opencode
  3. 3
    Check the endpoint
    cursor-api health
  4. 4
    Use the model

    Select composer-2.5-fast for quick edits or composer-2.5 for deeper runs.

Codex

Configure Codex as a custom OpenAI-compatible provider when your Codex client exposes provider, base URL, API key, and model fields.

Available

Required settings

Provider typeOpenAI compatible
Base URLhttp://127.0.0.1:6903/v1
API keycursor-local
Default modelcomposer-2.5-fast

Setup steps

  1. 1
    Open provider settings

    Create or edit a custom OpenAI-compatible provider.

  2. 2
    Set the base URL
    http://127.0.0.1:6903/v1
  3. 3
    Set the key

    cursor-local

  4. 4
    Set the model

    composer-2.5-fast

  5. 5
    Validate

    Send a short prompt after cursor-api health returns healthy.

Pi

Point Pi at the localhost OpenAI-compatible endpoint and keep the fast Composer model as the default for interactive coding sessions.

Available

Required settings

ProviderCustom OpenAI-compatible
Base URLhttp://127.0.0.1:6903/v1
API keycursor-local
Modelcomposer-2.5-fast

Setup steps

  1. 1
    Open model settings

    Choose the custom provider or OpenAI-compatible option.

  2. 2
    Paste endpoint
    http://127.0.0.1:6903/v1
  3. 3
    Paste key

    cursor-local

  4. 4
    Choose model

    composer-2.5-fast

  5. 5
    Troubleshoot

    Run cursor-api logs -f while sending a Pi request.

Kilo Code

Create a Kilo Code provider profile that routes OpenAI-compatible chat requests through the local daemon.

Available

Required settings

ProviderOpenAI compatible
Base URLhttp://127.0.0.1:6903/v1
API keycursor-local
Fast modelcomposer-2.5-fast
Full modelcomposer-2.5

Setup steps

  1. 1
    Create provider

    Add a custom OpenAI-compatible provider in Kilo Code.

  2. 2
    Configure endpoint
    http://127.0.0.1:6903/v1
  3. 3
    Configure key

    cursor-local

  4. 4
    Add models

    composer-2.5-fast and composer-2.5

  5. 5
    Confirm

    Run cursor-api status before starting an agent task.

Aider

Save Aider defaults so each run uses the local daemon without repeating base URL and model flags.

Available

Required settings

OpenAI base URLhttp://127.0.0.1:6903/v1
OpenAI API keycursor-local
Default modelcomposer-2.5-fast
Alternative modelcomposer-2.5

Setup steps

  1. 1
    Start daemon
    cursor-api start
  2. 2
    Set base URL
    http://127.0.0.1:6903/v1
  3. 3
    Set API key

    cursor-local

  4. 4
    Set default model

    composer-2.5-fast

  5. 5
    Verify

    Ask Aider for a small repository summary.

VS Code

Use these values in any VS Code extension that lets you define a custom OpenAI-compatible endpoint.

Available

Required settings

Provider typeOpenAI compatible
Base URLhttp://127.0.0.1:6903/v1
API keycursor-local
Modelcomposer-2.5-fast

Setup steps

  1. 1
    Open extension settings

    Find provider, model, or API settings.

  2. 2
    Choose custom provider

    Select OpenAI-compatible if available.

  3. 3
    Save endpoint
    http://127.0.0.1:6903/v1
  4. 4
    Save key

    cursor-local

  5. 5
    Test request

    Use the extension while cursor-api logs -f is running.

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-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.