# Getting "Unauthorized User API key" in regular cursor window agent panel

**URL:** <https://forum.cursor.com/t/getting-unauthorized-user-api-key-in-regular-cursor-window-agent-panel/145088>\
**Category:** Bug Reports\
**Created:** [December 3, 2025, 5:44am UTC](https://forum.cursor.com/t/getting-unauthorized-user-api-key-in-regular-cursor-window-agent-panel/145088 "2025-12-03T05:44:30Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [December 3, 2025, 8:56am UTC](https://forum.cursor.com/t/getting-unauthorized-user-api-key-in-regular-cursor-window-agent-panel/145088/2 "2025-12-03T08:56:00Z")

</div>

Hey, thanks for the report. The “Unauthorized User API key” error is often related to a bug with the “Override OpenAI Base URL” toggle.

Please try:

1. Settings \> Models \> API Keys: turn off “Override OpenAI Base URL” and clear the Base URL field.
2. Fully close Cursor (Cmd+Q) and restart it.
3. If you’re using OpenRouter or any custom OpenAI-compatible endpoint - it’s not supported yet and causes these errors: [Unauthorized User API key - OpenRouter + Anthropic API Key](https://forum.cursor.com/t/unauthorized-user-api-key-openrouter-anthropic-api-key/143280)

If the toggle turns on by itself, that’s a known bug (being worked on):

- Thread: [Override OpenAI Base URL toggle switch turn on automatically after few seconds no matter how many times I turn off](https://forum.cursor.com/t/override-openai-base-url-toggle-switch-turn-on-automatically-after-few-seconds-no-matter-how-many-times-i-turn-off/144215)
- Also see similar case: [API Keys for ChatGPT and Anthropic Failing](https://forum.cursor.com/t/api-keys-for-chatgpt-and-anthropic-failing/144188)

Can you share:

- A screenshot of Settings \> Models \> API Keys (toggle state and Base URL)
- Which model and provider (OpenAI/Anthropic/Google/Azure/AWS)
- Console errors (Help \> Toggle Developer Tools) when the error appears

Let me know if this helps. If not, we’ll escalate it further.

---

_[View the full topic](https://forum.cursor.com/t/getting-unauthorized-user-api-key-in-regular-cursor-window-agent-panel/145088)._
