DISCOVER THE FUTURE OF AI AGENTS

cursor2api

Added Apr 25, 2026
Agent & Tooling
Open Source
TypeScriptNode.jsLarge Language ModelsSDKCLIAgent & ToolingModel & Inference FrameworkDeveloper Tools & CodingProtocol, API & IntegrationSecurity & Privacy

An unofficial reverse-proxy tool that converts Cursor's free doc-page AI chat endpoint into Anthropic Messages API and OpenAI Chat Completions API, featuring identity protection, refusal interception, cognitive reconstruction, context compression, and anti-truncation mechanisms for Claude Code, Cursor IDE, and various third-party clients.

cursor2api is a Node.js-based API proxy and protocol conversion service that transforms Cursor's free doc-page AI chat endpoint into standard Anthropic and OpenAI API formats, enabling direct integration with Claude Code, Cursor IDE, ChatBox, LobeChat, and other compatible clients.

On the protocol compatibility layer, the project fully implements the Anthropic Messages API (/v1/messages, streaming/non-streaming), OpenAI Chat Completions API (/v1/chat/completions), and Cursor IDE Agent mode endpoint (/v1/responses with flat tool format and incremental streaming tool calls), along with Thinking output support for both Anthropic thinking blocks and OpenAI reasoning_content.

In adversarial engineering, cursor2api implements a three-layer identity protection mechanism (identity probe interception, refusal retry, response cleansing), 50+ regex-pattern refusal text interception with automatic retry, and a "cognitive reconstruction" strategy — instead of directly confronting the model's doc-assistant identity constraint, it induces the model to output tool-call JSON under the guise of writing API documentation examples. For anti-truncation, v2.7.8 introduced context pressure inflation (inflating input_tokens to trigger client-side auto-compression), adaptive history budgets, and differentiated smart truncation by tool type.

Context management capabilities include progressive history compression (3 configurable levels), Schema compression (tool definitions from ~135k chars to ~15k chars), a five-layer fault-tolerant JSON-aware parser, and seamless truncation resumption. Additional engineering features cover zero-config local CPU OCR Vision support via tesseract.js, automatic tool parameter fixing, Chrome TLS fingerprint simulation, dual-mode authentication (Bearer token / x-api-key), a full-chain log Web UI (Vue frontend with optional SQLite persistence), and a Playwright Chromium stealth proxy module.

Deployment supports local execution (npm), production builds, and Docker containerization, with all configuration manageable via config.yaml or environment variables. The project explicitly states it is not affiliated with Cursor or Anysphere and is intended solely for learning, research, and interface debugging. Note that the README indicates Cursor's doc-page available models have been significantly reduced ("as of 20260401 only gemini-3-flash remains"), severely limiting practical usability, and usage may result in account bans.

Related Projects

View All

STAY UPDATED

Get the latest AI tools and trends delivered straight to your inbox. No spam, just intelligence.