[Bug] Agent Chat fails with "Missing required parameter: 'tools[6].custom'" when using custom OpenAI API Key and base URL override

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

The bug occurs when you configure Cursor with a custom OpenAI base URL and use the Agent Chat feature (such as Plan Mode). When Cursor attempts to send a request to any OpenAI model, it throws a 400 Bad Request error from the model provider.

The chat request immediately fails, returning a Status 400 response from the provider indicating a malformed tools array.

Provider returned error: { 
  "error": { 
    "message": "Missing required parameter: 'tools[6].custom'.", 
    "type": "invalid_request_error", 
    "param": "tools[6].custom", 
    "code": "missing_required_parameter" 
  } 
}

Steps to Reproduce

1.	Open Cursor Settings.
2.	Configure a custom OpenAI API key.
3.	Override the base URL to point to a custom AI gateway (Note: The bug also occurs even if overriding with the standard OpenAI base URL [https://api.openai.com/](https://api.openai.com/)).
4.	Open the Chat sidebar and attempt to chat with the Cursor agent.

Expected Behavior

The Cursor agent should successfully process the prompt and return a response via the custom API key and the provided base URL without any parameter validation errors.

Operating System

MacOS

Version Information

Versió: 3.15.6
Commit: 1.128.0
Data: a1f686545fd0ce8917bbd2449f733551a9bce420
Electron: 2026-08-06T01:41:03.876Z
ElectronBuildId: IDE
Chromium: Stable
Node.js: Default
V8: 40.10.3
OS: 144.0.7559.236

For AI issues: which model did you use?

gpt-5.6-luna, gpt-5-mini, gpt-5.6-sol, etc. Any OpenAI model

Additional Information

Because the request payload fails provider-side validation regarding the tools array structure (specifically tools[6].custom), it appears Cursor is sending an internal/custom tool schema that standard OpenAI API gateways (or the official OpenAI API endpoint itself) do not recognize as a valid OpenAI tool definition.

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey there,

This isn’t your config. With an OpenAI API key + Base URL override, Agent requests for GPT/OpenAI models can fail provider validation on the tools payload (tools[N].custom). We’re tracking it.

Workaround: under Cursor Settings > Models, clear the OpenAI API key and Base URL override when you want Cursor-hosted GPT (or use Claude / Gemini / Auto). Same reports: Bedrock Mantle, custom base URL.

I’ll post here when there’s an update.

I am encountering the same issue and cannot use any OpenAI models via LiteLLM. Would appreciate a fix.