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

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

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

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.