Gemini API key not working in Cursor, getting PROVIDER_ERROR

I’d like to confirm that the “provider error” / custom model issue also appears to affect Gemma 4 models, not just Gemini.

In my case, I tested both Google AI Studio directly and OpenRouter directly, and the model works outside Cursor. For example, gemma-4-31b-it works via Google’s API, and google/gemma-4-31b-it:free works via OpenRouter. But inside Cursor, I still get errors like:

  • AI Model Not Found
  • Model name is not valid: "gemma-4-31b-it"

From the forum, this seems consistent with the existing custom model validation problem. Cursor staff have already said that “Model name is not valid” can happen because Cursor validates model names on its side before sending the request, and that recent client-side validation has blocked custom models. Cursor staff have also acknowledged separate issues around custom models and base URL override behavior. oai_citation:0‡Cursor - Community Forum

There are also recent reports from other users showing that this is not limited to one provider or one model family, including failures with GLM, Minimax, Kimi, and even custom Claude model names. Cursor staff also noted that some of this is server-side validation against Cursor’s catalog, with no working workaround for that case right now. oai_citation:1‡Cursor - Community Forum

So this looks like the same underlying problem also affects Gemma 4 through BYOK/custom model flows.

Could the dev team please make sure that the upcoming fix also covers Gemma 4 models, including at least:

  • gemma-4-31b-it via Google BYOK
  • google/gemma-4-31b-it
  • google/gemma-4-31b-it:free via OpenRouter / OpenAI-compatible endpoints

In my case, the provider/API side is working correctly outside Cursor, so the failure seems to be inside Cursor’s model validation/routing layer.

I’m happy to share exact reproduction steps, Cursor version, and terminal output if that would help. Thanks.