Agent setup

Set up Cursor with Router

Use Router in Cursor with its OpenAI API key and base URL override, by hand or with the Ramp CLI, and reach Claude models through aliases.

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. On a Mac, ramp router configure cursor makes these changes for you and creates the aliases you need to reach Claude models from Cursor; see Set up Cursor with the Ramp CLI.

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 sends a reasoning effort with some GPT models. When it does, Router passes it on; otherwise the model uses its default.

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.

The Ramp CLI creates Claude aliases for you when you run ramp router configure cursor, as described below. It creates an alias for each available Claude model, or reuses matching aliases you already have. Each name replaces claude- with ramp-, so claude-opus-5-5 becomes ramp-opus-5-5. On a Mac, the CLI adds the aliases to Cursor's model list; elsewhere, add the alias names it prints to the list yourself, 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 configure 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.

Keep the ramp- prefix: Cursor can treat a name that looks like one of its own models as that model and apply your organization's Cursor model policy to it. See Aliases for more on how aliases appear in Router.

Set up Cursor with the Ramp CLI

If you haven't installed the Ramp CLI yet, follow the CLI installation instructions, then run:

ramp router configure cursor

The CLI signs you in to Router in your browser, chooses or creates a Router key, creates the Claude aliases above, and then finishes the setup in one of two ways:

  • On a Mac, it turns on Use OpenAI API Key and Override OpenAI Base URL with your Router key and Router's URL, and adds Router's models to Cursor's model list. Cursor must be closed while this happens, so the CLI offers to quit Cursor and reopens it afterwards, with your open files. Chats still running in Cursor will stop. macOS may also ask you to let the CLI use "Cursor Safe Storage", which is how Cursor stores your key; enter your Mac password if asked, then click Allow.
  • On Windows and Linux, it copies your Router key to the clipboard and prints the steps to finish in Cursor, which are the same as Configure Cursor above.

Note that the CLI can't set up Cursor from Cursor's own terminal, so run it from Terminal or iTerm. It also doesn't support Cursor Nightly.

By default, an interactive setup asks whether Cursor should list Router's recommended models or every model your key can use. You can choose up front with --cursor-models compact or --cursor-models all, and the CLI remembers your choice. Narrowing the list only removes models that the CLI added.

ramp router refresh doesn't update Cursor. To pick up new models, run ramp router configure cursor again. If you sign in to a different Cursor account, run it again too.

To undo the CLI's setup, quit Cursor and run ramp router configure disconnect cursor. It puts back the key and base URL you had before and removes the models it added. The aliases on your Router account stay in place.

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 configure cursor, then pick one of the ramp- alias names it created, as above.
The CLI says your Cursor team blocks personal API keys
Cursor won't use the Router key or base URL while your Cursor team disallows personal API keys. Ask your Cursor team admin to allow them.
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.