Use RouterBrain as the model backend for AI coding in Cursor.
Cursor is Anysphere's AI-first IDE built on VS Code, with built-in agents and codebase awareness. Point the OpenAI-compatible endpoint at RouterBrain to use the gateway catalog in Chat, Composer, and related modes.
Install Cursor
- Download and install from the Cursor website.
- Open Settings and Sign in to your Cursor account.
Create an inference API key in the console (API keys) and pick a catalog id (List models) for the custom model name.
Configure RouterBrain API
Important: clear OpenAI env vars first
Before configuring Cursor, unset:
unset OPENAI_API_KEY unset OPENAI_BASE_URLRemove permanent exports from
~/.bashrcor~/.zshrcif present.
Note: custom models require Cursor Pro (or higher)
Without a paid plan you may see:
The model … does not work with your current plan or api key
Known issue: Override OpenAI Base URL is global
Enabling it affects all API keys in Cursor—including built-in Anthropic / OpenAI keys. Turn Override off when not using RouterBrain if built-in models break. Per-model base URLs are not supported yet (forum thread).
Setup steps
- Open Models in the sidebar.
- Expand API Keys:
- Enable Override OpenAI Base URL
- Set URL to
https://51kik.com/v1(must include/v1)
- Paste your RouterBrain inference key in OpenAI API Key.
- Click verify next to OpenAI API Key, then Enable OpenAI API Key in the dialog.
- Under Models, click View All Models → Add Custom Model.
- Enter the catalog
idexactly as returned byGET /models, then Add. - Enable the new model and select it in Chat or Composer.
Notes
- Cursor Tab autocomplete uses Cursor's own models, not your custom API key. Custom models apply to Chat / Composer / Edit.
- If responses are empty, try Settings → Network → HTTP/1.0.
Verify
- Send a simple prompt in Chat with your custom model selected.
- 401 → key; 403 → model access or balance (Errors).
- Optional: validate with curl first (First request).
Quick reference
| Field | Value |
|---|---|
| Override OpenAI Base URL | https://51kik.com/v1 |
| OpenAI API Key | Console inference key |
| Custom model name | Catalog id |