Cursor with a LiteLLM gateway

Cursor can send Ask, Plan and Agent traffic through a self-hosted LiteLLM gateway so model access and spend are governed per person. This page covers the base URL setup, the public reachability requirement, the version agent mode needs and the limits to plan around.

On this page

How Cursor connects to LiteLLM for Cursor integration

Developers who use Cursor and whose organization needs that model traffic governed by virtual keys, budgets and request logs can point Cursor at a self-hosted LiteLLM proxy. The connection is made through the Override OpenAI Base URL setting in Cursor, set to <proxy>/cursor, and it covers Cursor's Ask, Plan and Agent modes. This is the method LiteLLM documents in its Cursor integration tutorial, so it is the starting point for the setup. The reader should treat it as a supported route with an important caveat: LiteLLM describes its Cursor support as best effort, because Cursor does not officially support AI gateways. Cursor may change how it sends requests, and the gateway team should plan to retest after Cursor updates.

Because requests originate from Cursor's own servers rather than from the developer's laptop, the LiteLLM proxy must be reachable from the internet. That is a design decision with consequences for the network and security teams, not a setting to flip at the end. The gateway endpoint needs a public hostname, TLS, and controls the organization is willing to defend, such as strong virtual keys, network restrictions where Cursor's traffic allows them, and admin access kept separate from the public inference path. Before rollout, confirm with the LiteLLM tutorial and Cursor's current documentation which origins and paths the service must accept, and confirm that the chosen LiteLLM version supports agent mode. The tutorial specifies v1.97.0 or later for agent mode, so older gateways should be upgraded before developers are told to use it.

What you need before connecting Cursor to LiteLLM

Connecting Cursor to a LiteLLM gateway depends on four things lining up: the proxy release, a network path Cursor's servers can reach, a virtual key the gateway issues, and settings access on each user's Cursor account. Confirm each one before rollout so that Ask, Plan and Agent modes behave the same way for every developer.

LiteLLM release for Agent mode

Agent mode requires LiteLLM v1.97.0 or later. Ask and Plan modes work through the same /cursor path, but the Agent check should be the first thing you test on the chosen release. The GitHub releases page lists v1.105.1, published October 14, 2026, so confirm which stable minor line your team will run and whether it is still inside the supported window before you pin the image.

Releases page

Public HTTPS endpoint for the proxy

Cursor sends requests from its own servers, not from the developer's laptop, so the LiteLLM proxy must be reachable from the internet over HTTPS. Plan the hostname, the TLS certificate, the load balancer or ingress that fronts the proxy, and the firewall or allowlist rules that let that traffic in. Confirm with your security team how this exposure fits your network policy before anything goes live.

Virtual key issued through the gateway

Each developer or team should use a virtual key issued by the gateway rather than the master key, so budgets, model restrictions and request logs apply to the right identity. Virtual keys require a PostgreSQL database. Decide who issues keys, how they are rotated, and which models each key may call before you paste anything into Cursor's settings.

Virtual keys docs

Cursor plan and settings access

Each user needs a Cursor account and the ability to open the model settings where the Override OpenAI Base URL option lives. Check that the Cursor plan and admin policies in your organization allow custom base URLs, since some workspace settings may block them. Ask Cursor or your account contact to confirm this for your plan, because LiteLLM describes this path as best effort and Cursor does not officially support AI gateways.

Dedicated proxy configuration and database

The proxy itself needs a configuration file, a LITELLM_MASTER_KEY that starts with sk- and lives in a secret manager, and a PostgreSQL database for virtual keys and spend. Once more than one proxy instance runs, Redis 7.0 or newer is required for shared rate limits and router state. Size these components before the Cursor rollout so that a traffic spike from an agent session does not become an outage.

Production guide

Pilot group and rollback plan

Start with a small pilot group that covers Ask, Plan and Agent modes on the same release you intend to run in production. Record which Cursor version each pilot user runs, because behavior can differ between client builds. Agree a rollback path that returns users to their previous model settings if Agent mode breaks, and confirm who on your side can make that call.

