Skip to content
Open web chat

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.
OpenAI base URL
https://cursorbridge.dev/v1
Anthropic base URL
https://cursorbridge.dev
Authentication
Authorization: Bearer <key> or x-api-key: <key>

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

Every endpoint authenticates with your Cursor API key.

MethodPathFormat
POST/v1/responsesOpenAI Responses
POST/v1/chat/completionsOpenAI Chat Completions
POST/v1/messagesAnthropic Messages
POST/v1/messages/count_tokensAnthropic token counting
GET/v1/modelsModel list with metadata
GET/v1/models/{model}One model with metadata

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.

Web chat

Open /chat and sign in with a Cursor API key to chat with your Cursor models in the browser.

  • After sign-in the browser keeps only an HttpOnly session cookie. The key is stored encrypted on the server for that session.
  • Chats are saved on this server and continue across devices for the same Cursor account.
  • Generation runs on the server. If you close the tab it keeps running and the reply is saved; reopen the chat to see it.
  • Sessions last 30 days and are extended while you use them. Sign out to end a session.
  • Developer tools: a per-chat system prompt, model and reasoning effort, raw Markdown view, per-turn token and speed stats, Markdown/JSON export, and an API tab that turns the chat into the equivalent cURL, Python, Node or Anthropic request. Press Ctrl K for the command palette and ? for shortcuts.

The server operator can review stored chats. Do not paste anything you would not share with the operator.

Grok Bots

Grok Bots are persistent Cursor agents with their own conversation and cloud computer. Manage them in the Bots workspace of the web console (same sign-in as web chat) or from scripts with your Cursor API key. Access depends on your Cursor plan, team settings and Privacy Mode.

MethodPathPurpose
GET/v1/botsList bots
POST/v1/botsCreate a bot: {"name": "…", "description": "…"}
GET/v1/bots/{id}/transcriptUp to 100 entries; page back with before_seq
POST/v1/bots/{id}/messagesSend {"text": "…", "session_id": "", "message_id": "<uuid>"}
GET/v1/bots/{id}/eventsLive transcript stream (SSE)
POST/v1/bots/{id}/interruptInterrupt the current run
GET/v1/bots/{id}/status, /sessions, /send-statusRun state, sessions, dispatch acknowledgement
DELETE/v1/bots/{id}Delete a bot with its conversation and routines
curl -N "https://cursorbridge.dev/v1/bots/<bot-id>/events?session_id=" \
  -H "Authorization: Bearer <your Cursor API key>"

The event stream carries transcript rows and state, not model tokens. Accepted messages are not finished runs: watch the transcript. Keep the generation and the largest updatedSeq from rows and reconnect with cursor={"generation":N,"afterUpdatedSeq":"…"}; reload the transcript after cursorTooOld. Reuse a message_id when retrying a send.

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.