Streaming buys you time-to-first-token
Time-to-first-token (TTFT) on Gemini 2.5 Flash is typically 200–400ms. Time-to-last-token on a 500-word reply is 3–8 seconds. Streaming doesn't make the model faster — it makes the user's wait visible progress instead of a blank screen.
The product cost of skipping streaming is the difference between "this app is slow" and "this app is alive." Same total time. Different perception.
Server-Sent Events — the wire format
Gemini's streaming endpoint speaks Server-Sent Events (SSE). Each event is a line that starts with data:, followed by a complete JSON object — the same shape as a non-streaming response, but with only a slice of text in the parts array.
Two endpoint variants
Same URL, different query string:
/streamGenerateContent(no?alt=sse) — returns a buffered JSON array. Useful when you want streaming chunks but don't want to parse SSE./streamGenerateContent?alt=sse— returns SSE. Useful when you want to forward the stream to a browser, or you're parsing line-by-line.
The final chunk carries usageMetadata
Token counts only show up on the last chunk of the stream. If you want to bill or log the call, accumulate text across all chunks and grab usageMetadata off whichever chunk has it.