How a Cursor request reaches your models through LiteLLM

The request starts in the developer's Cursor client, but the model call is made from Cursor's own servers, so it crosses the public internet to reach the LiteLLM proxy at the /cursor path. That public edge is the trust boundary: only the proxy should sit outside your private network. Inside, LiteLLM checks the virtual key, applies budgets and limits, and forwards the request to approved providers or private models, recording spend and logs along the way.

Cursor's servers call the proxy across the public edge, then LiteLLM applies key and spend checks before routing.

Configuring the Cursor base URL override step by step

This sequence takes a team from a confirmed LiteLLM version and public endpoint to Cursor sending Ask, Plan and Agent traffic through a governed virtual key, with spend visible in the gateway logs. Each step ends with a check so problems surface before developers rely on the setup.

  1. Confirm the proxy version and public endpoint

    Check that the proxy runs LiteLLM v1.97.0 or newer, because agent mode needs that version. Confirm that the proxy's /cursor path is reachable from the public internet over HTTPS, since Cursor sends requests from its own servers and not from developer laptops. Owned by the platform team. Done when a test request to the public URL reaches the proxy and returns a valid response, and the running version matches what you recorded.

  2. Create a team virtual key with models and budget

    In the admin UI or through the API, create a virtual key for the team that will use Cursor. Restrict it to the models you have approved for coding work, and set a budget and rate limits that match the team's agreed use. Record the key in your secret manager, not in a shared document. Done when the key appears in the key list with the expected model list and budget, and a test call made with that key succeeds against an approved model and fails against a model outside the list.

  3. Set the Override OpenAI Base URL to /cursor

    In Cursor's model settings, turn on the Override OpenAI Base URL option and enter your proxy address with the /cursor path appended. Keep the path exact, because the gateway routes Cursor traffic through that path. Done when the field saves without error and the setting persists after Cursor restarts on the test machine.

  4. Add the virtual key in Cursor

    Paste the team virtual key into the OpenAI API key field in Cursor. Do not add provider keys to Cursor, because the gateway holds those and applies the team's routing and budget. Done when Cursor accepts the key and the model picker lists the models your key allows.

  5. Select models for Ask, Plan and Agent

    Choose one approved model for each mode in Cursor and confirm that each selection is in the key's model list. Agent mode depends on the version check in the first step, so select an agent model only after that check passed. Done when each mode shows its chosen model in the interface without a model-not-allowed error.

  6. Test each mode with a prompt

    Send one short test prompt in Ask, one in Plan and one in Agent mode from the test machine. Agent mode should complete a simple task such as reading a file in the test project. Done when all three modes return output and no error from the proxy appears in Cursor.

  7. Confirm spend appears in the gateway logs

    Open the gateway's request logs and spend views and find the requests from the three test prompts under the team's virtual key. Check that the model names, token counts and cost entries match what you sent. Done when each test prompt appears as a logged request tied to the team key, which confirms that governance is working before wider rollout.

Agent mode, Azure fallback and the Cursor CLI limit

Ask and Plan modes send their model requests through the Override OpenAI Base URL setting, pointed at your proxy's /cursor path. For these modes, the rollout depends on the base URL, a virtual key and a proxy that Cursor's servers can reach, not on a specific agent feature version. Treat them as the baseline that the other tabs build on, and follow the steps in the LiteLLM Cursor tutorial.

  • Setting: Enter <proxy>/cursor as the override base URL in Cursor's model settings, then test with a key that allows only a small set of models.
  • Reachability: Cursor's servers make the model calls, so the proxy must be reachable from the internet at that address. An address that resolves only inside the office network will fail.
  • Keys: Issue a virtual key per developer or team so budgets, limits and logs attach to a person or team.
  • Support status: LiteLLM describes Cursor support as best effort because Cursor does not officially support AI gateways, so set that expectation with developers and security reviewers.

Before promising Ask and Plan to developers, confirm the Cursor version you will test against and run both modes end to end through your own proxy.

Why the LiteLLM proxy must be reachable from the internet

