Skip to main content

Cursor IDE

Cursor IDE has native support for a custom OpenAI-compatible endpoint. Point it at an LLM Registry entry through the gateway's Cursor-compatibility path, and Cursor can use any provider the entry serves — including Gemini and Bedrock, not just OpenAI-family models.

Setup

All configuration lives in Cursor's Settings under Models. You'll do this in the UI — there are no CLI commands to run.

1. Enable "Override OpenAI Base URL"

In Cursor Settings → ModelsAPI Keys:

  • Toggle Override OpenAI Base URL on
  • Paste the gateway URL for the mode you want (see the tabs below), including the required /api/v1/cursor suffix

2. Set the OpenAI API Key

In the OpenAI API Key field, paste your Agent Access Key (or, in passthrough mode, whichever provider credential the entry requires — see per-provider notes below). Cursor sends this as Authorization: Bearer on every request.

3. Enable the models you want to use

Below API Keys, Cursor lists its default OpenAI models. Toggle those off if you want to use custom-provider models exclusively, then use the Add or search model input to add each model ID from the LLM Registry entry's Allowed Models list (for example, Gemini 3.6 Flash, gemini-2.0-flash, or a namespaced OpenRouter ID). Enable the toggle next to each.

URL to paste

Base URL:

  • Direct: https://<gateway-host>/llm/<url-prefix>/api/v1/cursor
  • Via Agent Persona: https://<gateway-host>/p/<persona-id>/llm/<registry-entry-id>/api/v1/cursor

OpenAI API Key:

  • Gateway-managed key mode: your Agent Access Key
  • Passthrough mode: your OpenAI API key
note

Some OpenAI models return errors from Cursor when routed through the compatibility path. If a model fails, try a different one from the Allowed Models list — the issue is model-specific, not endpoint-wide.

Where to find each value

PlaceholderWhere to find it
<gateway-host>Host from the LLM Registry entry's Overview tab
<url-prefix>The URL prefix field on the entry's Overview tab
<persona-id>The persona's ID on the Agent Persona page
<registry-entry-id>The LLM Registry entry's ID on the entry's URL
Model IDsThe entry's Allowed Models list

Tips

  • The /api/v1/cursor suffix is required. It's what tells the gateway to apply the Cursor-compatibility translation. Without it, Cursor's requests reach the gateway but the response shape may not match what Cursor expects.
  • Only the Override OpenAI Base URL field is used. Even for Anthropic or Gemini entries, keep the toggle for Override Anthropic Base URL / Override Google API Base URL off — Cursor routes everything through its OpenAI adapter when the OpenAI override is on, and the gateway's Cursor path handles the translation on its side.
  • Test a single model first. Add one model from the Allowed Models list, enable it, and try a chat before adding the rest. That way if the base URL or key is wrong, you catch it before spending time enabling ten models.
  • Custom model IDs stay case-sensitive. Cursor stores the exact string you type, and the gateway forwards it verbatim. Match the entry's Allowed Models list exactly.