Unauthorized User API Key for other models

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When using an OpenAI API Key, other models are not available. For example, if you choose Sonnet, it will error with “Invalid API Key” as though the system is trying to use the OpenAI API key for Anthropic models.

Steps to Reproduce

Add an OpenAI API Key
Try to use a non-openAI model.

Expected Behavior

That it works with a non-openAI model. It should not try to use the openAI key for another provider.

Operating System

Linux

Version Information

Version: 2.6.11
VSCode Version: 1.105.1
Commit: 8c95649f251a168cc4bb34c89531fae7db4bd990
Date: 2026-03-03T18:57:48.001Z
Build Type: Stable
Release Track: Default
Electron: 39.6.0
Chromium: 142.0.7444.265
Node.js: 22.22.0
V8: 14.2.231.22-electron.0
OS: Linux x64 6.8.0-100-generic

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, this is a known issue. When you set an OpenAI API key, that setting applies to all model providers, not just OpenAI. So Sonnet (Anthropic) tries to authenticate using your OpenAI key and it fails.

This has been discussed in a few threads:

Workaround: turn off the OpenAI API key in Settings > Models > API Keys before switching to non OpenAI models like Sonnet. It’s a bit tedious, but it’s the only reliable option right now.

The team knows about this. There’s no ETA yet, but your report helps us prioritize it.

1 Like

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