Anthropic BYOK still unusable while "Override OpenAI Base URL" is set — one global toggle breaks Claude BYOK (Windows, 3.27.22)

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

  1. Settings > Models: enable Anthropic API Key (valid key).
  2. Enable Override OpenAI Base URL with any OpenAI-compatible URL.
  3. Start an Agent chat with a claude-* model.
  4. Observe ERROR_BAD_USER_API_KEY / Unauthorized User API key.
  5. 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):

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

Hi @Qrsfx_Management, your read of it is right. Override OpenAI Base URL is currently one global setting, and when it’s on, Claude requests using your Anthropic key are sent to that base URL instead of Anthropic. Your gateway then rejects the Anthropic key, which is the Unauthorized User API key error you’re seeing. Your key itself is fine.

This is a known issue the team is aware of. Separate base URLs per provider aren’t supported yet; that’s being requested here: Custom base URLs for each custom model

In the meantime, a few options besides a second profile:

  1. Turn the override off while you’re working with Claude, and back on for your gateway models.
  2. If your gateway can serve Claude itself (using your Anthropic key upstream), add Claude there as a custom model whose name doesn’t start with “claude”. Cursor will then send it through the gateway like your other custom models, and it keeps working with the override on.

The earlier threads you linked describe the same behavior: Override Anthropic Base URL automatically switches on when using Anthropic BYOK