Please fix OpenAI API Key Support, (critical error)

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Hello, OpenAI API Key in cursor doesnt work right now, when you ask any OpenAI model after providing your own working API Key it outputs:

Request failed with status code 400: {
“error”: {
“message”: “Item ‘xxxxxxxxxxxx’ of type ‘reasoning’ was provided without its required following item.”,
“type”: “invalid_request_error”,
“param”: “input”,
“code”: null
}
}

Steps to Reproduce

Set OpenAI API key and chat with any OpenAI reasoning model like GPT 5.1 Codex

Expected Behavior

The OpenAI models should work properly after provoding the correct api key.

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.1.26
VSCode Version: 1.105.1
Commit: f628a4761be40b8869ca61a6189cafd14756dff0
Date: 2025-11-24T05:39:06.655Z
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.0.0

Does this stop you from using Cursor

Yes - Cursor is unusable

you need to do some file changes as regular chat works

Hey, thanks for the report. The error “Item of type ‘reasoning’ was provided without its required following item” suggests that Cursor might be sending an invalid payload format to OpenAI’s reasoning models.

To help us look into this, please share:

  1. Request ID: chat menu → Copy Request ID
  2. The exact model name you’re using from the model dropdown
  3. Where this happens: Ask, Agent, or Inline Edit (CMD+K)?
  4. Your OpenAI API key setup: Settings → Models → OpenAI API Key section - any custom configuration there?
  5. You also mentioned that “regular chat works” - does this mean Chat (CMD+L) works but Agent mode doesn’t, or did you mean something else?

Hi, not original author but getting same error. My request ID is ad746c8f-c3a8-4f41-b1ab-4f66036d947b.

Not using anything specific other than custom openAI key. Using the Agent mode with postgres MCP. Happens with GPT-5.1, GPT-5.1 High, gpt-5-high-fast (custom added). Max and non max modes.

My version is 2.1.49 (arm64 mac) and seems like it happens more in that version than in 2.0.XX versions.

Sometimes quitting cursor and reopening helps.