Cursor sends its model requests from its own servers, not from the developer's laptop, so a LiteLLM proxy that only listens on a private network will never see them. The /cursor path that the base URL override points at has to be resolvable and reachable from the public internet, and the LiteLLM documentation describes this support as best effort because Cursor does not officially support AI gateways. Before the security team approves the pattern, they should confirm this with the Cursor team and the LiteLLM Cursor tutorial, and they should treat the endpoint as a permanent internet-facing service with a named owner, not as a developer convenience.

The trade-off is a public endpoint against the controls that protect it. Terminate TLS at the edge with a current certificate, and keep the proxy off plain HTTP. Every request must carry a virtual key, so the proxy validates the key against its database and enforces the model allowlist, budget and rate limits on the key before any provider call is made. Use a WAF or edge rules to limit paths to the ones Cursor needs, to cap request size, and to log denied requests. IP allowlisting is an Enterprise feature, so if Cursor's source addresses cannot be pinned down for your configuration, confirm with your LiteLLM account team whether that control is available to you before relying on it.

Before exposing the path, the security team should review the admin UI and management API, which must not share the public hostname with the /cursor route, the virtual key rotation process and who can revoke a key quickly, and the logs that will record every prompt and response that transits the gateway. They should also ask for a written test plan that covers the endpoint from the internet, not only from inside the network, and confirm the LiteLLM release line in use is still supported. Our security testing team can run that external review as part of a scoped engagement.

Mapping Cursor users, keys and models to LiteLLM

This table maps each Cursor element to its LiteLLM counterpart: the person, the team, the mode, and the request log. Read the attribution column first, because a shared key records spend against the key rather than the developer who sent the request.

Cursor elementLiteLLM counterpartAttribution and trade-off
Developer using CursorVirtual key issued to the individual, or a user record the key belongs toPer-person keys let spend and logs be attributed to one developer. Confirm how your team issues and rotates keys before rollout.
Shared team setupTeam-level virtual key shared by a groupSpend shows at team level only. Individual developers cannot be identified from usage, so chargeback and investigations need another source.
Team budgetTeam budget, with per-key budgets and limits inside itCaps are enforced by LiteLLM at the proxy. Confirm budget reset behavior and temporary increase process with your admins.
Ask modeModel group the key is allowed to call, routed through the /cursor pathAsk uses the model chosen in Cursor. Restrict the key to approved models so the picker cannot reach unapproved ones.
Plan modeSame key and model restriction as Ask, unless a separate key is issuedPlan and Ask share the same routing path, so they cannot be budgeted apart without a separate key. Confirm this in your test setup.
Agent modeModel group allowed per key, with LiteLLM v1.97.0 or later at the proxyAgent traffic is typically the largest request volume. Set per-key limits and check the proxy version before enabling it for a team.
Request logsSpend records and request logs stored by LiteLLM, linked to the key that made the callLogs reflect the key, not the Cursor user, so attribution depends on how keys were issued. Confirm log retention with your compliance team.
Azure fallback modelSeparate model entry in the proxy configuration, restricted to the same keysA fallback that is not in the key's model list may be unreachable or unbudgeted. Test each fallback path before rollout.

Hardening the public Cursor endpoint

Because Cursor calls the gateway from its own servers, the LiteLLM proxy is exposed to the internet, so the controls below matter more here than on a private network. Each card covers one control you should decide and verify before developers connect Cursor.

Master key in a secret manager

The LITELLM_MASTER_KEY must start with sk- and grants administrative control of the proxy, so it should never sit in a config file or a shared document. Store it in a secret manager your organization already operates and inject it at runtime. Check that rotation is documented, that only the platform team can read it, and that it is not reused as a developer key.

LiteLLM production guide

Virtual keys restricted to models

Issue a separate virtual key per team or developer rather than giving Cursor the master key. Restrict each key to the specific models it may call, so a leaked key cannot reach every provider behind the gateway. Confirm that the Cursor model names you configure match the allowed list, because a mismatch shows up as a failed request rather than a policy alert.

Virtual keys docs

