It's a communication error between Cursor and the Openai compatible provider

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I’m trying to use a custom openai compatible provider.
This looks like a bug in how Cursor is constructing the request to send to the AI provider

The error is saying that the API request being sent is malformed. Specifically:

  1. Missing messages array: The request is supposed to include a messages field (the conversation history to send to the AI), but it’s undefined - it’s not being included at all.

  2. 18 broken tool definitions: All the tools being sent have issues:

    • They’re missing a required function object
    • The type field has invalid values (showing “function” or “custom” when the API only accepts “web_search” or “web_search_preview”)

Steps to Reproduce

Setup OpenAi apikey with a custom base url.

Operating System

MacOS

Version Information

Version: 3.1.17
VSCode Version: 1.105.1
Commit: fce1e9ab7844f9ea35793da01e634aa7e50bce90
Date: 2026-04-19T19:33:58.189Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.3.0

For AI issues: which model did you use?

GPT 5.4

For AI issues: add Request ID with privacy disabled

Request ID: 4012efee-db83-494c-a919-bbffed5aff25

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, this is a known BYOK bug when a custom base URL is set. In this case, the backend builds the payload in the Responses API format (input plus the flat tools format), but sends it to /v1/chat/completions, which expects the Chat Completions format (messages plus {type: "function", function: {...}}). The provider correctly rejects the request with a 400.

It’s tracked here, with details: Cursor Agent sends Responses API format to /chat/completions endpoint

This is on our side. I can’t share an ETA for the fix yet. We’ll post an update in the canonical thread as soon as I have one.

A post was merged into an existing topic: Cursor Agent sends Responses API format to /chat/completions endpoint