Recommended Free Tools
iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
To use LiteLLM models in Cursor, route requests through a reachable LiteLLM Proxy, then configure Cursor with the proxy’s /cursor URL, a LiteLLM virtual key, and the proxy’s public model name. The documented setup supports Ask and Plan modes; it does not route every Cursor feature through LiteLLM.
What the connection does
LiteLLM Proxy is a self-hosted, OpenAI-compatible gateway between Cursor and an upstream model provider. LiteLLM describes its proxy as a gateway that OpenAI-compatible clients can use without code changes, but that general compatibility does not mean every Cursor feature uses the proxy. LiteLLM Getting Started
Cursor’s custom API keys work with standard chat models. Specialized features such as Tab Completion continue using Cursor’s built-in models, according to Cursor’s API Keys documentation. The cited LiteLLM integration guide says the custom-key setup works in Ask and Plan modes, but not Agent mode; because this behavior can change, check the current LiteLLM Cursor integration guide before relying on that mode limitation.
Free tools Windows power users keep installed
One-click scans. No signup required.
Before you configure Cursor
- Have a LiteLLM Proxy running and reachable from the computer running Cursor. The proxy must have a public model name mapped to the provider and model you intend to use, with valid upstream provider credentials. LiteLLM’s setup example uses port 4000 and an Azure deployment, but those are example values, not requirements for every installation. LiteLLM Getting Started
- Create a LiteLLM virtual key and grant it access to the intended model. LiteLLM virtual keys can control model access and track spend. LiteLLM Virtual Keys
- Know the proxy’s reachable base URL and the exact public model name shown in LiteLLM under Models + Endpoints. LiteLLM Cursor integration guide
Set up Cursor to use the LiteLLM Proxy
- Open Cursor’s model settings. Go to Cursor Settings → Models and enable Override OpenAI Base URL. Enter your proxy’s reachable URL with
/cursorappended, such ashttps://your-litellm-proxy.example/cursor. Replace the example hostname with the address of your own proxy. LiteLLM Cursor integration guide - Enter the virtual key. Paste the LiteLLM virtual key into Cursor’s OpenAI API Key field. The integration guide says the expected key prefix is
sk-; use the key issued by your LiteLLM instance rather than an upstream provider key. LiteLLM Cursor integration guide - Add the public model. In Cursor’s model settings, choose + Add Custom Model, enter the public model name from LiteLLM’s Models + Endpoints view, and enable it. The model name must match the name exposed by your proxy—not necessarily the provider’s original model identifier. LiteLLM Cursor integration guide
- Send a small test prompt in Ask mode. Select the custom model in Ask mode and try a straightforward prompt. The cited guide documents Ask and Plan for this setup; it says Agent mode does not support custom API keys. LiteLLM Cursor integration guide
Fix common connection problems
Cursor returns no response
- Check that the base URL points to the reachable LiteLLM Proxy and ends in
/cursor. - Confirm that the virtual key is permitted to call the selected public model.
- Check that the proxy is running and that the machine running Cursor can reach it.
Cursor reports an authentication error
- Verify that the value in Cursor’s OpenAI API Key field is the LiteLLM virtual key, not an upstream provider credential.
- If the key may be invalid or exposed, create a replacement virtual key and update Cursor. Avoid sharing keys in screenshots, source control, or public examples.
The custom model is missing or unavailable
- Compare the name entered in Cursor with the public model name under LiteLLM’s Models + Endpoints view.
- Make sure the model is enabled in Cursor and allowed for the virtual key. LiteLLM Virtual Keys
Which Cursor features use LiteLLM?
This configuration is for supported standard chat-model requests, not a guarantee that all Cursor AI features pass through the proxy. Cursor’s API-key documentation says features requiring specialized models, including Tab Completion, continue using Cursor’s built-in models. Cursor’s API Keys documentation
Quick Recap
Rank #3
#1 Best Overall
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.

