Gemini API empty response with finishReason MAX_TOKENS: thinking tokens and fixes
AI-generated summary Google documentation explains that Gemini API calls can return an empty response with a finish reason of MAX_TOKENS when the model exhausts its output budget on hidden reasoning tokens before writing an answer. Developers can resolve the issue by raising the maxOutputTokens limit or by lowering the thinking level on models such as Gemini 4, Gemini 3, and Gemini 2.5.