TPM and RPM limits per key

Set tokens-per-minute and requests-per-minute limits on each virtual key so one agent session running in a loop cannot exhaust shared provider capacity or spend. Agent mode generates far more calls than Ask mode, so agree on limits for each group before rollout. Test them with a realistic agent task in a pilot group and adjust before widening access.

Limits per key
TPM and RPM

Admin UI off the public path

Only the chat completion route needs to be reachable from Cursor's servers. Keep the admin UI and the management API on a private network, a VPN or an identity-aware proxy, and avoid publishing them on the same hostname. Verify from outside your network that admin paths do not respond, and review who can reach the proxy from the allowed address ranges you define.

Prompt log retention

Prompts sent from Cursor can contain source code, credentials pasted by mistake and personal data, so decide how long request logs are kept before go-live. Define the retention period in writing, limit who can read logs, and confirm that deletion runs on schedule. Check which logging settings are available in your edition, since some controls are Enterprise features.

LiteLLM Enterprise docs

Hardening depth and limits

Network exposure, image verification, encryption and cloud identity for the data stores are covered in the LiteLLM security hardening topic. Hardening reduces risk but does not make the endpoint certified or audited, so ask an independent assessor to test the exposed route before you rely on it for regulated work. Confirm Cursor's current support position for gateways with the vendor, since LiteLLM describes this integration as best effort.

Why Cursor requests fail through LiteLLM

This table lists the failures teams most often hit when Cursor is pointed at a LiteLLM gateway, with the likely cause and the fix for each. Work through the rows in order, since reachability and the base URL path are checked before key and budget problems appear. Most failures come from the version, the network path or the override value rather than from Cursor itself.

FailureLikely causeFix
Agent mode fails while Ask and Plan workThe LiteLLM proxy is older than v1.97.0, the first release the Cursor tutorial lists for agent modeUpgrade the proxy to v1.97.0 or later, then confirm the running version on the health endpoint before retesting agent mode
Cursor cannot reach the endpointThe proxy sits on a private network, so Cursor's servers cannot connect to itPublish the proxy on an internet-reachable hostname with TLS, and restrict access at the edge where your controls allow it
Requests return not found or route errorsThe Override OpenAI Base URL value is missing the /cursor path or points at the bare proxy rootSet the override to the proxy address with /cursor appended, and check the exact value against the LiteLLM Cursor tutorial
Authentication errors on every requestThe API key pasted into Cursor is not a LiteLLM virtual key, or it has been rotated or disabledCreate or reissue a virtual key for the developer or team, paste it into Cursor, and confirm the key is active in the admin UI
Requests denied for one model onlyThe virtual key is restricted to specific models and the selected Cursor model is not on its listAdd the model to the key's allowed models, or pick a model the key already permits
Requests stop after working earlierThe key, user or team budget is exhausted, or a temporary increase has expiredCheck spend against the budget in the admin UI, then raise the limit or grant a temporary increase with an owner and an end date
Developers expect Cursor CLI to use the gatewayThe LiteLLM Cursor integration covers the Cursor editor, and the CLI cannot target LiteLLMTell developers the CLI will not route through the gateway, and confirm current CLI behavior with Cursor before writing it into policy

Questions buyers ask about Cursor with LiteLLM

How much effort does Cursor behind LiteLLM take for a small team versus a fleet?

A small team mostly needs one working gateway, a virtual key per developer or team, and a Cursor setting changed on each machine. A fleet adds work that scales with headcount: identity and key issuance, admin rollout of settings, budget and model policy per team, log review, and an upgrade plan. The gateway itself is the same either way, so the difference is the number of people, devices and approvals you must manage. Ask any partner to split the quote into gateway build, developer enablement and ongoing operations, so you can see which part grows with headcount.

Can developers configure Cursor themselves once the gateway exists?

Yes, for the basic setup. Cursor's Override OpenAI Base URL setting can point at the proxy's /cursor path, and a developer can paste a virtual key. That works for a handful of engineers who accept that keys are managed by hand. It becomes harder to govern at scale, because keys get shared, rotated late or left active after someone leaves. Before handing off, confirm who issues keys, how revocation happens, and which models each key can reach. Write a short setup guide that names the exact setting and the version of Cursor you approved.

