A proxy server designed to handle Cursor's API requests by managing the conversions required to work with Cursor's weird schemas. This proxy enables you to use various LLM providers with Cursor while maintaining compatibility.
Note: When using a custom base URL with an Anthropic API key, Cursor sends API requests in Anthropic format, but expects to receive responses in
/chat/completionsformat. This mismatch is what makes the schemas "weird" and requires the conversion logic in this proxy.
This is a Cursor proxy that manages the schema conversions needed to handle Cursor's unique API requirements. The Anthropic client is the only provider that has been tested end-to-end and includes noveum_trace integration for tracing requests.
Tracing is enabled by default. To disable it, set tracing_enabled = False in the configuration.
This project was created for personal use to collect coding data for downstream evaluations on different models, helping to identify the best model for specific use cases. Feel free to use it however you want. Currently the app is meant only for local usage.
The proxy currently reads the following environment variables from a .env file:
ANTHROPIC_KEY- Your Anthropic API keyNOVEUM_API_KEY- Your Noveum API key for tracing
The conversion logic between Anthropic and Cursor schemas is detailed in CONVERSION_ALGORITHM.md. There may be some inefficiencies, but it works!
Run the automated startup script:
python start_proxy.pyThis single script will:
- Start the FastAPI server on port 8000
- Start ngrok tunnel to expose the server
- Display the ngrok public URL prominently
- Stream live logs from both services with prefixes
[FastAPI]and[ngrok] - Save logs to
logs/fastapi_YYYY-MM-DD_HH-MM-SS.txtandlogs/ngrok_YYYY-MM-DD_HH-MM-SS.txt - Handle graceful shutdown when you press Ctrl+C
The script will display output like:
═════════════════════════════════════════════════════════════════
║ 🌐 NGROK PUBLIC URL ║
║ ║
║ https://a1b2c3d4e5f6.ngrok-free.app ║
║ ║
║ Add /v1 to use in Cursor: ║
║ https://a1b2c3d4e5f6.ngrok-free.app/v1 ║
═════════════════════════════════════════════════════════════════
───────────────────── Live Logs (Ctrl+C to stop) ─────────────────
[FastAPI] INFO: Started server process [12345]
[ngrok] t=2026-01-28T14:32:18+0000 lvl=info msg="started tunnel"
...
- Copy the ngrok URL with
/v1suffix from the script output (e.g.,https://a1b2c3d4e5f6.ngrok-free.app/v1) - Paste this URL into Cursor's settings (usually under "Models" → "Base URL")
- Set any value for your Anthropic API key in Cursor (the proxy will use the key from your
.envfile)
Happy Coding!
If you prefer to run the services separately:
Step 1: Start the Proxy Server
Run the FastAPI server in one terminal:
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000Step 2: Expose with ngrok
In another terminal, expose the local server using ngrok:
ngrok http 8000You'll get output like:
Forwarding https://95111b9070f9.ngrok-free.app -> http://localhost:8000
Step 3: Configure Cursor
- Copy the forwarding URL from ngrok (e.g.,
https://95111b9070f9.ngrok-free.app) - Add
/v1suffix to create the full URL:https://95111b9070f9.ngrok-free.app/v1 - Paste this URL into Cursor's settings
- Set any value for your Anthropic API key in Cursor (the proxy will use the key from your
.envfile)
- Use API key from request headers instead of environment variables
- Add multi-threading/multi-processing support for production deployments
- Test and verify other provider schemas and API compatibility