Can't use gemini-3-pro-preview from Openrouter
I get the error bellow when I try to use gemini-3-pro-preview from Openrouter. Is there any work around?
API Error: 400 {"error":{"message":"Error from provider(openrouter,google/gemini-3-pro-preview: 400): {"error":{"message":"Provider returned
error","code":400,"metadata":{"raw":"Gemini models require OpenRouter reasoning details to be preserved in each request. Please refer to our docs:
https://openrouter.ai/docs/use-cases/reasoning-tokens#preserving-reasoning-blocks. Upstream error: {\n \"error\": {\n \"code\": 400,\n \"message\": \"Function
call is missing a thought_signature in functionCall parts. This is required for tools to work correctly, and missing thought_signature may lead to degraded model performance.
Additional data, function call default_api:TodoWrite , position 2. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.\",\n
\"status\": \"INVALID_ARGUMENT\"\n }\n}\n","provider_name":"Google AI Studio"}},"user_id":"user_2dOv1J5wtMvwXLCnuCxFMLblqu5"}Error: Error from
provider(openrouter,google/gemini-3-pro-preview: 400): {"error":{"message":"Provider returned error","code":400,"metadata":{"raw":"Gemini models require OpenRouter
reasoning details to be preserved in each request. Please refer to our docs: https://openrouter.ai/docs/use-cases/reasoning-tokens#preserving-reasoning-blocks. Upstream error: {\n
\"error\": {\n \"code\": 400,\n \"message\": \"Function call is missing a thought_signature in functionCall parts. This is required for tools to work correctly,
and missing thought_signature may lead to degraded model performance. Additional data, function call default_api:TodoWrite , position 2. Please refer to
https://ai.google.dev/gemini-api/docs/thought-signatures for more details.\",\n \"status\": \"INVALID_ARGUMENT\"\n }\n}\n","provider_name":"Google AI
Studio"}},"user_id":"user_2dOv1J5wtMvwXLCnuCxFMLblqu5"}\n at nt (/opt/homebrew/lib/node_modules/@musistudio/claude-code-router/dist/cli.js:79940:11)\n at p0
(/opt/homebrew/lib/node_modules/@musistudio/claude-code-router/dist/cli.js:80000:11)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async
f0 (/opt/homebrew/lib/node_modules/@musistudio/claude-code-router/dist/cli.js:79965:96)","type":"api_error","code":"provider_response_error"}}
having the same issue
Tried in both mac os and windows
same issue
same issue
+1
same issue
same issue
same
I dug a lil deeper guys, it seems like an openrouter issue
I dug a lil deeper guys, it seems like an openrouter issue
Thank you very much for checking. So It should be fix from OpenRouter end?
yeah most likely
The same issue is present in opencode as well when using it with the openrouter google endpoint
Opencode team said they reached out to openrouter team and reported they will be fixing soon
So my guess would be 1-2 days max, if they wont fix it ill make a new router and try to find a workaround :)
gemini-3-pro-preview is work now
gemini-3-pro-preview is work now
can you please share your config.json?
Same issue still happening after 1.0.71 release
API Error: 400 {"error":{"message":"Error from provider(openrouter,google/gemini-3-pro-preview: 400): {\"error\":{\"message\":\"Provider returned
error\",\"code\":400,\"metadata\":{\"raw\":\"Gemini models require OpenRouter reasoning details to be preserved in each request. Please refer to our docs:
https://openrouter.ai/docs/use-cases/reasoning-tokens#preserving-reasoning-blocks. Upstream error: {\\n \\\"error\\\": {\\n \\\"code\\\": 400,\\n \\\"message\\\":
\\\"Unable to submit request because function call `default_api:TodoWrite` in the 4. content block is missing a `thought_signature`. Learn more:
https://docs.cloud.google.com/vertex-ai/generative-ai/docs/thought-signatures\\\",\\n \\\"status\\\": \\\"INVALID_ARGUMENT\\\"\\n
}\\n}\\n\",\"provider_name\":\"Google\"}},\"user_id\":\"user_xxxxxxxxxxxx\"}Error: Error from provider(openrouter,google/gemini-3-pro-preview: 400):
{\"error\":{\"message\":\"Provider returned error\",\"code\":400,\"metadata\":{\"raw\":\"Gemini models require OpenRouter reasoning details to be preserved in each request.
Please refer to our docs: https://openrouter.ai/docs/use-cases/reasoning-tokens#preserving-reasoning-blocks. Upstream error: {\\n \\\"error\\\": {\\n \\\"code\\\": 400,\\n
\\\"message\\\": \\\"Unable to submit request because function call `default_api:TodoWrite` in the 4. content block is missing a `thought_signature`. Learn more:
https://docs.cloud.google.com/vertex-ai/generative-ai/docs/thought-signatures\\\",\\n \\\"status\\\": \\\"INVALID_ARGUMENT\\\"\\n
}\\n}\\n\",\"provider_name\":\"Google\"}},\"user_id\":\"user_xxxxxxxxxxxx\"}\n at nt
(/opt/homebrew/lib/node_modules/@musistudio/claude-code-router/dist/cli.js:79940:11)\n at p0
(/opt/homebrew/lib/node_modules/@musistudio/claude-code-router/dist/cli.js:80000:11)\n at process.processTicksAndRejections (node:internal/process/task_queues:103:5)\n
at async f0 (/opt/homebrew/lib/node_modules/@musistudio/claude-code-router/dist/cli.js:79965:96)","type":"api_error","code":"provider_response_error"}}
Config
{
"LOG": false,
"Providers": [
{
"name": "openrouter",
"api_base_url": "https://openrouter.ai/api/v1/chat/completions",
"api_key": "sk-or-v1-xxxxxxxxxxxxxxx",
"models": ["google/gemini-3-pro-preview"],
"transformer": { "use": ["openrouter"] }
}
],
"Router": {
"default": "openrouter,google/gemini-3-pro-preview",
"background": "openrouter,google/gemini-3-pro-preview",
"think": "openrouter,google/gemini-3-pro-preview",
"longContext": "openrouter,google/gemini-3-pro-preview",
"webSearch": "openrouter,google/gemini-3-pro-preview:online"
}
}
It’s still not working. Is there any further updates?
I dont think gemini 3 support will roll out soon guys but there is another router called "claudish" that supports gemini 3 if you guys want to check it out :)
+1
the fix is to cache gemini reasoning in a file and inject it in the tool calls in the next request i created a fastapi server for that because i don't need the full cli wrapper, you can see how i did it and do the same https://github.com/Mng-dev-ai/anthropic-bridge/blob/main/anthropic_bridge/client.py#L94