Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Anthropic BYOK only works when “Override OpenAI Base URL” is OFF.
With the Override ON (needed for an OpenAI-compatible gateway/proxy), selecting any Claude model with my own Anthropic key fails every time:
ERROR_BAD_USER_API_KEY / “Invalid API key. Unauthorized User API key”
Request ID: 718e39b2-d9b3-42fd-8ee2-af741ef16721
The key is valid. After turning the Override OFF, the same key works and Anthropic bills the requests, so the key is not the problem.
Root cause from inspecting the client (3.27.22):
- The Override is a single instance-wide switch, not per provider/model.
- Model-to-key routing is by name prefix: claude- checks only useClaudeKey, gemini- checks only useGoogleKey, and everything else falls into useOpenAIKey.
- With Override ON plus an Anthropic key, Claude requests are sent through the BYOK/connect path and rejected.
- With the Anthropic key OFF, Claude silently goes to Cursor managed (managed-local) and consumes Cursor quota instead.
- So I cannot use an OpenAI-compatible gateway and my own Anthropic key in the same instance.
Steps to Reproduce
- Settings > Models: enable Anthropic API Key (valid key).
- Enable Override OpenAI Base URL with any OpenAI-compatible URL.
- Start an Agent chat with a claude-* model.
- Observe ERROR_BAD_USER_API_KEY / Unauthorized User API key.
- Turn the Override OFF and retry with the same Anthropic key: it works and Anthropic bills the request.
Expected Behavior
- A separate “Override Anthropic Base URL”, or per-model / per-provider base URLs.
- Setting an OpenAI base URL must never change how Anthropic or Google keys are used.
- The Override toggle must not re-enable itself (see the existing closed reports linked below).
- I should be able to keep an OpenAI-compatible gateway for GPT/custom aliases and use Anthropic BYOK for Claude in the same Cursor instance.
Operating System
Windows 10/11
Version Information
Version: 3.27.22
VSCode Version: 1.128.0
Commit: b1aa50cb6db84fd3e8c808259cb172ea73425c10
OS: Windows 10/11
For AI issues: which model did you use?
claude-* (Anthropic BYOK)
For AI issues: add Request ID with privacy disabled
Request ID: 718e39b2-d9b3-42fd-8ee2-af741ef16721
Additional Information
Related closed reports (still unfixed):
- Override Anthropic Base URL automatically switches on when using Anthropic BYOK
- API Keys for ChatGPT and Anthropic Failing
Also see the Feature Request for per-model / per-provider base URLs (search: custom base urls for each custom model).
Workaround today is a second Cursor profile (–user-data-dir), which is not a reasonable fix for a paid product. If this stays unfixed I am reconsidering my subscription.
Does this stop you from using Cursor
Sometimes - I can sometimes use Cursor