Why localhost doesn't work as OpenAI Base URL in Cursor — and how to fix it Cursor's cloud backend routes all LLM API calls through its servers at api2.cursor.sh, making localhost base URLs unreachable and causing chat requests to hang. A developer found that exposing a local proxy via a Cloudflare tunnel resolves the issue, which is what the Ungate extension automates. TL;DR: Cursor doesn't call your OpenAI Base URL from your local machine. It routes every request through its backend servers on api2.cursor.sh , so http://localhost:8082 is unreachable — the chat hangs and your proxy logs stay empty. To connect Ollama, LM Studio, LiteLLM, or a custom subscription proxy, you must expose your local port through a public URL — a Cloudflare tunnel is the simplest way, and it is what the Ungate extension automates. When I first wrote a local Fastify proxy to connect my Claude subscription to Cursor, the setup felt trivial: start the server on port 8082, open Cursor Settings → Models → Override OpenAI Base URL , paste http://localhost:8082/v1 , and hit save. I typed a prompt into chat, hit Enter, and watched the status indicator spin forever. I opened terminal logs expecting to see incoming HTTP requests. Nothing. I ran tcpdump on my loopback interface — zero packets from Cursor. I spent an hour double-checking port bindings and firewall rules before realizing the issue wasn't in my code. It is in how Cursor is built. Unlike VS Code extensions, Aider, or Continue.dev — which send LLM API calls directly from your local Node process — Cursor processes chat and agent context on its own remote servers api2.cursor.sh . When you select a model and send a message, the request path is: Cursor UI ↓ Cursor's cloud backend ↓ Override OpenAI Base URL ↓ LLM Provider Because the third step originates from Cursor's cloud backend over the public internet, http://localhost:8082/v1 resolves to the backend server's own loopback interface — not your laptop. This breaks every local setup out of the box. Whether you are trying to route Cursor through Ollama http://localhost:11434 , LiteLLM http://localhost:4000 , vLLM, or a custom proxy, Cursor's backend simply cannot reach your machine's localhost . The safe version of the same idea, cursor localhost base url not working , is exactly the symptom this post explains. When http://localhost:8082/v1 is configured in Cursor Settings: api2.cursor.sh . http://localhost:8082/v1/chat/completions from its cloud servers.This makes debugging infuriating. The empty logs suggest your proxy isn't listening, when in reality the request died thousands of miles away before reaching your network. You can confirm this exact behavior right now without changing your proxy code. First, check that your local server works: curl http://localhost:8082/health → 200 OK Second, start an ad-hoc Cloudflare tunnel to expose that port publicly: cloudflared tunnel \ --config /dev/null \ --url http://localhost:8082 Grab the generated https://