Gemini-3.1-pro throws Invalid JSON

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

For gemini-3.1-pro used either via key in Gemini Studio or via OpenRouter I’m getting this error:

Request ID: 50057731-32cf-4464-83b5-00750d8d8150
{“error”:“ERROR_PROVIDER_ERROR”,“details”:{“title”:“Provider Error”,“detail”:“Provider returned error: [{\n "error": {\n "code": 400,\n "message": "Invalid JSON (for ‘extra_body’): no such field: ‘disable_thought_tag’",\n "status": "INVALID_ARGUMENT"\n }\n}\n]”,“isRetryable”:false,“additionalInfo”:{},“buttons”:,“planChoices”:},“isExpected”:true}
Provider Error Provider returned error: [{
“error”: {
“code”: 400,
“message”: “Invalid JSON (for ‘extra_body’): no such field: ‘disable_thought_tag’”,
“status”: “INVALID_ARGUMENT”
}
}
]
Cvs: Provider Error Provider returned error: [{
“error”: {
“code”: 400,
“message”: “Invalid JSON (for ‘extra_body’): no such field: ‘disable_thought_tag’”,
“status”: “INVALID_ARGUMENT”
}
}
]
at Pf_ (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:29432:24260)
at Rf_ (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:29432:23144)
at Uf_ (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:29433:6490)
at q0h.run (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:29433:11307)
at async cQi.runAgentLoop (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:41748:12418)
at async Vnm.streamFromAgentBackend (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:41816:12344)
at async Vnm.getAgentStreamResponse (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:41816:19567)
at async lCt.submitChatMaybeAbortCurrent (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:29548:16906)
at async Object.Va [as onSubmit] (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:40804:4230)
at async vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:40803:100980


Request ID: ca9af5d5-59e9-40ce-abb2-4adbac824e4e
{“error”:“ERROR_PROVIDER_ERROR”,“details”:{“title”:“Provider Error”,“detail”:“Provider returned error: [{\n "error": {\n "code": 400,\n "message": "Invalid JSON (for ‘extra_body’): no such field: ‘disable_thought_tag’",\n "status": "INVALID_ARGUMENT"\n }\n}\n]”,“isRetryable”:false,“additionalInfo”:{},“buttons”:,“planChoices”:},“isExpected”:true}
Provider Error Provider returned error: [{
“error”: {
“code”: 400,
“message”: “Invalid JSON (for ‘extra_body’): no such field: ‘disable_thought_tag’”,
“status”: “INVALID_ARGUMENT”
}
}
]
Cvs: Provider Error Provider returned error: [{
“error”: {
“code”: 400,
“message”: “Invalid JSON (for ‘extra_body’): no such field: ‘disable_thought_tag’”,
“status”: “INVALID_ARGUMENT”
}
}
]
at Pf_ (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:29432:24260)
at Rf_ (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:29432:23144)
at Uf_ (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:29433:6490)
at q0h.run (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:29433:11307)
at async cQi.runAgentLoop (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:41748:12418)
at async Vnm.streamFromAgentBackend (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:41816:12344)
at async Vnm.getAgentStreamResponse (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:41816:19567)
at async lCt.submitChatMaybeAbortCurrent (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:29548:16906)
at async Object.Va [as onSubmit] (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:40804:4230)
at async vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:40803:101457


Request ID: 2beffe36-7979-488b-8d56-430aefa0af4e
{“error”:“ERROR_PROVIDER_ERROR”,“details”:{“title”:“Provider Error”,“detail”:“Provider returned error: [{\n "error": {\n "code": 400,\n "message": "Invalid JSON (for ‘extra_body’): no such field: ‘disable_thought_tag’",\n "status": "INVALID_ARGUMENT"\n }\n}\n]”,“isRetryable”:false,“additionalInfo”:{},“buttons”:,“planChoices”:},“isExpected”:true}
Provider Error Provider returned error: [{
“error”: {
“code”: 400,
“message”: “Invalid JSON (for ‘extra_body’): no such field: ‘disable_thought_tag’”,
“status”: “INVALID_ARGUMENT”
}
}
]
Cvs: Provider Error Provider returned error: [{
“error”: {
“code”: 400,
“message”: “Invalid JSON (for ‘extra_body’): no such field: ‘disable_thought_tag’”,
“status”: “INVALID_ARGUMENT”
}
}
]
at Pf_ (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:29432:24260)
at Rf_ (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:29432:23144)
at Uf_ (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:29433:6490)
at q0h.run (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:29433:11307)
at async cQi.runAgentLoop (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:41748:12418)
at async Vnm.streamFromAgentBackend (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:41816:12344)
at async Vnm.getAgentStreamResponse (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:41816:19567)
at async lCt.submitChatMaybeAbortCurrent (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:29548:16906)
at async Object.Va [as onSubmit] (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:40804:4230)
at async vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:40803:100980


Steps to Reproduce

Run Cursor with gemini-3.1-pro

Expected Behavior

To work

Operating System

MacOS

Version Information

Version: 3.2.11
VSCode Version: 1.105.1
Commit: e9ee1339915a927dfb2df4a836dd9c8337e17cc0
Date: 2026-04-24T14:36:47.933Z
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.4.0

For AI issues: which model did you use?

gemini-3.1-studio

For AI issues: add Request ID with privacy disabled

Request ID: 3181baa3-d316-402d-a031-0cf7d7a9c263
{“error”:“ERROR_PROVIDER_ERROR”,“details”:{“title”:“Provider Error”,“detail”:“Provider returned error: [{\n "error": {\n "code": 400,\n "message": "Invalid JSON (for ‘extra_body’): no such field: ‘disable_thought_tag’",\n "status": "INVALID_ARGUMENT"\n }\n}\n]”,“isRetryable”:false,“additionalInfo”:{},“buttons”:,“planChoices”:},“isExpected”:true}
Provider Error Provider returned error: [{
“error”: {
“code”: 400,
“message”: “Invalid JSON (for ‘extra_body’): no such field: ‘disable_thought_tag’”,
“status”: “INVALID_ARGUMENT”
}
}
]
Cvs: Provider Error Provider returned error: [{
“error”: {
“code”: 400,
“message”: “Invalid JSON (for ‘extra_body’): no such field: ‘disable_thought_tag’”,
“status”: “INVALID_ARGUMENT”
}
}
]
at Pf_ (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:29432:24260)
at Rf_ (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:29432:23144)
at Uf_ (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:29433:6490)
at q0h.run (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:29433:11307)
at async cQi.runAgentLoop (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:41748:12418)
at async Vnm.streamFromAgentBackend (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:41816:12344)
at async Vnm.getAgentStreamResponse (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:41816:19567)
at async lCt.submitChatMaybeAbortCurrent (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:29548:16906)
at async Object.Va [as onSubmit] (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:40804:4230)
at async vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:40803:100980

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, thanks for the report with details and the Request ID. This is a bug on our side. For BYOK Gemini 3.x via AI Studio and OpenRouter, Cursor is currently sending disable_thought_tag in extra_body. Those providers don’t recognize it and reject the request with a 400. We’re already tracking this issue, but I can’t share an ETA yet.

While we’re fixing it, here are a couple workarounds:

  • Use the built-in Gemini in Cursor without BYOK.
  • If you have access to Vertex AI, connect via a Vertex key. That code path isn’t affected.

Related thread with the same root cause is here: Gemini API key not working in Cursor, getting PROVIDER_ERROR
You can subscribe there and we’ll post updates about the fix. If it gets worse or you see new symptoms, let me know.