400 Error with Gemini 3 Pro *via OpenRouter* when calling tools
Before submitting your bug report
- [x] I've tried using the "Ask AI" feature on the Continue docs site to see if the docs have an answer
- [x] I'm not able to find a related conversation on GitHub discussions that reports the same bug
- [x] I'm not able to find an open issue that reports the same bug
- [x] I've seen the troubleshooting guide on the Continue Docs
Relevant environment info
- OS: macOS 26.1
- Continue version: 1.3.24 (pre-release)
- IDE version: VSCode 1.106.3
- Model: google/gemini-3-pro-preview **via OpenRouter** (important)
- config:
name: Local Config
version: 1.0.0
schema: v1
models:
- name: Gemini 3 Pro Preview
model: google/gemini-3-pro-preview
apiKey: ${{ secrets.OPENROUTER_API_KEY }}
roles:
- chat
- edit
capabilities:
- tool_use
- image_input
defaultCompletionOptions:
contextLength: 1048576
provider: openrouter
Description
Related (but not identical) issues: #8785
I read the patch in #8865 which fixes the thought_signature issue for Gemini 3 Pro, but it seems to only apply to direct connections to Gemini API.
Users who connect to Gemini via OpenRouter, which uses OpenAI-compatible API, seem not covered by that fix.
To reproduce
- Get an OpenRouter API key. (Contact me if you are unable to.)
- Open the Continue chat in VSCode.
- Type a prompt that involves a tool call. (e.g., “List the files in this directory.”)
Log output
DevTools log:
[Extension Host] [@continuedev] error: 400 Provider returned error {"context":"llm_stream_chat","model":"google/gemini-3-pro-preview","provider":"openrouter","useOpenAIAdapter":true,"streamEnabled":true,"templateMessages":false}
[Extension Host] Error: 400 Provider returned error
at APIError.generate (/Users/brilliant/.vscode/extensions/continue.continue-1.3.24-darwin-arm64/out/extension.js:151942:18)
at OpenAI.makeStatusError (/Users/brilliant/.vscode/extensions/continue.continue-1.3.24-darwin-arm64/out/extension.js:158839:25)
at OpenAI.makeRequest (/Users/brilliant/.vscode/extensions/continue.continue-1.3.24-darwin-arm64/out/extension.js:158997:29)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async OpenRouterApi.chatCompletionStream (/Users/brilliant/.vscode/extensions/continue.continue-1.3.24-darwin-arm64/out/extension.js:159893:26)
at async OpenRouter.openAIAdapterStream (/Users/brilliant/.vscode/extensions/continue.continue-1.3.24-darwin-arm64/out/extension.js:245129:26)
at async OpenRouter.streamChat (/Users/brilliant/.vscode/extensions/continue.continue-1.3.24-darwin-arm64/out/extension.js:245250:32)
at async llmStreamChat (/Users/brilliant/.vscode/extensions/continue.continue-1.3.24-darwin-arm64/out/extension.js:724132:19)
at async Wd.handleMessage [as value] (/Users/brilliant/.vscode/extensions/continue.continue-1.3.24-darwin-arm64/out/extension.js:762419:29)
Continue Console:
Request 1
Type: Chat
Result: Success
Prompt Tokens: 149
Generated Tokens: 10
ThinkingTokens: 60
Total Time: 3.04s
To First Token: 3.02s
Tokens/s: 3500.0
thinking
**Exploring the Directory Structure**
I've begun listing files in the current directory. My intention is to map out the project's layout, and establish a foundational understanding. The goal is to see how everything is organized, and what key components are present, with the ultimate objective of efficient future progress.
assistant
Tool call: {
"id": "tool_ls_porgeuX63RpoFuvSPVsU",
"type": "function",
"function": {
"name": "ls",
"arguments": "{\"dirPath\":\".\"}"
}
}
Request 2
Type: Chat
Result: Error
Prompt Tokens: 268
Generated Tokens: 0
ThinkingTokens: 0
Total Time: 0.34s
Error 400 Provider returned error
Related issues:
- #8785 - Gemini 3 Pro "Function call is missing a thought_signature in functionCall parts" (fixed by #8865 for direct Gemini API connections)
- #8773 - No tool call found for function call output with call_id (similar error message to this issue)
- #6483 - Use builtin_create_rule_block tool with google models return 400 error (OpenRouter with Google models)
- #6121 - Gemini models in agent mode giving error 400 invalid argument (OpenRouter with Gemini models)
- #3378 - OpenRouter chat doesn't work with some providers/models (general OpenRouter tool support issue)
The fix in #8865 added thought_signature support for Gemini, but only applies to the native Gemini provider. This issue appears to be the same root cause but affects users connecting to Gemini via OpenRouter's OpenAI-compatible API.
Facing the same issue.
Try to use non-stream mode ("stream": false) via OpenRouter. The delta object in SSE implementation of OpenRouter is ambiguous.
I face the same issue
Try to use non-stream mode (
"stream": false) via OpenRouter. The delta object in SSE implementation of OpenRouter is ambiguous.
in my case, this does not solve the 400 Error.
are there any solutions to this problem? having the same issue
Thank you for your information. However, I want to respond that:
OpenRouter forwards the OpenAI-style function declaration format but Gemini expects its own format
I believe OpenRouter does convert the schema. Otherwise we won’t be able to use Claude models. However, per its privacy policy, it can’t help us copy the thought_signature from the previous request because it doesn’t remember our previous requests.
It's an OpenRouter-Gemini interop problem, not a Continue.dev bug.
Kilo Code does not observe this issue when calling Gemini 3 through OpenRouter. We just need to make sure the thought_signature needs to be preserved between calls.
Komilion normalizes tool call schemas per-model internally
I wish to have a local program for schema conversion instead of reading one more privacy policy. I believe this is the same reason why people use Continue.dev instead of VS Code’s built-in Copilot.
This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue.
This issue was closed because it wasn't updated for 10 days after being marked stale. If it's still important, please reopen + comment and we'll gladly take another look!