Coding agents

Set up Cursor with Router

Use Router in Cursor with its OpenAI API key and base URL override, and create Claude model aliases with the Ramp CLI.

Cursor can send requests to an OpenAI-compatible endpoint if you give it your own API key and a base URL. Cursor keeps these settings in its own interface rather than in a file, so setup is a few clicks. The Ramp CLI doesn't change Cursor's settings for you, but ramp router cursor creates the aliases you need to reach Claude models from Cursor; see Use Claude and other non-OpenAI models.

What the override does and doesn't cover

Cursor's Override OpenAI Base URL setting is global for OpenAI-format requests, and it only speaks the OpenAI Chat Completions API, which Router serves at POST /v1/chat/completions.

Cursor model
Goes through Router?
Cursor's own OpenAI models (for example GPT-5.6 Sol)
Yes, while the override is on
Model names you add yourself, including Router aliases
Yes
Cursor's own Claude, Gemini, Grok, and Composer models
No, they stay on Cursor's backend
Tab autocomplete, Apply, and inline edit
No, they stay on Cursor's backend

To reach Claude, Gemini, or any other non-OpenAI model through Router, add a Router alias as a custom model name. Cursor's Anthropic and Google key fields have no base URL override in current versions, so a Router key pasted there would go to the vendor directly.

Note on privacy: Cursor sends requests that use a custom base URL from Cursor's own servers, so your Router key and your prompts pass through Cursor's backend, as with any bring-your-own-key setup.

1. Create an API key

Open API keys, create a key, and copy it. The secret is shown only once.

2. Configure Cursor

  1. Open Cursor Settings (Cmd+Shift+J on macOS, Ctrl+Shift+J elsewhere), then go to Models and expand API Keys.
  2. Paste your Router key into the OpenAI API Key field and turn on Use OpenAI API Key.
  3. Turn on Override OpenAI Base URL and set it to https://api.router.com/v1.
  4. In the model list, turn on the OpenAI models you want to use, or add Router model IDs and aliases with Add or search model, typing each ID exactly as it appears in GET /v1/models for your key.
  5. Choose the model in Cursor's chat model picker.

To see the models your key can use:

curl https://api.router.com/v1/models \
  -H "Authorization: Bearer $RAMP_ROUTER_API_KEY"

You add models yourself, so new Router models don't appear in Cursor until you add them in the same place. Cursor's reasoning-effort picker isn't sent to custom endpoints; Router applies each model's default effort.

Use Claude and other non-OpenAI models

Cursor never sends model names that start with claude- through the base URL override, and its own Gemini and Grok entries don't use it either. Instead, give the model an alias, which is a name of your own that routes to the model, and add the alias in Cursor.

Use the Ramp CLI to create Claude aliases automatically. If you haven't installed it yet, follow the CLI installation instructions, then run:

ramp router cursor
  1. Choose the Router API key you use in Cursor, or create a new key when prompted. If you create a new key, paste it into Cursor's OpenAI API Key field.
  2. The CLI creates aliases for available Claude models, or reuses matching aliases you already have. Each name replaces claude- with ramp-, so claude-opus-5-5 becomes ramp-opus-5-5.
  3. Add the alias names printed by the CLI to Cursor's model list, then choose one in the chat model picker.

These aliases belong to your Router user account, not just the key you selected. Your other API keys can use them too, subject to each key's model permissions; they aren't shared with other users in your company. Run ramp router cursor again when you want aliases for newly available Claude models. If the CLI doesn't list an alias you need, contact the Router team.

The CLI uses the ramp- prefix because Cursor matches custom names against its model list. A name that looks like one of its models can be treated as that model and held to your organization's Cursor model policy. See Aliases for more on how aliases appear in Router.

Undo the setup

In the same Cursor settings page, turn off Use OpenAI API Key and Override OpenAI Base URL, or restore the key and URL you used before. Remove any Router models you added to the list. Turning off Router in Cursor doesn't delete the aliases created on your Router account.

Troubleshooting

What you see
What to check
"Invalid API key" or "Unauthorized User API key"
The key was pasted wrong or was revoked, or the base URL points at a different Router company than the one that issued the key. Check it on the API keys page.
"Provider Error: We're having trouble finding the resource you requested"
Cursor got a 404 from the base URL. Check that the URL ends in /v1 with nothing after it, and that it points at Router.
Cursor says the model doesn't exist
The model ID is misspelled or isn't available for your key. Copy it from GET /v1/models.
A Claude model never reaches Router
Run ramp router cursor, then add one of the ramp- alias names printed by the CLI, as above.
Requests go to OpenAI instead of Router
Override OpenAI Base URL is off, or the URL is missing /v1.
A 501 error naming a Chat Completions field
Cursor sent a control Router can't translate for that model. See the Chat Completions limits.

If a failure persists, report it to the Router team with the x-request-id from the response. See Support and feedback.