Invalid Model - The model gemini-* does not work with your current plan or api key

The API key is correct and the model-name is also correct (actually a default one), but I get this error message. I can’t find any way to debug the request.

For example, gemini-2.0-flash-exp does not work (nor any of the other AI studio ones). I tried enabling/disabling the models, removing the key, and restarting/updating (on macOS, 0.45.3).

I pay for pro as well.

Hey, it looks like you’re trying to use Composer, but your API keys only work in Chat. They don’t work in Composer.

Nope I’m not just in Chat😅

Just to confirm, this issue happens in the Chat tab (as seen in the attached picture).

Have you confirmed the key is working outside of Cursor?

Yep, I have. It seemed to work for a request or two initially and then stop. But it works outside in several other applications + a very simple curl. Would be great if we could get a more specific error to debug—perhaps cursor isn’t properly saving/sending the key somehow.

Good shout, will see if we can get this in an upcoming client update!

For now, can you confirm everything works if you clear the OpenAI key field, just to ensure the wrong key isn’t being used here?

Thanks! Yeah still doesn’t work in this case :confused:

And this happens with every Gemini model?

Yes, it does not work for any gemini model. OpenRouter does work (e.g., through the OpenAI API settings) although the interface is terribly buggy and keeps overriding my settings after I save.

Please (please) take a look at the API Key settings if possible. I get the desire to have users pay directly instead of using the API but paying users want to use API keys as well. Gate the API keys behind the subscription even, just make it work. Each model name should map to a set of named credentials so that we can e.g., use openrouter AND openai, etc.