Skip to content
IQ Routing

Cursor

Cursor reads model configuration from its in-app settings panel rather than from environment variables. The gateway plugs in via the “OpenAI Base URL Override” field. Once configured, every Cursor completion (Cmd-K, Tab autocomplete, the in-editor chat) routes through the gateway.

Drop-in switch

Open Cursor settings → Models → expand the OpenAI section.

  • OpenAI API Key: your gateway key (gw_live_xxxxxxxx).
  • OpenAI Base URL: https://gateway.iq-routing.com/v1
  • Override: check the box.

Hit Verify. Cursor sends a single chat.completions.create against the gateway and confirms the key works. If Verify fails, Cursor shows the gateway's error text directly: a 401 means the key is missing or malformed, a 403 API key revoked means it was revoked from /keys.

Verify it routes

After the verify step succeeds, open the Cursor chat panel and send a short prompt (“say hello”). Within a few seconds the response appears with the gateway's standard latency. Open your dashboard at /requests and the most-recent row is the Cursor request, with the chosen model and the cache-hit status. Every response also carries an X-Request-Id header; once there is more than one row, paste that value into /requests/<uuid> to jump straight to the right one.

Cursor's autocomplete uses a separate code-completion model that routes through the gateway transparently when the override is set. Tab autocomplete latency is the gateway's own routing overhead plus the completion call itself plus Cursor's own debounce (about 250 ms by default). A cache hit skips the completion call entirely; a cache miss pays for whatever the picked model's own generation time is on top of the gateway's overhead.

Using capability aliases

The cap:<name> syntax in the model field tells the gateway to pick a concrete model at routing time based on the capability's stable intent rather than a pinned model id. Resolution checks your org's capability table first, then the global default, and folds in your account's focus-mode setting; if the resolved model can't be reached, the gateway falls back down the routing ladder instead of failing the call. Five default capabilities resolve to a concrete model: reason-heavy, tool-call-strict, long-context-128k, vision, and json-mode. A sixth, cheap-fast, is accepted too but currently routes like auto -- see capability aliases.

Cursor's Models panel accepts a custom model id in the “Model Name” field once the OpenAI Base URL Override is set to the gateway. Type cap:reason-heavy (or any of the six capability ids) and Cursor sends that string through as the model field on each chat.completions.create call. For a JSON-config alternative, edit ~/.cursor/settings.json directly:

{
  "openai.baseUrl": "https://gateway.iq-routing.com/v1",
  "openai.apiKey": "gw_live_xxxxxxxx",
  "openai.modelName": "cap:reason-heavy"
}

The resolved provider plus model surface in the x-iq-routing response header (a JSON-encoded payload with chosen_provider and chosen_model fields, among others), so the dashboard's /requests view shows which concrete model handled each Cursor request. See the capability aliases docs for the full set of defaults, the focus-mode interaction, and how to override them. The operator can override the default capability mapping via the capabilities dashboard editor at /settings/capabilities.

Common gotchas

Cursor caches the “Verify” result. If you change the override and Cursor still uses the old base URL, restart Cursor; the cache clears on app launch.

The override applies to OpenAI-shape calls. Cursor's Anthropic integration uses the Anthropic SDK separately; if you also use Cursor's Claude features, configure the Anthropic section with the same gateway origin (https://gateway.iq-routing.com, no /v1 suffix) and the same gateway key.

The Composer feature (multi-file edits) sends batched requests. Each one appears as its own row in /requests; the gateway does not collapse them. If you exceed your daily budget mid-Composer-session, the gateway returns 429 with an X-RateLimit-Scope: daily_budget header and the standard OpenAI error body shape; Cursor surfaces that error message in the Composer dialog. See the FAQ for the full list of rate-limit scopes.

The Cursor Tab feature respects the gateway's 429 cooldown; an exhausted cap pauses Tab completions until the cooldown clears. Watch your /dashboard spend bar during long coding sessions.

Privacy mode (Cursor's “Privacy Mode” setting) routes through Cursor's servers regardless of the override. To route Cursor privacy-mode traffic through the gateway, disable Cursor's privacy mode and rely on your own gateway-side logging policy.

Panel layout: the override panel is Cursor-version-specific. Field labels and their nesting move between Cursor releases; the override toggle remains the load-bearing configuration.

Try this in the playground

Open the playground for the Cursor recipe →