# Bad request error when using cursor models with openai api key enabled

**URL:** <https://forum.cursor.com/t/bad-request-error-when-using-cursor-models-with-openai-api-key-enabled/165835>\
**Category:** Bug Reports\
**Tags:** byok, composer\
**Created:** [July 15, 2026, 11:12pm UTC](https://forum.cursor.com/t/bad-request-error-when-using-cursor-models-with-openai-api-key-enabled/165835 "2026-07-15T23:12:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![billybutcher](https://avatars.discourse-cdn.com/v4/letter/b/e0b2c6/32.png) [@billybutcher](https://forum.cursor.com/u/billybutcher)\
**Post date:** [July 15, 2026, 11:12pm UTC](https://forum.cursor.com/t/bad-request-error-when-using-cursor-models-with-openai-api-key-enabled/165835/1 "2026-07-15T23:12:42Z")

</div>

### Where does the bug appear (feature/product)?

Cursor IDE

### Describe the Bug

I’m using Cursor IDE and have a cursor subscription. I use my openai API key for openai models. However, when I try to use cursor models with my openai api key enabled, it gives me error:  
Bad Request: This model does not support custom API keys.  
To use cursor models (composer 2.5 or new grok one) then i have to switch off the openai api key. This is super annoying to manually have to do this when i wanna switch between models, and hinders my experience using cursor.

### Steps to Reproduce

I’m using Cursor IDE and have a cursor subscription. I use my openai API key for openai models. However, when I try to use cursor models with my openai api key enabled, it gives me error:  
Bad Request: This model does not support custom API keys.  
To use cursor models (composer 2.5 or new grok one) then i have to switch off the openai api key. This is super annoying to manually have to do this when i wanna switch between models, and hinders my experience using cursor.

### Expected Behavior

let me use a damn cursor model when i have openai api enabled

### Operating System

MacOS

### Version Information

Version: 3.9.16  
VS Code Extension API: 1.105.1  
Commit: 042b3c1a4c53f2c3808067f519fbfc67b72cad80  
Date: 2026-06-27T06:41:01.941Z  
Layout: editor  
Build Type: Stable  
Release Track: Default  
Electron: 40.10.3  
Chromium: 144.0.7559.236  
Node.js: 24.15.0  
V8: 14.4.258.32-electron.0  
xterm.js: 6.1.0-beta.256  
OS: Darwin arm64 25.4.0

### For AI issues: add Request ID with privacy disabled

Request ID: 29b11579-e403-49c1-a875-c1f21387fedc  
{“error”:“ERROR\_BAD\_REQUEST”,“details”:{“title”:“Bad Request”,“detail”:“This model does not support custom API keys.”,“isRetryable”:false,“additionalInfo”:{},“buttons”:,“planChoices”:,“analyticsMetadata”:{“actionRequired”:“config”}},“isExpected”:true}  
Bad Request This model does not support custom API keys.  
ActionRequiredError: Bad Request This model does not support custom API keys.  
at uAS (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:12056:27379)  
at EMc (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:12056:26530)  
at Fny (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:12057:11929)  
at Object.classify (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:12057:16434)  
at hAS (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:12057:5824)  
at async Oqm.runWithSharedTurnRunner (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:12057:15786)  
at async iH.runAgentLoop (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:24486:3041)  
at async Lkh.streamFromAgentBackend (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:24505:13862)  
at async Lkh.getAgentStreamResponse (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:24505:22888)  
at async IRe.submitChatMaybeAbortCurrent (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:12142:2399)

### Does this stop you from using Cursor

No - Cursor works, but with this issue

---

<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:** [July 16, 2026, 4:58am UTC](https://forum.cursor.com/t/bad-request-error-when-using-cursor-models-with-openai-api-key-enabled/165835/5 "2026-07-16T04:58:27Z")

</div>

Hey, thanks for the report. This isn’t a bug, it’s expected behavior. Cursor’s own models like Composer 2.5 and Grok 4.5 run on Cursor infrastructure, so they can’t be served through your OpenAI key. While an OpenAI API key is enabled, requests to those models are blocked on the backend, which is why you see This model does not support custom API keys.

A couple things that should make this easier:

- You’re on Pro, so you don’t need BYOK for Cursor models at all. They’re covered by your subscription. It only makes sense to keep a BYOK key for third party models.
- To avoid digging through settings every time, use the Toggle OpenAI key command in `Cmd+Shift+P`. Switching back and forth is faster.

I get that manual switching is annoying. We’ve already logged a request to make Cursor models work even when an OpenAI key is enabled. I don’t have an ETA yet, but I’ll update the thread if there’s news.
