Anthropic key works in Python & Claude Code, but Cursor 2.2.20 says “model … does not work with your current plan or api key"

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Hi everyone,

I’m trying to connect Cursor to Anthropic / Claude and I’m running into a model / API key issue that I can’t resolve.

I have an Anthropic account with a Claude Code workspace. Claude Code itself works correctly after running claude and /login.

In the Anthropic console, a claude_code_key_… key is created automatically for the Claude Code workspace.

I also created and tested a regular Anthropic API key in a small Python script (outside Cursor).

The script successfully calls Anthropic and returns a response.

The script reports the model used as: claude-sonnet-4-20250514.

So the key is valid and can use Sonnet 4 from Python.

The problem in Cursor

In Cursor’s settings I added my Anthropic API key.

In the Models section, I selected a Claude model labeled something like claude-sonnet-4-5.

When I run an agent/tab with that model, I get this popup:

“Invalid Model – The model claude-sonnet-4-5 does not work with your current plan or api key”

So the same key works in Python with claude-sonnet-4-20250514, but fails in Cursor when using claude-sonnet-4-5.

My suspicion

It looks like Cursor is using a shorthand model ID (claude-sonnet-4-5) that doesn’t match the exact Anthropic model ID (claude-sonnet-4-20250514) that my account is allowed to call. I don’t see how to make Cursor call the exact model ID that works in my Python script.

What I need help with

Is there a way in Cursor (on this version / Windows) to manually set the Claude / Anthropic model string to claude-sonnet-4-20250514 instead of claude-sonnet-4-5?

If not, which specific Claude model option in Cursor’s model list actually maps to claude-sonnet-4-20250514?

Has anyone with a similar setup (Cursor 2.2.20 on Windows and Anthropic API) hit this “does not work with your current plan or api key” error while the key works in a standalone script, and found a practical fix or configuration change?

Any concrete guidance, screenshots, or confirmation from others on the same Cursor version would be greatly appreciated. Thanks!

Steps to Reproduce

  1. Install Cursor on Windows 10 (Cursor Version: 2.2.20, VSCode 1.105.1, Electron 37.7.0, Node.js 22.20.0).
  2. Open Cursor and go to Settings → Models (or the Claude/Anthropic provider settings).
  3. Add an Anthropic API key that has been verified to work via a separate Python script using model claude-sonnet-4-20250514.
  4. In Cursor’s model list, select the model labeled claude-sonnet-4-5 for an agent/chat.
  5. Start a new chat/agent run using this model.

Observed Result

  • Cursor shows an error popup:
    “Invalid Model – The model claude-sonnet-4-5 does not work with your current plan or api key.”

Expected Result

  • Cursor should successfully call Anthropic using the configured key and model, or clearly indicate which exact Anthropic model ID should be selected/entered so that it matches claude-sonnet-4-20250514.

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.2.20 (user setup)
VSCode Version: 1.105.1
Commit: b3573281c4775bfc6bba466bf6563d3d498d1070
Date: 2025-12-12T06:29:26.017Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26200

For AI issues: which model did you use?

claude-sonnet-4-5
claude-sonnet-4-20250514
claude-haiku-4-5

Does this stop you from using Cursor

No - Cursor works, but with this issue

Thanks for the detailed report. Check Settings > Models > API Keys and verify that “Override OpenAI Base URL” is turned off - when enabled, it causes Anthropic API requests to fail with this exact error even with valid keys.

The team is working on a permanent fix - this workaround should let you use your Anthropic key in the meantime.

Similar reports: API Keys for ChatGPT and Anthropic Failing and Anthropic models break when Override OpenAI BaseUrl is set

Hello Sanjeed,

Actually it is already turned off. FYI: I am using the free version of the Cursor, can it be the issue?

Hello Sanjeed,

Any updates by chance?

Can you share a request ID where this fails?