@haram
Many users have recently encountered 400 Bad Request errors during multi-turn tool calling when migrating from Gemini 2.5 to the Gemini 3.0 or 3.5 model series. If you check the error message, you will likely see a phrase saying 'missing a thought_signature'. Starting with Gemini 3.x, a strict rule is applied where the 'Thought Signature'—an encrypted representation of the model's reasoning flow—must be passed back exactly as is in the next turn's request. If the developer does not manage this state, the API server will immediately return an error.
The easiest way to resolve this is to utilize the 'Interactions API' officially released by Google. Unlike the existing Chat API or standard text completion API, the Interactions API automatically preserves multi-turn history and state on the server side. Since it handles Thought Signature processing internally based on the previous_interaction_id, developers don't have to worry about the headache. Haha. If you are forced to manipulate history manually using the old method, you must extract this signature value from the previous response object and include it exactly as-is in your next turn's request array.
One more thing to be careful about: if you leave the thinking_budget option used in Gemini 2.5 while using the new thinking_level in your 3.5 configuration, you will get another 400 error due to setting conflicts. From version 3.x onwards, you must remove the old options and use only thinking_level. There have also been reports of minor SDK bugs where Gemini 3.5 Flash sometimes returns empty responses when reasoning is enabled; as a temporary workaround, you can clear the signature in the history array to resolve it, so please keep this in mind when developing~