Cannot use 3.5 Sonnet while Claude API key is populated and Disabled

When I flip on my Claude API key I get a notification from Cursor saying I don’t need it with my paid subscription since I’m still well below my 500 fast requests per month. When I deactivate my Claude API key though I get an “Unable to reach Anthropic” error

API Error: {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}
Request ID: 77e531be-d41a-4120-905a-1852706d94c9

I should be able to use Cursor without an API key when I disable my API key.


Might be Anthropic related since they have an incident up on their status page, but confusing since using my API key works well. I’d suspect if it were an issue on Anthropic’s side that neither type of call would work.

Hi @nickz22

Let me know if it doesn’t get fixed after a while.

1 Like

@deanrie Still unable to reach Anthropic following their resolution of their earlier problem.

Same request is working when I use my own API key

@deanrie I’m still having this problem, it’s now the end of the month and I’m still paying for my Claude requests via my API key with 0 requests used of my allotted monthly 500 - any chance you can help me out? My last failed request ID was ad6bf897-a4f1-4242-aa92-2db830698fbc and the readout was -

We encountered an issue when using your Anthropic API key. Please check your API key settings and try again. Error: Request failed with status code 401
API Error: {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}

I completely removed my Anthropic API key to try to hard clear it from the system to no avail. I also reloaded my IDE window, that didn’t work either.

Have you tried clearing the cache or reinstalling Cursor? You can check out these guides:

Also, try the new model from Claude, it might not give an error.

Uninstalling Cursor didn’t work, and using the new model didn’t work.

I’d prefer not to try to clear Cursor cache…seems like it could have destructive side effects.

Logging out and logging back in worked, thanks!

1 Like

Thank you for sharing the solution.

@deanrie I’m unfortunately seeing it again after I enable my OpenAI key too…to workaround I have to disable my OpenAI API key (while my Anthropic key is also disabled) and try the request via the Sonnet 3.5 model, which works. As soon as I flip the OpenAI key on again though I start to get the “unable to connect” message.

Wait, are you trying to use the Claude model with the API enabled? You need to turn off your API key each time you want to access a model from your subscription. I thought you were dealing with this issue when all APIs were disabled.

@deanrie I am trying to use the Claude model from my subscription while my OpenAI API Key is enabled. I do not have my Claude API key enabled during this attempt.

Immediately works when I disable the OpenAI API Key

When your API key’s on, whether it’s from OpenAI or Anthropic, all your requests go through the API. That’s why you’re getting an error - OpenAI doesn’t have the Claude model.

Gotcha, so this is a feature request then to:

  • Route GPT model calls through either (a) allotted subscription usage or (b) OpenAI API key if it exists.
  • Route Claude model calls through either (a) allotted subscription usage or (b) Anthropic API key if it exists.

Thanks for the clarification!

3 Likes

I have the same issue. It would be great Cursor automatically select how to call models. I basically use a custom OpenAI key for GPT-4o. Meanwhile, I sometimes want to use Cloude 3.5 Sonnet, if outputs by GPT-4o doesn’t meet my expectation. I have to disable the OpenAI API key on Cursor every time. That would be hassle to me. So, I appreciate if Cursor could solve this.