◈ Gemini API/2026-06-14Intermediate
When Gemini API Cuts Your Response Off Mid-Sentence — Detecting finish_reason: MAX_TOKENS and Stitching the Continuation
Long-form generation that ends mid-sentence is usually finish_reason: MAX_TOKENS. This failure arrives as a quiet HTTP 200, no exception. Here is how to detect it, stitch a continuation to recover the full text, and avoid the thinking-token trap that makes it worse on 3.x models.
◈ Gemini API/2026-06-12Intermediate
Reverse-Engineering Empty Gemini API Responses with finish_reason — Triage, Retry Classification, and Monitoring
An empty response.text has three distinct failure layers — candidates, prompt_feedback, and finish_reason. Production code for detecting thinking-token starvation, classifying what is worth retrying, and monitoring your empty-response rate.
◈ Gemini API/2026-05-03Intermediate
Why Gemini API Returns RECITATION as finish_reason — and How to Fix It
When Gemini API silently truncates responses with finish_reason RECITATION, the request technically succeeds with HTTP 200 — but the output is gone. Here's what actually triggers it and how to recover.