| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
OpenAI-compatible proxy for CommandCode — use 50+ AI models in Cursor, VS Code, Windsurf, and any OpenAI-compatible client.
This project is created for educational, research, and learning purposes only. It demonstrates:
CommandCode's founder has publicly stated that reverse-engineering their subscription/API system violates their Terms of Service. Users of similar proxy projects have faced:
CommandCode offers official, legitimate alternatives that we recommend for any production or heavy use:
This proxy is for learning and experimentation only. If you need CommandCode in a real workflow, use the official Provider API or Headless Mode instead.
Users are responsible for their own usage. This proxy does not:
What could happen if you use it:
Good practices if you still choose to experiment:
Are you trying to figure out how to use Claude in Cursor IDE without hitting steep API costs? Or maybe you want to use DeepSeek in Cursor to write complex Python scripts? This project provides a reliable commandcode cursor proxy that transforms the CommandCode backend into a fully compliant OpenAI API proxy golang implementation.
By serving as an AI coding assistant proxy, it bridges the gap between your favorite text editors and the CommandCode backend. The primary issue many developers face is that CommandCode's API only officially supports its own CLI. However, most developers live in IDEs like Cursor, VS Code, or use specialized tools like Aider and Windsurf.
This proxy solves multiple problems simultaneously:
If you are looking for the ultimate Cursor AI proxy, this tool offers unmatched reliability, performance, and flexibility.
This proxy implements the standard OpenAI chat completions endpoint, meaning it works flawlessly with almost any modern AI coding tool.
This proxy doesn't just forward requests; it aggressively optimizes them for IDE usage.
| Feature | Detailed Description |
|---|---|
| 50+ Models | Seamlessly use Claude in Cursor IDE, along with GPT-4, DeepSeek, Gemini, Kimi, Qwen, MiniMax, Grok, GLM, MiMo, and dozens of others. |
| Multiple Auth Methods | 4 priority-based authentication methods — Header, Env Var, Auto-detect CLI token, or CLI flag. |
| Images & Vision Supported | Base64 data URLs and image URLs are natively forwarded to models that support vision capabilities. |
| No Timeouts | Implements an SSE streaming proxy with keep-alive pings every 15s. This provides a permanent Cursor reconnecting fix. |
| Large Payload Handling | Built with 120s read timeouts to effortlessly handle 30MB+ contexts, images, and massive codebases over slow networks. |
| Auto-Compaction | Our token compaction proxy compresses older tool responses in the background, keeping huge sessions under the 262k limit without crashing your IDE. |
| Rate Limited Protection | Acts as an API rate limiting proxy implementing a token bucket algorithm (4 concurrent, 30 req/min) to keep your usage looking like normal human behavior. |
| Workspace Ingestion | Ingests real Git branch/status & AGENTS.md context natively to match official CLI behavior. |
| Auto Retry Engine | Exponential backoff on 429 errors (5s → 25s → 45s) ensures generation doesn't fail on transient server issues. |
| CORS Enabled | Works flawlessly with browser extensions, web apps, and desktop applications. |
| Self-updating | Checks for new CommandCode CLI versions automatically and mimics the latest headers. |
| Monitoring & Metrics | /metrics endpoint available for Prometheus scraping or local monitoring. |
| Embedded UI | Comes with a beautifully designed local web dashboard for configuration and testing. |
# Option A: Login via CLI (recommended — zero config)
npm i -g command-code
cmd auth login
# Option B: Set environment variable
export COMMAND_CODE_API_KEY=user_your_key_here
# Option C: API key flag
./bin/commandcode-cursor-proxy.exe -api-key user_your_key_hereThe proxy auto-detects your CLI login — no extra config needed.
# Option A: Run from source
go run main.go
# Option B: Use prebuilt binary
./bin/commandcode-cursor-proxy.exeDefault: http://127.0.0.1:55990
When you run the EXE, your browser auto-opens the dashboard at http://127.0.0.1:55990/ui. From there you can configure everything without touching the command line:
The dashboard lets you:
Cursor Settings → Models → Enable "Override OpenAI Base URL"
Base URL: http://127.0.0.1:55990/v1 ← for local use
OR
https://your-tunnel.trycloudflare.com/v1 ← if using tunnel
API Key: your-commandcode-api-key
Add models: deepseek-v4-flash, claude-sonnet-5, gpt-5.5, etc.
Cursor requires public HTTPS. Create a tunnel (the cloudflare tunnel cursor setup):
# Terminal 1: Start proxy
./bin/commandcode-cursor-proxy.exe
# Terminal 2: Start Cloudflare tunnel
cloudflared tunnel --url http://127.0.0.1:55990
# Copy the URL shown (e.g., https://something.trycloudflare.com)
# Paste in Cursor: https://something.trycloudflare.com/v1💻 VS Code (Cline / Roo Code / Continue)Note: Free Cloudflare tunnel URLs change on restart. For a permanent URL, create a free Cloudflare account and use a named tunnel.
Acting as a VS Code AI proxy is very straightforward. Just configure the extension:
API Provider: OpenAI Compatible Base URL: http://127.0.0.1:55990/v1 API Key: your-commandcode-api-key Model: deepseek-v4-flash
export ANTHROPIC_BASE_URL=http://127.0.0.1:55990/v1
export ANTHROPIC_API_KEY=your-commandcode-api-key
claudecurl http://127.0.0.1:55990/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-key" \
-d '{
"model": "deepseek-v4-flash",
"messages": [{"role": "user", "content": "Hello!"}],
"stream": true
}'To use this as an aider proxy server:
aider --openai-api-base http://127.0.0.1:55990/v1 \
--openai-api-key your-key \
--model deepseek-v4-flashTo set up your windsurf ai proxy, add a custom provider in AI Settings with Base URL http://127.0.0.1:55990/v1.
This multi model ai proxy gives you access to a massive list of models. Add these model names in your client to take advantage of Cursor IDE custom models:
Use Claude in Cursor IDE effortlessly. claude-sonnet-5 claude-opus-5 claude-haiku-4-5 claude-fable-5 claude-sonnet-4-6 claude-opus-4-8 claude-opus-4-7
Use GPT in Cursor for highly reliable coding tasks. gpt-5.6-terra gpt-5.6-sol gpt-5.6-luna gpt-5.5 gpt-5.4 gpt-5.4-mini gpt-5.3-codex
Use DeepSeek in Cursor for amazing reasoning capabilities. deepseek-v4-pro deepseek-v4-flash ⚡ (flash = fastest)
Use Gemini in Cursor for large context windows. gemini-3.6-flash gemini-3.5-flash gemini-3.5-flash-lite gemini-flash-lite
kimi-k3 kimi-k2.7-code kimi-k2.7-code-highspeed kimi-k2.6 kimi-k2.5
qwen-3.8-max qwen-3.7-max qwen-3.7-plus qwen-3.7-flash qwen-3.6-max qwen-3.6-plus
minimax-m3 minimax-m2.7 minimax-m2.5
glm-5.2 glm-5.2-fast glm-5.1 glm-5
step-3.7-flash step-3.5-flash
mimo-v2.5-pro mimo-v2.5
muse-spark-1.2 muse-spark-1.1 muse-spark-1.2-contributor (Meta)
laguna-s-2.1-free (Poolside — 118B open-weight)
grok-4.5 (xAI)
nemotron-3-ultra (NVIDIA — 550B)
fugu-ultra (Sakana AI)
hy3-paid (Tencent)
inkling inkling-small (Thinking Machines)
When building an OpenAI api proxy golang implementation for heavy IDE usage, performance and stability are everything. This proxy is built to be a rock-solid background daemon.
One of the most common issues with custom model endpoints is connection dropping. This proxy includes a built-in Cursor reconnecting fix and Cursor timeout fix. The SSE streaming proxy layer injects standard SSE keep-alive ping comments (: keep-alive) every 15 seconds. If the upstream provider is thinking for 45 seconds on a complex DeepSeek query, your IDE won't sever the connection thinking it died.
If you paste a 10,000 line log file into Cursor, you might hit the model's token limit. The built-in token compaction proxy automatically detects when your context size is approaching the 262k limit and selectively truncates intermediate tool responses and system prompt bloat without corrupting the OpenAI message array structure.
CommandCode limits how fast you can make requests. To prevent 429 Too Many Requests errors from bubbling up to your IDE and ruining your flow, this proxy acts as an API rate limiting proxy. It implements a token bucket algorithm allowing 4 concurrent requests and 30 requests per minute. If you exceed this, the proxy will hold the request in queue rather than failing immediately.
If a 429 error does occur upstream, the proxy catches it and applies exponential backoff (5s → 25s → 45s), automatically retrying the request. The IDE just sees a slightly slower response, not an outright failure.
This CommandCode cursor proxy is designed with privacy and security in mind.
commandcode-cursor-proxy.exe [flags]| Flag | Default | Description |
|---|---|---|
| -host | 127.0.0.1 | Host to bind to (0.0.0.0 for LAN) |
| -port | 55990 | Server port |
| -api-key | (auto) | Manual API key (auto-detected if not set) |
| -version | — | Print version and exit |
You can configure the proxy using a .env file in the same directory as the executable, or by setting system environment variables. (See .env.example).
| Variable | Purpose |
|---|---|
| COMMAND_CODE_API_KEY | Your CommandCode API key |
| COMMANDCODE_PROXY_DEBUG | Set to 1 for verbose logging |
| COMMANDCODE_SKIP_UPDATES | Skip auto-update check |
| PORT | Set a custom port (default: 55990) |
| HOST | Set a custom host (default: 127.0.0.1) |
Cursor routes requests through its cloud servers, so 127.0.0.1 won't work natively in the Cursor settings menu. You need a public HTTPS tunnel. This is the recommended cloudflare tunnel cursor configuration.
# Terminal 1
./bin/commandcode-cursor-proxy.exe
# Terminal 2
cloudflared tunnel --url http://127.0.0.1:55990
# Copy the URL: https://something.trycloudflare.com
# Cursor Base URL: https://something.trycloudflare.com/v1⚠️ URL changes every restart. Okay for testing.
# One-time setup
cloudflared tunnel login
cloudflared tunnel create cursor-proxy
# Create config.yml
# tunnel: <tunnel-id>
# credentials-file: /path/to/<tunnel-id>.json
# ingress:
# - hostname: proxy.yourdomain.com
# service: http://127.0.0.1:55990
# - service: http_status:404
cloudflared tunnel route dns cursor-proxy proxy.yourdomain.com
cloudflared tunnel run cursor-proxyCreate start.bat (Windows):
@echo off
start "Proxy" cmd /k "bin\commandcode-cursor-proxy.exe"
timeout /t 3 /nobreak >nul
start "Tunnel" cmd /k "cloudflared tunnel --url http://127.0.0.1:55990"
pause1. Is this a CommandCode alternative for Cursor? This proxy doesn't replace CommandCode, it bridges it. It acts as an AI coding assistant proxy that allows you to use your existing CommandCode subscription inside Cursor IDE rather than being restricted to the command line.
2. How do I use Claude in Cursor IDE with this? Simply set your Cursor OpenAI Base URL to your proxy address, put in your API key, and type claude-sonnet-5 into the model list in Cursor.
3. Does this give me free AI models for Cursor? No. You still need a valid, paid CommandCode subscription (like the Go Plan). This proxy simply translates the API requests so you can utilize the models you pay for inside Cursor instead of just the CLI.
4. How does the token compaction proxy work? When the payload size exceeds predefined thresholds, the proxy scans the JSON payload, identifies long tool responses (which are often bulky outputs like search results or file reads), and truncates them with a marker [...truncated...] before sending them upstream.
5. What is the Cursor reconnecting fix? Cursor occasionally drops connections if a generation takes too long. Our SSE streaming proxy sends empty ping events to Cursor every 15 seconds, convincing Cursor that the server is still alive, providing a robust Cursor timeout fix.
6. Can I use this as a VS Code AI proxy? Absolutely. If you install an extension like Cline or Continue.dev in VS Code, you can point it to http://127.0.0.1:55990/v1 and use it perfectly.
7. Does it work with Windsurf? Yes. You can use it as a Windsurf AI proxy by adding a custom provider in Windsurf's settings and pointing it to the proxy URL.
8. Can I use DeepSeek in Cursor with this? Yes. DeepSeek is natively supported. Just add deepseek-v4-flash or deepseek-v4-pro to your Cursor models list.
9. Can I use Gemini in Cursor with this? Yes. Models like gemini-3.6-flash are fully supported.
10. Does this support image inputs (Vision)? Yes. The proxy correctly parses Base64 image data URLs and standard URLs embedded in the OpenAI JSON payload and forwards them to CommandCode in the appropriate format.
11. Why do I need Cloudflared for Cursor? Cursor's backend servers process API requests on their end, not locally on your machine. Therefore, putting 127.0.0.1 as the Cursor OpenAI Base URL won't work because Cursor's cloud servers can't see your localhost. The cloudflare tunnel cursor setup bridges your local proxy to the internet securely.
12. Is the API rate limiting proxy strict? It strictly adheres to 4 concurrent requests and 30 requests per minute to mimic human CLI usage and protect your account from being flagged for spam.
13. What language is this written in? This is an OpenAI api proxy golang implementation. Go provides incredible concurrency primitives, low memory footprint, and fast execution, perfect for a background daemon.
14. My tunnel URL changes every time. How do I fix this? Use a Named Cloudflare Tunnel. Follow Option 2 in the Cloudflare Tunnel Setup section to map it to a permanent domain name.
15. Can I use this as an Aider proxy server? Yes, Aider supports custom OpenAI bases via the --openai-api-base flag. It works flawlessly.
Client Request (OpenAI format)
│
▼
┌──────────────────────────────────────┐
│ commandcode-cursor-proxy (:55990) │
│ │
│ 1. Auth: resolves API key │
│ 2. Model: maps short name → full │
│ 3. Convert: OpenAI → CommandCode │
│ 4. Fingerprint: detect git/memory │
│ 5. Rate limit: token bucket │
│ 6. Forward → api.commandcode.ai │
│ 7. Stream back: CC → OpenAI SSE │
│ (15s keep-alive pings) │
└──────────────────────────────────────┘
│
▼
┌──────────────────────────────────────┐
│ api.commandcode.ai/alpha/generate │
│ (CommandCode CLI endpoint) │
└──────────────────────────────────────┘
We are building a robust community around AI coding assistant proxy tools.
| Method | Path | Purpose |
|---|---|---|
| POST | /v1/chat/completions | Chat with streaming & non-streaming |
| POST | /chat/completions | Convenience alias |
| POST | /v1/responses | OpenAI Responses API format |
| POST | /v1/messages | Anthropic-compatible messages format |
| GET | /v1/models | List 50+ models |
| GET | /health | Health check ({"status":"ok"}) |
| GET | /metrics | Request stats & uptime |
| GET | /balance | Billing/credits check |
| GET | /ui | Web dashboard (browser UI) |
| GET | /ui/api/status | Status JSON (proxy, auth, cloudflared) |
| GET/POST | /ui/api/config | Read/save API key (local file) |
| POST | /ui/api/cli-login | Launch cmd auth login in a terminal |
| GET/POST | /ui/api/tunnel | Start/stop cloudflared, get URL + logs |
| POST | /ui/api/test | Send a test chat request |
| POST | /ui/api/shutdown | Gracefully stop the proxy from the UI |
git clone https://github.com/Nir-Bhay/commandcode-cursor-proxy.git
cd commandcode-cursor-proxy
go build -o bin/commandcode-cursor-proxy.exe .
# Cross-compile
GOOS=linux GOARCH=amd64 go build -o bin/commandcode-cursor-proxy .Open http://127.0.0.1:55990/ui manually in your browser. The auto-open is best-effort and may fail on some Linux setups without xdg-open.
Install it:
The dashboard auto-detects it (including the default Windows path C:\Program Files (x86)\cloudflared\).
Wait ~10 seconds after clicking Start — cloudflared needs to request a quick tunnel. The URL appears in the tunnel logs panel as soon as it's assigned. The proxy reads both stdout and stderr to catch it.
Install the CommandCode CLI first: npm i -g command-code, then click the button again. It will open a terminal window running cmd auth login.
The key is stored at ~/.commandcode-cursor-proxy/config.json with 0600 permissions. If your home directory isn't writable, the save will fail — check the toast notification for the error.
Click the red Stop button in the top bar. The proxy shuts down gracefully (finishes in-flight requests, stops the tunnel, then exits). You'll need to run the EXE again to restart.
This project is intended as a study of:
If you're learning about any of these topics, the source code in internal/ is well-commented and designed for study.
MIT License — see LICENSE file.
Note: This project does NOT include any CommandCode proprietary code, CLI binaries, or copyrighted materials. It is an independent format-translation layer that calls CommandCode's public API using the user's own credentials.
⭐ Star this repo if you found it useful!
🔧 Contributions welcome — PRs, issues, and suggestions appreciated.
📧 Questions? Open an issue on GitHub.
| Back | FazBrowse Home | New Git URL |