Cursor IDE
Squeezr can compress the context sent by Cursor's chat and agent modes, reducing token usage on every request. Tab completions (cursor-small) always go to Cursor's own infrastructure and cannot be intercepted.
Requirements
- BYOK (Bring Your Own Key) — you must have your own OpenAI or Anthropic API key configured in Cursor. Cursor's built-in plan routes calls through Cursor's servers, not your machine, so
localhostis unreachable. - Override Base URL — Cursor must be set to call your endpoint instead of the default API.
What gets intercepted
| Feature | Intercepted |
|---|---|
| Chat (Ask mode, Cmd+L) | ✅ Yes |
| Agent mode | ✅ Yes |
| Cmd+K (inline edit) | ✅ Yes |
| Tab completions | ❌ No — always go to Cursor's infra |
Step 1 — Start Squeezr
squeezr start
squeezr status # must say "running"Step 2 — Try localhost first
Open Cursor → Cmd+Shift+J (Settings) → Models.
- Add your API key — OpenAI (
sk-...) or Anthropic (sk-ant-...). - Enable Override OpenAI Base URL and set it to:
http://localhost:8080/v1 - Disable all built-in Cursor models — toggle off
cursor-small,cursor-fast, and any other Cursor-branded models. This is required because of a Cursor bug: the Override Base URL applies to all models, including built-in ones that can't authenticate with your key. - Click Add model and add a model name matching your API key (e.g.
gpt-4oorclaude-sonnet-4-5).
Open a Cursor chat (Cmd+L) and send a message. If it works — you're done.
If you see a network error or CORS error, proceed to Step 3.
Step 3 — Use the tunnel (if localhost fails)
Some versions of Cursor route BYOK calls through their servers even when Override Base URL is set, making localhost unreachable. The tunnel exposes your local proxy as a public HTTPS URL.
squeezr tunnelThe command will print a panel like this:
╔══════════════════════════════════════════════════════════════════╗
║ Tunnel active: https://abc123.trycloudflare.com ║
╠══════════════════════════════════════════════════════════════════╣
║ CURSOR SETUP ║
║ ║
║ Override OpenAI Base URL → https://abc123.trycloudflare.com/v1║
╚══════════════════════════════════════════════════════════════════╝Replace http://localhost:8080/v1 with the tunnel URL in Cursor Settings.
Tunnel notes
- The tunnel URL changes every time you restart
squeezr tunnel. You'll need to update Cursor Settings each time. - The tunnel uses Cloudflare Quick Tunnel — free, no account required. It uses the
cloudflaredbinary if installed, or falls back tonpx cloudflared@latest. - If
cloudflaredis not installed andnpxfails, install it manually:# macOS brew install cloudflared # Windows winget install Cloudflare.cloudflared # Linux # See https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/
Troubleshooting
"Failed to fetch" or network error
Verify squeezr status shows running. If using localhost, check that no firewall is blocking port 8080.
Built-in Cursor models stop working
This is a known Cursor bug — the Override Base URL applies to all models. Disable the built-in Cursor models (cursor-small, cursor-fast, etc.) in Settings → Models and use only your own model.
Anthropic Override activates automatically
When you add an Anthropic BYOK key, Cursor may automatically enable the Anthropic override URL. This is normal — just make sure the URL points to Squeezr (localhost or tunnel).
401 Unauthorized
The API key from Cursor is forwarded as-is. Check that your key is correct in Cursor Settings. Use squeezr logs to see incoming requests.