Setup and API reference

Build with Cursor,
wherever you work.

Point OpenAI- or Anthropic-compatible tools at Cursor Bridge and authenticate with an API key from your Cursor dashboard.

Quickstart

  1. Create a key in Cursor Dashboard > API Keys.
  2. Choose a client below.
  3. Set its base URL to https://cursorbridge.dev and use your Cursor key for authentication.

Cursor Bridge is unofficial community software. Use your own account and respect its plan limits.

Claude Code

Set the Anthropic base URL and authentication token for one command:

ANTHROPIC_BASE_URL=https://cursorbridge.dev \
ANTHROPIC_AUTH_TOKEN=<your Cursor API key> \
claude

Use ANTHROPIC_MODEL when you want a specific model; omit it to use Cursor's default selection.

opencode

Add an OpenAI-compatible provider to opencode.json:

{
  "provider": {
    "cursor-bridge": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Cursor Bridge",
      "options": {
        "baseURL": "https://cursorbridge.dev/v1",
        "apiKey": "<your Cursor API key>"
      },
      "models": { "default": { "name": "Cursor Default" } }
    }
  }
}

Codex CLI

OPENAI_BASE_URL=https://cursorbridge.dev/v1 \
OPENAI_API_KEY=<your Cursor API key> \
codex

The same OpenAI-compatible settings work with Cline and Kilo Code.

SDK configuration

OpenAI

client = OpenAI(
    base_url="https://cursorbridge.dev/v1",
    api_key="<your Cursor API key>",
)

Anthropic

client = Anthropic(
    base_url="https://cursorbridge.dev",
    api_key="<your Cursor API key>",
)

Endpoints

POST/v1/responses
POST/v1/chat/completions
POST/v1/messages
POST/v1/messages/count_tokens
GET/v1/models
GET/v1/models/{model}

Model metadata

Authenticated model responses include context_window, max_output_tokens, reasoning, and model-specific reasoning_options. Effort values are derived from Cursor's usable model variants for the authenticated account; unsupported values are rejected rather than silently substituted.

curl -H "Authorization: Bearer <your Cursor API key>" \
  https://cursorbridge.dev/v1/models/claude-fable-5

For Cursor-owned virtual models, release_date is the first date the model ID was observed in Cursor Bridge's live catalog. Limits are the values enforced and advertised by Cursor Bridge, not a promise that every Cursor plan exposes every model.

Compatibility

  • Streaming and non-streaming responses
  • Client tool calls and tool-result continuation
  • Text and image inputs
  • Reasoning and cache-aware token usage
  • Structured JSON output and output limits
  • OpenAI Responses, Chat Completions, and Anthropic Messages formats

Troubleshooting

Authentication errors

Confirm that the client sends your Cursor API key as a bearer token or supported API-key header.

Model unavailable

Use default to let Cursor select an eligible model, or query /v1/models with your key.

Tool continuation

Return tool results with the exact call identifier supplied by the assistant response.