I have Cursor Pro, I followed all the steps there. I unchecked every model Cursor has, I tested with a basic mistral or minimax model and it runs fine. But if I try to run with a model Cursor provides (like Sonnet-4.5 or GPT-5.2 Codex) and it says “we’re having trouble connecting to the model provider”
I then test the API in a Colab Notebook and all models work fine. So it’s not an OpenRouter nor an end provider issue. Purely Cursor. It’s also not a settings issue since other OpenRouter models work. Seems to be a major bug in Cursor Pro that makes it unusable with best-in-class API keys.
I don’t want to blow through my Cursor Pro usage when my employer pays for an OpenRouter API key as well. This should be tablestakes, especially for Pro tiers and higher.
but they weren’t relevant as I have no tools nor MCPs nor extensions enabled. I also tried their steps of signing out and then back in but it made the issue worse. now i get “Invalid API Key
Unauthorized User API key” despite everything being toggled back on correctly just like in the video and other solutions.
I have a big 5-hour take home exam tomorrow where they are providing me with an OpenRouter API key. It’s a huge pain to have these issues with Cursor Pro+ at crunch time now.
OpenRouter isn’t officially supported in Cursor. The supported BYOK providers are OpenAI, Anthropic, Google AI, Azure OpenAI, and AWS Bedrock. You can see the full list here: API Keys docs API Keys | Cursor Docs
Some OpenRouter models might work by chance, but models that overlap with Cursor’s built-in ones (for example, Sonnet 4.5, GPT-5.2 Codex) are especially likely to break because of how Cursor formats requests for those specific models.
For your exam setup, I’d recommend:
If your employer gives you an OpenRouter key specifically, ask them to provide direct API keys from the providers instead (Anthropic for Claude, OpenAI for GPT). Those work reliably with BYOK in Cursor.
Or, your Pro+ subscription may already include access to Sonnet 4.5 and GPT-5.2 Codex, so you can use them directly without any API key.
About the “Invalid API Key / Unauthorized User API key” error after signing out and signing back in, try this:
Go to Cursor Settings > Models
Make sure any base URL override for OpenRouter is removed or cleared