OpenAI API Key: on + Anthropic API Key: off leads to error messages when Claude is used

Hi,

When I configure my API keys like this:


OpenAI API Key: on
Anthropic API Key: off

And attempt to use Claude model for anything, I get this error message in Cursor:
{"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}

Expected behaviour:
Cursor is using my paid subscription for accessing Anthropic API.

Current behaviour:
Cursor errors out with authentication_error.

Hi @gzb

You need to disable all your API keys to use the models from your subscription.

Thanks for the response.

So you want to say it’s not a bug, it’s a feature?

If so, of course, it’s up to the team to decide how it works. But I’m personally not fully convinced this is the best UX. And the UI certainly doesn’t suggest this is how it works. As a user, I disable the Anthropic API key, so why it is used?

Perhaps two modes of operation need to be more prominent: subscription mode or API keys mode.

But in my particular case, just to explain the use-case, I would actually prefer to use Cursor subscription for Claude and API key for OpenAI. My employer gave me an API key for OpenAI and they had o1-preview enabled on account.
But for other models, I would like to use Cursor subscription.
In fact, if granular is not possible, I am being pushed into converting into API keys fully, as it’s annoying to switch the API toggle on and off. And if I do, paying for Cursor subscription gets less justified to me.

This may be separated in the future, but currently, all requests run in a single thread, which can be inconvenient for some users, and I agree. You can also enable or disable your OpenAI API key using the shortcut cmd + shift + 0.

1 Like

Thank you for the details and appreciate the hint about shortcut! I’ll try to use that one

1 Like