Gemini API key not working in Cursor, getting PROVIDER_ERROR

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

always getting this response when trying to use 3.1 pro or 3.0 flash (2.5 flash works fine):

Provider Error
We’re having trouble finding the resource you requested. If the problem persists, please contact support

i have disabled MCP servers and ran diagnostics, but to no avail, is this coming from Cursor’s side ?

for me Cursor is unusable because i only use external keys due to high token consumption with this project.

Steps to Reproduce

Try using Gemini models with your own API key (3.1 pro and 3.0 flash)

Operating System

MacOS

Version Information

Version: 3.0.16 (Universal)
VSCode Version: 1.105.1
Commit: 475871d112608994deb2e3065dfb7c6b0baa0c50
Date: 2026-04-09T05:33:51.767Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.4.0

For AI issues: which model did you use?

Gemini 3.1 pro and Gemini 3 flash

For AI issues: add Request ID with privacy disabled

Request ID: 7ff408cf-03d5-4339-aac0-407766d0b051
{“error”:“ERROR_PROVIDER_ERROR”,“details”:{“title”:“Provider Error”,“detail”:“We’re having trouble finding the resource you requested. If the problem persists, please contact support.”,“isRetryable”:false,“additionalInfo”:{},“buttons”:,“planChoices”:},“isExpected”:true}
Provider Error We’re having trouble finding the resource you requested. If the problem persists, please contact support.
aBi: Provider Error We’re having trouble finding the resource you requested. If the problem persists, please contact support.
at Fnw (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:43963:24394)
at Nnw (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:43963:23385)
at Jnw (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:43964:6487)
at A9u.run (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:43964:11286)
at async JIn.runAgentLoop (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:56307:11753)
at async k0d.streamFromAgentBackend (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:56377:11221)
at async k0d.getAgentStreamResponse (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:56377:17325)
at async XOe.submitChatMaybeAbortCurrent (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:44075:19892)
at async Gl (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:55360:4891)

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, thanks for the detailed report and the Request ID.

This is a known bug in v3.0.16. When using BYOK with Gemini 3.x models (3.1 Pro, 3.0 Flash), Cursor sends the wrong model name to the Google API, so Google returns a “not found” error. Gemini 2.5 Flash isn’t affected, which matches what you’re seeing.

The team is aware. There’s no ETA for a fix yet, but your report helps us prioritize it.

For now, the only workaround is to use Gemini 2.5 Flash with BYOK until an update ships with the fix.

Let me know if you have any questions.

isn’t it possible to use an older version of cursor ? this is terrible, i’ve lost hours of works

Yes, you can roll back to a previous version. Here’s what to do:

  • Download the previous version here: Cursor · Download
  • Install it over your current version
  • To stop Cursor from updating again: Settings Cmd+, → search for Update: Mode → set it to none

Just keep in mind that on an older version you won’t get bug fixes or new features. Once we ship an update that fixes this bug, it’ll make sense to turn auto-updates back on.

Let me know if you have any questions.

i did, and the problem is the same, which makes sense if the problem is on cursor’s servers,
although i’m not sure why this would be a “known bug in 3.0.16” if it affects all versions ?

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Request ID: e465ea0a-e5e6-43e0-aee0-79a84413d594
{“error”:“ERROR_PROVIDER_ERROR”,“details”:{“title”:“Provider Error”,“detail”:“We’re having trouble finding the resource you requested. If the problem persists, please contact support.”,“isRetryable”:false,“additionalInfo”:{},“buttons”:,“planChoices”:},“isExpected”:true}
Provider Error We’re having trouble finding the resource you requested. If the problem persists, please contact support.
aBi: Provider Error We’re having trouble finding the resource you requested. If the problem persists, please contact support.
at Fnw (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:43963:24394)
at Nnw (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:43963:23385)
at Jnw (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:43964:6487)
at A9u.run (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:43964:11286)
at async JIn.runAgentLoop (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:56307:11753)
at async k0d.streamFromAgentBackend (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:56377:11221)
at async k0d.getAgentStreamResponse (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:56377:17325)
at async XOe.submitChatMaybeAbortCurrent (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:44075:19892)
at async Gl (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:55360:4891)

Steps to Reproduce

Run an agent against gemini-3.1-pro-preview

Operating System

MacOS

Version Information

Version: 3.0.16
VSCode Version: 1.105.1
Commit: 475871d112608994deb2e3065dfb7c6b0baa0c50
Date: 2026-04-09T05:33:51.767Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.4.0

For AI issues: which model did you use?

Gemini via gemini studio key

For AI issues: add Request ID with privacy disabled

Request ID: e465ea0a-e5e6-43e0-aee0-79a84413d594
{“error”:“ERROR_PROVIDER_ERROR”,“details”:{“title”:“Provider Error”,“detail”:“We’re having trouble finding the resource you requested. If the problem persists, please contact support.”,“isRetryable”:false,“additionalInfo”:{},“buttons”:,“planChoices”:},“isExpected”:true}
Provider Error We’re having trouble finding the resource you requested. If the problem persists, please contact support.
aBi: Provider Error We’re having trouble finding the resource you requested. If the problem persists, please contact support.
at Fnw (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:43963:24394)
at Nnw (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:43963:23385)
at Jnw (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:43964:6487)
at A9u.run (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:43964:11286)
at async JIn.runAgentLoop (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:56307:11753)
at async k0d.streamFromAgentBackend (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:56377:11221)
at async k0d.getAgentStreamResponse (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:56377:17325)
at async XOe.submitChatMaybeAbortCurrent (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:44075:19892)
at async Gl (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:55360:4891)

