Anthropic models break when Override OpenAI BaseUrl is set

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When setting the Override OpenAI Base URL to: https://api.x.ai/v1, All Claude models stop working (422 error response).

I have a working Anthropic api key. However, when the base url is changed (as stated above), all anthropic models stop working.

Documentation says to override the base url when using Grok models with custom API keys, which I have. However, it breaks Claude models when doing so.

Steps to Reproduce

  • Override OpenAI Base URL to: https://api.x.ai/v1
  • Provide valid api keys for both xai and anthropic models
  • Attempt to use an Claude model for your prompt. It will error.

Expected Behavior

Should function normally

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.1.26 (Universal)
VSCode Version: 1.105.1
Commit: f628a4761be40b8869ca61a6189cafd14756dff0
Date: 2025-11-24T05:39:06.655Z
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

Sometimes - I can sometimes use Cursor

1 Like

Hey, thanks for the report. The issue is that when you set a base URL, all your API keys see it. The team knows about this problem and is working on a fix. For now, here’s the current workaround:

  • Turn off “Override OpenAI Base URL” when using Claude (Anthropic). Make sure your Anthropic API key is set in Settings.
  • Only turn on the override to https://api.x.ai/v1 when you want to use Grok via x.ai, then turn it off again before switching back to Claude.

We’ll use your details to escalate the fix.

1 Like

Ok, yes, this is the workaround that I’ve been doing. Although, it would be nice if the Base URL override didn’t reset to the openai default value every time you turn on/off. In any case, glad that this is something Cursor is aware of, and look forward to a fix.

Thanks.

While you’re at it, maybe you could add a dedicated field for custom base URI for all models, not just OpenAI?

1 Like