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

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Getting “Unauthorized User API key” in regular cursor window agent panel
Request ID: c5298b99-3a4f-4827-8b6c-c4df62641138
{“error”:“ERROR_BAD_USER_API_KEY”,“details”:{“title”:“Bad User API key”,“detail”:“Unauthorized User API key”,“isRetryable”:false,“additionalInfo”:{},“buttons”:,“planChoices”:},“isExpected”:true}
ConnectError: [unauthenticated] Error
at jZc.$endAiConnectTransportReportError (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:6331:408762)
at dLo._doInvokeHandler (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:6948:21873)
at dLo._invokeHandler (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:6948:21615)
at dLo._receiveRequest (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:6948:20377)
at dLo._receiveOneMessage (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:6948:19194)
at _Pt.value (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:6948:17286)
at _e._deliver (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:49:2962)
at _e.fire (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:49:3283)
at tpt.fire (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:6316:12156)
at MessagePort. (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:8977:18439)

Steps to Reproduce

type anything into agent panel and hit enter

Screenshots / Screen Recordings

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.1.46
VSCode Version: 1.105.1
Commit: ab326d0767c02fb9847b342c43ea58275c4b1680
Date: 2025-12-02T03:59:29.283Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 24.6.0

Does this stop you from using Cursor

Yes - Cursor is unusable

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.

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