Using my own OpenAI API key doesn't work consistently

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I keep getting this error when using my own OpenAI API Key. I am not running out of credits. This keeps happening and at random times, which is really annoying.

Steps to Reproduce

Add your own OpenAI API key and try running the Agent with GPT 5.2

Screenshots / Screen Recordings

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.2.20 (user setup)
VSCode Version: 1.105.1
Commit: b3573281c4775bfc6bba466bf6563d3d498d1070
Date: 2025-12-12T06:29:26.017Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26200

For AI issues: which model did you use?

GPT 5.2 High

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey, thanks for the report. The “Request failed with status code 400” error with the “invalid_encrypted_content” message is a known issue that happens when using a custom OpenAI API key with GPT-5.2 and other reasoning models.

The screenshot shows a typical problem: the request content can’t be processed by the API due to a conflict between parameters that Cursor sends for reasoning models. This can happen irregularly due to different context parameters or request handling.

For now, try:

If the problem persists even with GPT-4o, it might be a caching or Cursor version issue. I’ll pass it to the engineers with priority.

1 Like

Hi,

I noticed that this always happens when I am close to running out of context. And I cannot run the Summarize command with the GPT 5.2 models.

I have updated to latest version and it is still the same, sorry did not get enough time to test with gpt-4o

Currently using:

Version: 2.2.33 (user setup)
VSCode Version: 1.105.1
Commit: e59189a34d286d2e1fd6985c9272738c54289860
Date: 2025-12-18T01:38:58.163Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26200
1 Like

Noticing same issue on MacOS as well.

Request ID: 9c1b5a69-8378-4637-bf49-1237afb9dbcd
{"error":"ERROR_OPENAI","details":{"title":"Unable to reach the model provider","detail":"We encountered an issue when using your API key: Streaming error\n\nAPI Error:\n\n```\n{\"error\":{\"type\":\"provider\",\"reason\":\"provider_error\",\"message\":\"Provider returned 400\",\"retryable\":false,\"provider\":{\"status\":400,\"body\":\"{\\n  \\\"error\\\": {\\n    \\\"message\\\": \\\"Item 'fc_02ddc9b6ece5fea70069459eb5643c81968863a4280ff246de' of type 'function_call' was provided without its required 'reasoning' item: 'rs_02ddc9b6ece5fea70069459eae45748196a24fd4d5ad2deb26'.\\\",\\n    \\\"type\\\": \\\"invalid_request_error\\\",\\n    \\\"param\\\": \\\"input\\\",\\n    \\\"code\\\": null\\n  }\\n}\"}}}\n```","additionalInfo":{},"buttons":[],"planChoices":[]},"isExpected":true}

Using:

Version: 2.2.43
VSCode Version: 1.105.1
Commit: 32cfbe848b35d9eb320980195985450f244b3030
Date: 2025-12-19T06:06:44.644Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 25.2.0

@deanrie
Issues was fixed for some time but started breaking again after update:

Request Details:

Request ID: 8cacd6cf-e645-463d-a1f9-cf97f49514ba
ConnectError: [unavailable] getaddrinfo ENOTFOUND agentn.api5.cursor.sh
    at oou.$streamAiConnect (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:12706:472564)
    at async vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:566:27936
    at async Object.next (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:10366:5535)
    at async Object.run (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:10378:11111)
    at async o (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:9113:1269)
    at async Promise.allSettled (index 0)
    at async Sro.run (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:9113:6519)

Current Build:

Version: 2.3.29
VSCode Version: 1.105.1
Commit: 4ca9b38c6c97d4243bf0c61e51426667cb964bd0
Date: 2026-01-08T00:34:49.798Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 25.2.0

Hey @Anand_Kamble

This should be fixed now. Let us know if it isn’t.

1 Like

Thank you! Looks like it’s working again.

I understand how frustrating random errors are, especially when they disrupt your workflow. Since this issue is intermittent and you are using your own key, my first thought is that you are hitting a Request Per Minute (RPM) rate limit on the OpenAI side, even if you have sufficient credits. I suggest checking your OpenAI account dashboard to see if specific 429 errors (rate limit) are being logged when the Cursor Agent fails. If the issue persists, I would try regenerating the API key entirely, just in case of a token validation error.

Hope this helps!

1 Like

@Colin @deanrie

Request ID: 26ca38a2-8aaa-486f-b610-c3798993b13f
{"error":"ERROR_OPENAI","details":{"title":"Unable to reach the model provider","detail":"We encountered an issue when using your API key: [unavailable] Error\n\nAPI Error:\n\n```\nModel temporarily unavailable due to unsupported Responses API event.\n```","additionalInfo":{},"buttons":[],"planChoices":[]},"isExpected":true}

Facing the issues when using the Browser tab.

Using:

Version: 2.3.34
VSCode Version: 1.105.1
Commit: 643ba67cd252e2888e296dd0cf34a0c5d7625b90
Date: 2026-01-10T21:17:10.428Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 25.2.0

Hey @Anand_Kamble!

Sorry about this one! Looking into it we had a burst of errors last night that are resolved now. Let us know if the issue persists.

Thanks @Colin for the update.
Since I started working today, haven’t faced the same issue.
Will post here again if I see anything.

1 Like