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

**URL:** <https://forum.cursor.com/t/openai-api-key-on-anthropic-api-key-off-leads-to-error-messages-when-claude-is-used/25551>\
**Category:** Bug Reports\
**Created:** [October 30, 2024, 9:51pm UTC](https://forum.cursor.com/t/openai-api-key-on-anthropic-api-key-off-leads-to-error-messages-when-claude-is-used/25551 "2024-10-30T21:51:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gzb](https://avatars.discourse-cdn.com/v4/letter/g/ac91a4/32.png) [@gzb](https://forum.cursor.com/u/gzb)\
**Post date:** [October 30, 2024, 9:51pm UTC](https://forum.cursor.com/t/openai-api-key-on-anthropic-api-key-off-leads-to-error-messages-when-claude-is-used/25551/1 "2024-10-30T21:51:02Z")

</div>

Hi,

When I configure my API keys like this:

 ![SCR-20241031-bpuc-2](https://us1.discourse-cdn.com/cursor1/original/2X/d/daa31f3b34895289064efdc1a0345a7a617d86c4.png)  
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.

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [October 31, 2024, 4:30am UTC](https://forum.cursor.com/t/openai-api-key-on-anthropic-api-key-off-leads-to-error-messages-when-claude-is-used/25551/2 "2024-10-31T04:30:16Z")

</div>

Hi @gzb

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

---

<div class="post-metadata">

**Author:** ![gzb](https://avatars.discourse-cdn.com/v4/letter/g/ac91a4/32.png) [@gzb](https://forum.cursor.com/u/gzb)\
**Post date:** [October 31, 2024, 7:29am UTC](https://forum.cursor.com/t/openai-api-key-on-anthropic-api-key-off-leads-to-error-messages-when-claude-is-used/25551/3 "2024-10-31T07:29:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [October 31, 2024, 7:41am UTC](https://forum.cursor.com/t/openai-api-key-on-anthropic-api-key-off-leads-to-error-messages-when-claude-is-used/25551/4 "2024-10-31T07:41:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gzb](https://avatars.discourse-cdn.com/v4/letter/g/ac91a4/32.png) [@gzb](https://forum.cursor.com/u/gzb)\
**Post date:** [October 31, 2024, 9:30am UTC](https://forum.cursor.com/t/openai-api-key-on-anthropic-api-key-off-leads-to-error-messages-when-claude-is-used/25551/5 "2024-10-31T09:30:44Z")

</div>

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