Empty Output but finish_reason Is MAX_TOKENS on Gemini 2.5/3: Cause and Fix
Your prompt is just a few lines, yet a low maxOutputTokens on gemini-2.5-flash returns empty text with finish_reason MAX_TOKENS. The culprit is thinking tokens. Here are three fixes with working code.
Preserving Gemini 3 Thought Signatures So Multi-Turn Function Calling Doesn't Degrade
When you build function calling on Gemini 3 thinking models, reasoning quality often drops from the second turn onward. The cause is usually a dropped thought signature. Here is how to keep it and verify the effect.
Why Gemini 2.5 Pro Rejects thinkingBudget: 0 (and How to Fix It)
Setting thinkingBudget to 0 on Gemini 2.5 Pro returns a 400 INVALID_ARGUMENT error. Here is why the per-model thinking budget ranges differ, how to minimize thinking on Pro the right way, and when to switch to Flash, with Python and JavaScript examples.
Gemini 2.5 Pro in Production: The Pitfalls Nobody Talks About
A practical guide to the production-specific problems with Gemini 2.5 Pro—rate limit architecture, Thinking mode cost control, long-context quality management, and response quality diagnostics—with complete code examples.
When Gemini API Output Seems Wrong: 7 Common Causes and a Diagnostic Checklist
When Gemini API returns unexpected output — empty responses, wrong language, broken JSON, or Thinking content leaking into answers — here are 7 common causes with a practical diagnostic checklist and code examples.
Fixing 'Thoughts must be present in conversation history' in Gemini API: Thought Signatures in Multi-Turn Tool Calls
If you're hitting 'Thoughts must be present in conversation history when using thinking signature' in Gemini 2.5/3.x with multi-turn function calling, this guide walks through what's actually happening and how to fix it in five minutes — Python SDK, REST, and streaming all covered.
Rendering Gemini's Thought Summaries in a Next.js UI — A Production Pattern for Explainable AI
A production walkthrough for surfacing Gemini 2.5 / 3 thought summaries in a Next.js UI. Covers the SDK configuration, Server-Sent Events, a React collapsible component, observability, and the UX judgement calls you face when you decide how much of the AI's reasoning to show.
Gemini Thinking Mode Is Slow or Not Responding: How to Fix It
Gemini 2.5 Pro or Flash Thinking mode too slow, freezing, or timing out? Learn the most common causes and practical fixes—including timeout configuration, streaming setup, and thinking_budget tuning.
Gemini 2.5 Flash Thinking — Integrating Thought Traces and Advanced Reasoning into Production Systems
A complete guide to using Gemini 2.5 Flash Thinking's thought trace API in production. Covers thinking budget control, streaming thought display, multi-turn reasoning chains, cost optimization, and robust fallback strategies.