# With custom model api key get request error

**URL:** <https://forum.cursor.com/t/with-custom-model-api-key-get-request-error/144251>\
**Category:** Bug Reports\
**Created:** [November 26, 2025, 10:30am UTC](https://forum.cursor.com/t/with-custom-model-api-key-get-request-error/144251 "2025-11-26T10:30:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![prtngn](https://avatars.discourse-cdn.com/v4/letter/p/8e8cbc/32.png) [@prtngn](https://forum.cursor.com/u/prtngn)\
**Post date:** [November 26, 2025, 10:30am UTC](https://forum.cursor.com/t/with-custom-model-api-key-get-request-error/144251/1 "2025-11-26T10:30:50Z")

</div>

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

Cursor IDE

### Describe the Bug

When I set my own OpenAI API key in the settings, the agent mode stops working. None of the models (GPT-5 Codex, GPT-5) work.  
Moreover, if I switch to the Opus or Sonnet models, they also stop working.  
Request IDS:  
63ba3b7b-193a-45a4-bab6-7c3ca3d3f2ad gpt-5.1 codex  
614f6ca0-4533-4dcc-bae8-d051d552bcd9 opus-4.5

### Steps to Reproduce

Insert OpenAI key in settings

### Operating System

MacOS

### Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.1.36 (Universal)  
VSCode Version: 1.105.1  
Commit: 9cd7c8b6cebcbccc1242df211dee45a4b6fe15e0

### For AI issues: which model did you use?

GPT-5.1 Codex  
Opus 4.5

### Does this stop you from using Cursor

Yes - Cursor is unusable

---

<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:** [November 26, 2025, 1:25pm UTC](https://forum.cursor.com/t/with-custom-model-api-key-get-request-error/144251/2 "2025-11-26T13:25:06Z")

</div>

Hey, thanks for the report. This is a known bug: when you enable a custom OpenAI API key, it mistakenly applies to all models, causing other models (Claude, Gemini, etc.) to fail.

Workaround:

- Turn off your OpenAI API key toggle when using Claude/Gemini models (Settings \> Models \> API Keys)
- Turn it back on only when using OpenAI models
- Quick toggle shortcut: `Cmd+Shift+0`
- Unfortunately, there’s no ETA for a fix yet. The team is tracking this issue

Let me know if the workaround helps!

---

<div class="post-metadata">

**Author:** ![prtngn](https://avatars.discourse-cdn.com/v4/letter/p/8e8cbc/32.png) [@prtngn](https://forum.cursor.com/u/prtngn)\
**Post date:** [November 26, 2025, 2:42pm UTC](https://forum.cursor.com/t/with-custom-model-api-key-get-request-error/144251/3 "2025-11-26T14:42:57Z")

</div>

I think you don’t understand me )

I set OpenAI token and try agent mode with GPT-5.1 Codex model and get error.

````auto
Request ID: d6f188ab-53a8-467b-926f-1043a53ce07e
{"error":"ERROR_OPENAI","details":{"title":"Unable to reach the model provider","detail":"We encountered an issue when using your API key: Provider was unable to process your request\n\nAPI Error:\n\n```\nRequest failed with status code 404: {\n \"error\": {\n \"message\": \"This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?\",\n \"type\": \"invalid_request_error\",\n \"param\": \"model\",\n \"code\": null\n }\n}\n```","additionalInfo":{},"buttons":[],"planChoices":[]},"isExpected":true}
ConnectError: [invalid_argument] Error
    at RZc.$endAiConnectTransportReportError (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:6331:408452)
    at KPo._doInvokeHandler (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:6948:21873)
    at KPo._invokeHandler (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:6948:21615)
    at KPo._receiveRequest (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:6948:20377)
    at KPo._receiveOneMessage (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:6948:19194)
    at yPt.value (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:6948:17286)
    at _e._deliver (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:49:2962)
    at _e.fire (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:49:3283)
    at Xmt.fire (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:6316:12156)
    at MessagePort.<anonymous> (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:8973:18439)

````

---

<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:** [November 26, 2025, 3:02pm UTC](https://forum.cursor.com/t/with-custom-model-api-key-get-request-error/144251/4 "2025-11-26T15:02:52Z")

</div>

Thanks for clarifying.

The error you’re seeing `This is not a chat model and thus not supported in the v1/chat/completions endpoint` indicates that GPT-5.1 Codex requires the `/responses` API from OpenAI, but Cursor’s BYOK (bring your own key) currently only supports `/chat/completions`. This affects all GPT-5 models when using custom API keys.

Current situation:

- GPT-5/GPT-5.1 Codex work fine with Cursor’s built-in API (no custom key).
- When you add your own OpenAI API key, Cursor tries to use `/chat/completions`, which GPT-5 models don’t support.
- This is a known limitation affecting many users.

I’ll pass this on to the team.
