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

  1. Download and install from the Cursor website.
  2. 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_URL

Remove permanent exports from ~/.bashrc or ~/.zshrc if 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

  1. Open Models in the sidebar.
  2. Expand API Keys:
    • Enable Override OpenAI Base URL
    • Set URL to https://51kik.com/v1 (must include /v1)
  3. Paste your RouterBrain inference key in OpenAI API Key.
  4. Click verify next to OpenAI API Key, then Enable OpenAI API Key in the dialog.
  5. Under Models, click View All ModelsAdd Custom Model.
  6. Enter the catalog id exactly as returned by GET /models, then Add.
  7. 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

  1. Send a simple prompt in Chat with your custom model selected.
  2. 401 → key; 403 → model access or balance (Errors).
  3. Optional: validate with curl first (First request).

Quick reference

FieldValue
Override OpenAI Base URLhttps://51kik.com/v1
OpenAI API KeyConsole inference key
Custom model nameCatalog id

Related