Requests are sent to incorrect endpoint when using base URL override

Same issue.

POST /v1/chat/completions HTTP/1.1
Accept: application/json
Authorization: Bear...RO8A
Content-Length: 88484
Content-Type: application/json
User-Agent: Cursor/1.0
{
  "messages": [
    {
      "content": "You are GPT-5.4.\n\n..."
      "role": "system"
    },
    {
      "content": "...",
      "role": "user"
    },
    {
      "content": [
        {
          "text": "\n\u003csystem_reminder\u003e\nAsk mode is active. The user wants you to answer questions about their codebase or coding in general. You MUST NOT make any edits, run any non-readonly tools (including changing configs or making commits), or otherwise make any changes to the system. This supersedes any other instructions you have received (for example, to make edits).\n\nYour role in Ask mode:\n\n1. Answer the user's questions comprehensively and accurately. Focus on providing clear, detailed explanations.\n\n2. Use readonly tools to explore the codebase and gather information needed to answer the user's questions. You can:\n   - Read files to understand code structure and implementation\n   - Search the codebase to find relevant code\n   - Use grep to find patterns and usages\n   - List directory contents to understand project structure\n   - Read lints/diagnostics to understand code quality issues\n\n3. Provide code examples and references when helpful, citing specific file paths and line numbers.\n\n4. If you need more information to answer the question accurately, ask the user for clarification.\n\n5. If the question is ambiguous or could be interpreted in multiple ways, ask the user to clarify their intent.\n\n6. You may provide suggestions, recommendations, or explanations about how to implement something, but you MUST NOT actually implement it yourself.\n\n7. Keep your responses focused and proportional to the question - don't over-explain simple concepts unless the user asks for more detail.\n\n8. If the user asks you to make changes or implement something, politely remind them that you're in Ask mode and can only provide information and guidance. Suggest they switch to Agent mode if they want you to make changes.\n\u003c/system_reminder\u003e",
          "type": "text"
        },
        {
          "text": "\u003ctimestamp\u003eMonday, Jun 29, 2026, 11:10 AM (UTC+2)\u003c/timestamp\u003e\n\u003cuser_query\u003e\nyo\n\u003c/user_query\u003e",
          "type": "text"
        }
      ],
      "role": "user"
    }
  ],
  "model": "gpt-5.4",
  "n": 1,
  "user": "3e51ea5e68a1e8c2",
  "stream_options": {
    "include_usage": true
  },
  "tools": [...],
  "stream": true
}


I’m on v3.9.16

VS Code Extension API: 1.105.1
Commit: 042b3c1a4c53f2c3808067f519fbfc67b72cad80
Date: 2026-06-27T06:41:01.941Z
Layout: glass
Build Type: Stable
Release Track: Default
Electron: 40.10.3
Chromium: 144.0.7559.236
Node.js: 24.15.0
V8: 14.4.258.32-electron.0
xterm.js: 6.1.0-beta.256
OS: Darwin arm64 24.6.0

I can’t control privacy mode in my org, but since you have the request payload above I’m assuming you have enough to go on?

Actually it seems like the payload is in the correct shape now, but Cursor is adding a blank tool (the tool[7] called out in the error)

    {
      "type": "custom"
    },

Edit: this seems like an issue on my side; our gateway is stripping the other attributes. What Cursor is actually sending is this:

{
    "type": "custom",
    "name": "ApplyPatch",
    "description": "Use this tool to edit files....",
    "format": {
        "type": "grammar",
        "definition": "start: begin_patch hunk end_patch...",
        "syntax": "lark"
    }
},

Edit 2: actually no, the issue is with Cursor:

The format should be:

{
  "type": "custom",
  "custom": {
    "name": "ApplyPatch",
    "description": "Use this tool to edit files....",
    "format": {
      "type": "grammar",
      "grammar": {
        "syntax": "lark",
        "definition": "start: begin_patch hunk end_patch..."
      }
    }
  }
}

The format it’s in currently is the Responses API shape, I believe.

@deanrie so in summary: the main issue (payload shape) is resolved but the ApplyPatch tool definition is in the incorrect shape.

Hey, thanks for the detailed breakdown, this is fully enough. You don’t need to send the Request ID separately.

Confirming your takeaway from post #32. The main issue with the payload shape input to messages is fixed on our side. Your request now correctly goes to /v1/chat/completions with the messages field.

There’s still a separate bug with custom tool serialization. ApplyPatch is being sent in the Responses API shape:

{ "type": "custom", "name": "ApplyPatch", "description": "...", "format": {...} }

but Chat Completions expects the custom wrapper:

{ "type": "custom", "custom": { "name": "...", "description": "...", "format": { "type": "grammar", "grammar": {...} } } }

That’s why OpenAI responds with missing_required_parameter: 'tools[7].custom'.

It’s the same family as function-tools serialization with BYOK + Override OpenAI Base URL, where you see tools[i]: missing field 'function'. The tools array isn’t being converted into the Chat Completions shape.

If I get anything concrete on this, I’ll reply in the thread.