AstroQore

Cursor2api — Development skill for Claude Code

Development community

Use your Cursor subscription as an OpenAI-compatible API.

How to install Cursor2api

This entry records only its repository, not the path inside it, so there is no exact command to give. Open AstroQore/cursor2api and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Cursor2api does

Use your Cursor subscription as an OpenAI-compatible API. Direct agent.v1 protocol — real tool_calls, streaming, multi-account. No cursor-agent CLI subprocess.

Alternatives in Development

  • Dario — A local OpenAI- and Anthropic-compatible proxy that brings your Claude Pro/Max subscription to Cursor, Cline 485 ★
  • Notebook Intelligence — A JupyterLab extension supporting Claude Code, Copilot, Ollama, and OpenAI-compatible LLMs, with MCP, skills 331 ★
  • Claude Code API — OpenAI-compatible API gateway for Claude Code CLI 300 ★

README

cursor2api

**Use your Cursor subscription as an OpenAI-compatible API.**

[![license](https://img.shields.io/badge/license-AGPL--3.0-blue.svg)](LICENSE) [![image](https://img.shields.io/badge/ghcr.io-cursor2api-blue)](https://github.com/AstroQore/cursor2api/pkgs/container/cursor2api)

[中文文档](README.zh-CN.md)

**Two other projects share this name.** Both wrap the *free* chatbot on Cursor's website — [7836246/cursor2api](https://github.com/7836246/cursor2api) and [gopkg-dev/cursor2api](https://github.com/gopkg-dev/cursor2api). This one is different: it uses **your own paid subscription** through Cursor's agent backend. See [comparison](#how-this-differs-from-the-free-chatbot-wrappers).

It talks to Cursor's own `agent.v1.AgentService` backend directly — Connect-RPC over HTTP/2 with protobuf — and exposes it as `/v1/chat/completions`. No `cursor-agent` CLI subprocess, no headless browser, no scraping.

your app ──► /v1/chat/completions ──► cursor2api ──► api2.cursor.sh
             (OpenAI shape)            (protocol bridge)     (your subscription)
Streaming (SSE) ✅
Real tool_calls with decoded arguments ✅
Multi-turn agent loops (tool results replayed) ✅
Caller controls the tool set — Cursor's native tools hidden ✅
200+ models, fetched live from your account ✅
Multi-account pool, round-robin ✅
Automatic token refresh ✅
Client-supplied system prompt ⚠️ best effort — see below

Quick start

Docker Compose (recommended)

git clone https://github.com/AstroQore/cursor2api.git
cd cursor2api
mkdir -p data

# 1. sign in — prints a URL, open it in any browser and approve
docker compose run --rm cursor2api node scripts/login.mjs --out /data/accounts.json

# 2. start
docker compose up -d

# 3. use it
curl http://127.0.0.1:8790/v1/chat/completions \
  -H 'content-type: application/json' \
  -d '{"model":"cursor-claude-sonnet-5-thinking-high","messages":[