# Google API Key use is an issue

**URL:** <https://forum.cursor.com/t/google-api-key-use-is-an-issue/164440>\
**Category:** Bug Reports\
**Tags:** byok, gemini\
**Created:** [June 30, 2026, 2:46pm UTC](https://forum.cursor.com/t/google-api-key-use-is-an-issue/164440 "2026-06-30T14:46:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sharon](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@Sharon](https://forum.cursor.com/u/Sharon)\
**Post date:** [June 30, 2026, 2:46pm UTC](https://forum.cursor.com/t/google-api-key-use-is-an-issue/164440/1 "2026-06-30T14:46:44Z")

</div>

### Where does the bug appear (feature/product)?

Cursor IDE

### Describe the Bug

I receive this error message: Request ID: 94fdbbe3-ed28-4eb0-a5b2-4758d999f33a  
{“error”:“ERROR\_BAD\_USER\_API\_KEY”,“details”:{“title”:“Invalid API key.”,“detail”:“Unauthorized User API key”,“isRetryable”:false,“additionalInfo”:{},“buttons”:,“planChoices”:,“analyticsMetadata”:{“actionRequired”:“config”}},“isExpected”:true}  
Unauthorized User API key  
Invalid API key. Unauthorized User API key  
ActionRequiredError: Invalid API key. Unauthorized User API key  
at Nk1 (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:35723:27236)  
at Eag (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:35723:26381)  
at Wk1 (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:35724:7469)  
at Mag.run (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:35724:12367)  
at async zle.runAgentLoop (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:48116:2927)  
at async W$g.streamFromAgentBackend (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:48187:13900)  
at async W$g.getAgentStreamResponse (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:48187:22728)  
at async hut.submitChatMaybeAbortCurrent (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:35854:1970)

### Steps to Reproduce

Go to Google Ai Studio, copy your API key, Back to cursor, under settings, Google API key, paste the key you got from Google. Deselect ‘Override OpenAI Base URL…’ . Go to your chat interface, select any of the Gemini models then make a request, you will receive the error message above.

### Expected Behavior

It should process your request and make a suggestion as a response.

### Screenshots / Screen Recordings

 ![Screenshot 2026-06-30 at 17.31.56.png](https://us1.discourse-cdn.com/cursor1/original/3X/c/e/ce0cf9033c3d03141acf83e4929dcbfeaa26e249.png)

### Operating System

MacOS

### Version Information

Version: 3.7.42

### For AI issues: which model did you use?

Gemini 3.5 Flash or Gemini 3.1 Pro or Gemini 3 Flash

### For AI issues: add Request ID with privacy disabled

Unauthorized User API key Request ID: 94fdbbe3-ed28-4eb0-a5b2-4758d999f33a

### Does this stop you from using Cursor

Yes - Cursor is unusable

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [June 30, 2026, 3:18pm UTC](https://forum.cursor.com/t/google-api-key-use-is-an-issue/164440/5 "2026-06-30T15:18:31Z")

</div>

Hey, thanks for the detailed report with the Request ID. The `ERROR_BAD_USER_API_KEY` error means Google returned a 401 for your key, so the key is being rejected on Google’s side, not by Cursor. All Gemini models fail, including Gemini 2.5 Flash, which points to a key or config issue rather than a specific model.

Let’s go step by step:

1. Reset the OpenAI Base URL, even if Override is unchecked. Go to Settings → Models → OpenAI → click Reset to default for Base URL → Save → restart Cursor. A stale custom Base URL is the most common cause of this exact error, even for Gemini. Here’s a thread where this fixed it: [Getting "Unauthorized User API key" with Custom Gemini Key - Must I be a Pro User?](https://forum.cursor.com/t/73994)
2. If you still get 401, recreate the key at [https://aistudio.google.com/apikey](https://aistudio.google.com/apikey), paste it with no leading or trailing spaces, make sure Generative Language API is enabled for that key’s project, and remove any API or HTTP referrer restrictions from the key.

If the key passes Verify but you still get 401 on all Gemini models, reply here and we’ll dig deeper.

---

<div class="post-metadata">

**Author:** ![Nikita\_Czmakalov](https://avatars.discourse-cdn.com/v4/letter/n/d78d45/32.png) [@Nikita\_Czmakalov](https://forum.cursor.com/u/Nikita_Czmakalov)\
**Post date:** [June 30, 2026, 11:58pm UTC](https://forum.cursor.com/t/google-api-key-use-is-an-issue/164440/6 "2026-06-30T23:58:12Z")

</div>

Hi, pls help, I’ve tried all the methods from the forum related to date and time, but it still doesn’t work. I also tried logging out of the account, but after logging out, I couldn’t even authorize myself on the site. So, I’ll attach the 401 errors I get when trying to authorize below. I’d like to get some help in advance, thank you. Also, please indicate the email address linked to the Cursor account - [n78727580@gmail.com](mailto:n78727580@gmail.com). User is unauthorized Request ID: 6bf89665-7534-4701-a3f9-f6c1eb8257a8 . 0yjefa\_nvup70.js?dpl…aNBoSEx4HSRnfufm6:1 POST [https://cursor.com/api/dashboard/get-me](https://vk.com/away.php?to=https%3A%2F%2Fcursor.com%2Fapi%2Fdashboard%2Fget-me&utf=1) 401 (Unauthorized) 0ex8y.5gioay..js?dpl…aNBoSEx4HSRnfufm6:1 GET [https://cursor.com/api/auth/me](https://vk.com/away.php?to=https%3A%2F%2Fcursor.com%2Fapi%2Fauth%2Fme&utf=1) 401 (Unauthorized) 081ktw76gr-v9.js?dpl…aNBoSEx4HSRnfufm6:1 GET [https://cursor.com/api/auth/get-login-scope](https://vk.com/away.php?to=https%3A%2F%2Fcursor.com%2Fapi%2Fauth%2Fget-login-scope&utf=1) 401 (Unauthorized) 0.4v2ebj-b1\_8.js?dpl…aNBoSEx4HSRnfufm6:1 POST [https://cursor.com/api/dashboard/get-user-privacy-mode](https://vk.com/away.php?to=https%3A%2F%2Fcursor.com%2Fapi%2Fdashboard%2Fget-user-privacy-mode&utf=1) 401 (Unauthorized) 0l9al87d7p~sh.js?dpl…aNBoSEx4HSRnfufm6:1 GET [https://cursor.com/api/usage-summary](https://vk.com/away.php?to=https%3A%2F%2Fcursor.com%2Fapi%2Fusage-summary&utf=1) 401 (Unauthorized) 0l9al87d7p~sh.js?dpl…aNBoSEx4HSRnfufm6:1 POST [https://cursor.com/api/dashboard/get-p2p-referral-status](https://vk.com/away.php?to=https%3A%2F%2Fcursor.com%2Fapi%2Fdashboard%2Fget-p2p-referral-status&utf=1) 401 (Unauthorized) 0ex8y.5gioay..js?dpl…aNBoSEx4HSRnfufm6:1 POST [https://cursor.com/api/analytics/track-events](https://vk.com/away.php?to=https%3A%2F%2Fcursor.com%2Fapi%2Fanalytics%2Ftrack-events&utf=1) 401 (Unauthorized) 0ex8y.5gioay..js?dpl…aNBoSEx4HSRnfufm6:1 Failed to track event: 06stmw9xy6h3c.js?dpl…aNBoSEx4HSRnfufm6:1 POST [https://cursor.com/api/dashboard/check-user-api-key-access](https://vk.com/away.php?to=https%3A%2F%2Fcursor.com%2Fapi%2Fdashboard%2Fcheck-user-api-key-access&utf=1) 401 (Unauthorized) 06stmw9xy6h3c.js?dpl…aNBoSEx4HSRnfufm6:1 Failed to check user API key access 0yjefa\_nvup70.js?dpl…aNBoSEx4HSRnfufm6:1 POST [https://cursor.com/api/dashboard/get-me](https://vk.com/away.php?to=https%3A%2F%2Fcursor.com%2Fapi%2Fdashboard%2Fget-me&utf=1) 401 (Unauthorized) 0.4v2ebj-b1\_8.js?dpl…aNBoSEx4HSRnfufm6:1 POST [https://cursor.com/api/dashboard/get-user-privacy-mode](https://vk.com/away.php?to=https%3A%2F%2Fcursor.com%2Fapi%2Fdashboard%2Fget-user-privacy-mode&utf=1) 401 (Unauthorized) 0l9al87d7p~sh.js?dpl…aNBoSEx4HSRnfufm6:1 POST [https://cursor.com/api/dashboard/get-p2p-referral-status](https://vk.com/away.php?to=https%3A%2F%2Fcursor.com%2Fapi%2Fdashboard%2Fget-p2p-referral-status&utf=1) 401 (Unauthorized) 0l9al87d7p~sh.js?dpl…aNBoSEx4HSRnfufm6:1 GET [https://cursor.com/api/usage-summary](https://vk.com/away.php?to=https%3A%2F%2Fcursor.com%2Fapi%2Fusage-summary&utf=1) 401 (Unauthorized)

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [July 1, 2026, 7:19am UTC](https://forum.cursor.com/t/google-api-key-use-is-an-issue/164440/7 "2026-07-01T07:19:52Z")

</div>

Hey Nikita, this looks like a separate issue from the original BYOK topic, and since you can’t sign in to your account at all, our team should handle it directly.

Thanks for reaching out. Account and billing requests are handled by our team at [hi@cursor.com](mailto:hi@cursor.com). They’ll be able to look into your specific situation.

---

<div class="post-metadata">

**Author:** ![Sharon](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@Sharon](https://forum.cursor.com/u/Sharon)\
**Post date:** [July 2, 2026, 3:19pm UTC](https://forum.cursor.com/t/google-api-key-use-is-an-issue/164440/8 "2026-07-02T15:19:30Z")

</div>

Thank you Dean Rie! The solution works after several attempts.

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [August 1, 2026, 3:20pm UTC](https://forum.cursor.com/t/google-api-key-use-is-an-issue/164440/9 "2026-08-01T15:20:09Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