Request ID: c30eed31-6a3a-495d-8436-f2920f9405e6
{“error”:“ERROR_PROVIDER_ERROR”,“details”:{“title”:“Provider Error”,“detail”:“We’re having trouble finding the resource you requested. If the problem persists, please contact support.”,“isRetryable”:false,“additionalInfo”:{},“buttons”:,“planChoices”:},“isExpected”:true}
Provider Error We’re having trouble finding the resource you requested. If the problem persists, please contact support.
aBi: Provider Error We’re having trouble finding the resource you requested. If the problem persists, please contact support.
at Fnw (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:43963:24394)
at Nnw (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:43963:23385)
at Jnw (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:43964:6487)
at A9u.run (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:43964:11286)
at async JIn.runAgentLoop (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:56307:11753)
at async k0d.streamFromAgentBackend (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:56377:11221)
at async k0d.getAgentStreamResponse (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:56377:17325)
at async XOe.submitChatMaybeAbortCurrent (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:44075:19892)
at async Gl (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:55360:4891)

Additional Information

I made the mistake to upgrade. Yesterday it was working.

Does this stop you from using Cursor

Yes - Cursor is unusable

Request ID: cd952da0-b652-4826-944e-502c6e68fb67
{“error”:“ERROR_PROVIDER_ERROR”,“details”:{“title”:“Provider Error”,“detail”:“We’re having trouble finding the resource you requested. If the problem persists, please contact support.”,“isRetryable”:false,“additionalInfo”:{},“buttons”:,“planChoices”:},“isExpected”:true}
Provider Error We’re having trouble finding the resource you requested. If the problem persists, please contact support.
aBi: Provider Error We’re having trouble finding the resource you requested. If the problem persists, please contact support.
at Fnw (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:43963:24394)
at Nnw (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:43963:23385)
at Jnw (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:43964:6487)
at A9u.run (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:43964:11286)
at async JIn.runAgentLoop (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:56307:11753)
at async k0d.streamFromAgentBackend (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:56377:11221)
at async k0d.getAgentStreamResponse (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:56377:17325)
at async XOe.submitChatMaybeAbortCurrent (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:44075:19892)
at async NGa.acceptPlan (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:44114:28242)

I’m getting the same issue (provider error message) as well.
But it’s not the cursor version she mentioned. Mine is the latest version.

Has it not been resolved yet?

Version Information
Version: 3.1.15
VSCode Version: 1.105.1
Commit: 3a67af7b780e0bfc8d32aefa96b8ff1cb8817f80
Date: 2026-04-15T01:46:06.515Z (1 day ago)
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 24.4.0

I’m getting the same error with the latest version: Version: 3.1.15

@monkeymanford Good catch, you’re right. Rolling back the version doesn’t help here. I should’ve been clearer. The model name mapping issue is server-side, not client-side. So no matter which Cursor version you’re on, it’s the same bug. Sorry for the confusion.

@nam.su Same issue, it’s not fixed yet. This bug affects all versions because model name resolution happens on the server.

Right now the only working workaround for BYOK is Gemini 2.5 Flash. I know that’s not ideal. The team has flagged this and we don’t have an ETA yet, but your reports help us prioritize. I’ll update this thread when there’s news.

I just upgraded cursor and Gemini 3.1 BYOK stopped working. Even though it was working fine before the upgrade.

You team should let users customize their own model name, endpoint and base url like Dify does, then this issue will perfectly solved.

Same problem here. I just updated to the lastest Cursor Version v3.1 (at 20 April 2026) and Gemini API key stop working for all Gemini models.

I fix it downgrading Cursor Version to v3.0
Steps:

  1. Find and dowload an older Cursor version at: Cursor Dowloads
  2. Close Cursor, (re)install the older dowloaded version and start Cursor
  3. Validate the version over the Tab: Help → About

This steps fix my API key problem for Gemini.
NOTE: Previous chats were preserved after the reinstallation :slight_smile:

Seems like a known issue, I hope Cursor can solve it soon.

Cursor support told me they were working on this issue.

I followed your instructions exactly.

The version was downgraded, but the same provider error still occurs.

Did you perhaps completely delete the new cursor and then reinstall it? I proceeded by replacing the downgraded version.

The version is 3.0.16.

Thank you in advance for your feedback :slight_smile:

Hey @nam.su, reinstalling won’t help, sadly. This is a server-side bug. The model name is being resolved incorrectly on our backend when the request goes through BYOK for Gemini 3.x. Your local Cursor version doesn’t matter, the error will be the same.

The only working workaround right now is using Gemini 2.5 Flash with BYOK. That model isn’t affected since its slug matches a valid name on Google’s side.

We’re aware of the issue and tracking it. I can’t share an ETA for a fix yet. Once I have an update, I’ll post it in this thread.

I didn’t remove/uninstall Cursor before install the older version. I just install the just downloaded older version and it appears to override to this old version.
Yes, the version that works for me is 3.0.16

Note: I don’t recommend downgrading Cursor, I’m just sharing what worked for me.

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.

Same for me it doesn’t work. It was working before the update.

Thank you to the Cursor team for always providing such a fantastic service!

I was actually struggling with this exact same issue. However, I found a solution: I confirmed that if you add gemini-3.1-pro-preview as a Custom Model in the settings (as specified in the Google Gemini API documentation), it works perfectly fine using a User API Key.

It is currently working without any problems for me. Does this workaround solve the issue for the rest of you?