What does the work need from our people?

Plan for four groups of input before work starts:

  • An internet-reachable endpoint for the LiteLLM proxy, since Cursor sends requests from its own servers.
  • An identity owner who decides how developers are authenticated and mapped to teams.
  • Model approvals from security or the AI governance group, listing which providers and models may be used.
  • Budget owners who set spend limits per team or key and receive the reports.

Without these decisions, the build will stall at access and budget questions rather than at configuration.

Is Cursor support for LiteLLM official?

No. LiteLLM describes its Cursor support as best effort, because Cursor does not officially support AI gateways. Agent mode also has a version requirement: LiteLLM v1.97.0 or later is needed. The Cursor CLI cannot target LiteLLM at all, so terminal use of Cursor will not pass through the gateway. Treat the integration as a configuration that depends on Cursor's behavior, and test it again after each Cursor or LiteLLM upgrade. Confirm the current status with both vendors before you commit it to a policy.

Why must the LiteLLM proxy be reachable from the internet?

Cursor makes its model calls from its own servers, not from the developer's laptop, so the proxy has to accept connections from the public internet. That changes your exposure. The proxy needs TLS, strong authentication on every request, tight admin access, rate limits and logging, and a review of what is reachable on the network path. Discuss this with your security team before deployment, because it may conflict with an internal-only policy. Some organizations accept it with additional controls, and others decide the integration is not suitable for them.

What drives the cost of this integration upward?

Cost follows scope and the number of people involved. The main drivers are the number of developers and devices, the identity integration required, the number of providers and models in the approved list, the Enterprise features you need, and the depth of logging and budget reporting. Recurring costs include gateway hosting, the database and Redis that a multi-instance proxy requires, provider charges for model usage, and upgrades and support. Ask for a written quote that separates one-time build work from recurring operations, and confirm which LiteLLM edition each feature needs.

Should we use Cursor through LiteLLM or give developers direct provider access?

Choose the gateway when you need central keys, per-team budgets, model restrictions and request logs that you control. Direct provider access is simpler and avoids the public exposure and best-effort support described above, but spend and logs then sit with each provider account. Run a short pilot with a small group, measure how often the setup breaks after Cursor updates, and compare that against the governance you need. Your answer depends on how strict your logging and spend requirements are, not on the tool alone.

How DeployOpen scopes and delivers the Cursor integration

DeployOpen fixes the scope in writing before any work starts, because a Cursor integration depends on four decisions that are hard to change later. The first is the LiteLLM release line. Agent mode needs LiteLLM v1.97.0 or later, so the agreed scope names the exact version to deploy, the upgrade path onto the supported release line, and the date by which the team will review it. The second is the public endpoint design: the proxy must be reachable from the internet because Cursor sends requests from its own servers, so the scope records the hostname, the TLS setup, which paths are exposed (including /cursor), and what sits in front of the proxy. The third is the key and budget model, meaning how virtual keys map to people and teams, which models each key may call, and the TPM, RPM and budget limits. The fourth is which Cursor modes are in scope (Ask, Plan and Agent) and whether the Azure fallback is part of the plan. The Cursor CLI cannot target LiteLLM, and the written scope says so, so no one expects it to work.

Delivery runs in three stages. DeployOpen configures the proxy, the database and the Cursor override in your environment, and records each setting in configuration files your team can review. Testing then checks each mode against the agreed model list, confirms that a restricted key is refused for models it should not reach, confirms that spend appears against the right key, and checks that the public endpoint behaves as the design says. Handover covers the runbook, the list of settings that must match the scope, and the steps for rotating keys and upgrading the release. Ongoing support, upgrades and retesting after a LiteLLM release or a Cursor change are available as retainers, so the work does not end at handover. The quote follows from this written scope, and the effort depends mainly on the number of teams, the number of models and how much of the endpoint design your security team has already settled.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.