cursor2api-go  by libaxuan

OpenAI-compatible API for Cursor Web

Created 5 months ago
778 stars

Top 45.0% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a service to expose Anthropic Claude models (specifically claude-sonnet-4.6) via an OpenAI-compatible API, enabling integration with existing tools and applications. It targets developers seeking a high-performance, low-latency local API endpoint for advanced AI models, abstracting away the complexities of direct Cursor Web interaction.

How It Works

The service is implemented in Go, prioritizing performance and low latency. It acts as a proxy, automatically handling authentication with Cursor Web and translating requests and responses to and from the OpenAI API format. Key architectural choices include robust error handling, built-in health checks, and support for both streaming and non-streaming API responses, offering a seamless developer experience.

Quick Start & Requirements

  • Primary Install/Run:
    • Local (Linux/macOS): git clone ... && cd ... && chmod +x start.sh && ./start.sh
    • Local (Windows): Execute start-go.bat or ./start-go-utf8.bat
    • Docker: docker run -d --name cursor2api-go --restart unless-stopped -p 8002:8002 -e API_KEY=your-secret-key cursor2api-go
    • Docker Compose: docker-compose up -d
  • Prerequisites: Go 1.24+, Node.js 18+ (for JavaScript execution).
  • Links: API usage examples provided via curl commands.

Highlighted Details

  • Fully compatible with OpenAI API format.
  • Supports streaming and non-streaming responses.
  • High-performance Go language implementation.
  • Automatic handling of Cursor Web authentication.
  • Supports Anthropic Claude: claude-sonnet-4.6.
  • Integrates with third-party applications supporting custom OpenAI APIs (e.g., ChatGPT Next Web, Lobe Chat).

Maintenance & Community

Contribution guidelines follow standard practices (Fork, branch, commit, PR) and adhere to Go Code Review Comments, gofmt, go vet, and Conventional Commits. No specific community channels (Discord/Slack) or roadmap links are provided in the README.

Licensing & Compatibility

The project is licensed under the MIT License. However, a significant disclaimer states: "本项目仅供学习和研究使用,请勿用于商业用途。" (This project is for learning and research purposes only, please do not use for commercial purposes.), which imposes a non-commercial restriction despite the permissive MIT license.

Limitations & Caveats

The primary caveat is the explicit restriction against commercial use, which contradicts the typical implications of an MIT license and requires careful legal review for any adoption. The service's functionality is dependent on the availability and authentication mechanisms of Cursor Web.

Health Check
Last Commit

21 hours ago

Responsiveness

Inactive

Pull Requests (30d)
3
Issues (30d)
11
Star History
747 stars in the last 30 days

Explore Similar Projects

Starred by Tobi Lutke Tobi Lutke(Cofounder of Shopify), Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), and
27 more.

open-webui by open-webui

0.8%
127k
Self-hosted AI platform for local LLM deployment
Created 2 years ago
Updated 1 day ago
Feedback? Help us improve.