Setup guide - Documented by OpenRouter
Use OpenRouter in Cursor
OpenRouter's official Cursor guide (beta) uses Cursor's Override OpenAI Base URL setting with a dedicated endpoint, https://openrouter.ai/api/v1/cursor. You then add OpenRouter model ids as custom models.
Last verified 6 steps1 official source
Steps
- Step 1.
Create an OpenRouter API key at openrouter.ai/keys (it starts with sk-or-...).
- Step 2.
Open Cursor Settings (gear icon or Cmd/Ctrl + ,), go to Models, and expand the API Keys section.
- Step 3.
Toggle on OpenAI API Key and paste your OpenRouter API key into the OpenAI API Key field.
- Step 4.
Toggle on Override OpenAI Base URL and set it to the dedicated Cursor endpoint.
Snippethttps://openrouter.ai/api/v1/cursor - Step 5.
In the Models section, click + Add model and enter OpenRouter model ids, for example:
Snippet~anthropic/claude-opus-latest ~openai/gpt-sol-latest ~moonshotai/kimi-latest deepseek/deepseek-v4-flash - Step 6.
Open the model picker in the chat or agent panel and select one of the models you added.
Caveats
- OpenRouter marks this integration as beta. Behavior may change as Cursor updates its client.
- The base URL must be https://openrouter.ai/api/v1/cursor, not /api/v1. On the generic endpoint, tool calls and some request formats may not work correctly.
- Tab completions always use Cursor's built-in models. Auto and Composer 2 modes may not route through your API key.
- Router aliases need the ~ prefix (for example ~anthropic/claude-sonnet-latest).
More setup guides
Same tool, other providers
Related reading
- Model Routing Recipes: Practical Config Patterns to Cut AI SpendModel routing recipes with paste-ready OpenRouter and LiteLLM configs for task tiers, fallback chains, cost ceilings and cache-aware routing that cut AI spend.
- OpenRouter Fusion Makes Model Panels Real. Use Them Like Escalation, Not AutopilotOpenRouter Fusion turns multi-model panels into an API feature. Use it as an escalation lane for prompts where a wrong answer is expensive, not as the default.
- OpenRouter in 2026: Review, Setup, and When Model Routing PaysOpenRouter review and setup - one API key for 300+ models with fallbacks and provider routing, what it costs, and when to go direct to a provider instead.
- LLM Routers Compared: LiteLLM vs Portkey vs OpenRouter in 2026LiteLLM vs Portkey vs OpenRouter compared for production AI apps: cost tracking, fallbacks, caching, and load balancing, plus when to use each router.
- Do Your Agent Hooks Fail Open? Claude Code vs Codex vs Cursor vs Gemini CLIA guard hook that crashes, times out or points at a missing script lets the tool call through by default in Claude Code. v2.1.295 adds onFailure: block. Here is what each coding agent does when your policy hook breaks, with real test runs.
- How to Keep API Keys Away From Your AI Coding Agent: Claude Code vs Codex vs Cursor vs Gemini CLIA deny rule on .env stops cat but not a Python one-liner. Here are the three layers that actually keep secrets out of a coding agent's context - file rules, environment scrubbing and credential masking - and what Claude Code, Codex, Cursor and Gemini CLI give you for each, with real test runs.
FAQ
How do I use OpenRouter in Cursor?
OpenRouter's official Cursor guide (beta) uses Cursor's Override OpenAI Base URL setting with a dedicated endpoint, https://openrouter.ai/api/v1/cursor. You then add OpenRouter model ids as custom models.
Which OpenRouter model ids work in Cursor?
The official docs read for this guide list ~anthropic/claude-opus-latest, ~openai/gpt-sol-latest, ~moonshotai/kimi-latest, deepseek/deepseek-v4-flash and ~anthropic/claude-sonnet-latest. Requests go to https://openrouter.ai/api/v1/cursor.
Is this an official OpenRouter and Cursor setup?
OpenRouter documents this setup in its own docs. It was last checked against 1 official page on October 17, 2026.
Sources
Last verified against 1 official page.
Newsletter
New models, set up the day they ship
One email per week. New model releases, the coding tools that support them and how to wire them up.