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