Model: gemini-3.8-flash-tts API: Gemini API (AI Studio key), models/gemini-3.8-flash-tts:streamGenerateContent?alt=sse. Also seen on Vertex AI (reached through Vercel AI Gateway), and once on the Interactions API path. Date: 2026-10-12
What we send
● Text: 1,602 characters of English (input.txt). It is an article (A), then a short keynote opening (K), then the same article again (A).
● Voice and style: voice Charon, speechMetadata.style = “calm, warm narration”.
● Request body: request-gemini-api.json.
Expected
One reading of the text, about 106–123 s (12 of 16 runs).
What happens
In 4 of 16 runs (2 on the Gemini API, 2 on Vertex AI) the model does not stop after the text. It keeps alternating A and K:
● The longest run produced 1,207 s of audio: about 10 min 20 s of A/K alternating (10 × A, 9 × K), then about 10 min of silence.
● finishReason is STOP in every case.
● The long run was billed 30,184 audio tokens, against about 2,800 for a normal reading. That is more than the documented 16,384-token output limit.
The other five Gemini API runs were normal (108–121 s): YLjMasu0BtTQz7IP0pySuQ0, gLjMapz1HNGsz7IP3petuQ0, hrjMativLsD4qtsP-KmmiAs, D7nMaqHuBKfOz7IPgI2UmQw, MbnMaoeyIPr0z7IPmPuZwA0.
Through Vertex AI (Vercel AI Gateway), same text, voice and style:
● 2 of 8 runs looped: 186 s (A K A K A) and 208 s.
● A first occurrence at 07:54 UTC ran 340 s: 4 × A K, then a cut-off A K.
Control
Same voice and style, 1,826 characters of text with no repeated paragraph (input-plain.txt): 10 of 10 runs normal, 122–136 s.
Attachments
● runs/direct-5.m4a: 1,207 s.
● runs/direct-4.m4a: 248 s.
● runs/first-vercel-loop.m4a: 340 s, Vertex.
● runs/vercel-6.m4a and runs/vercel-7.m4a: Vertex.
● runs/direct-0.m4a: a normal reading.
● timelines.json: which passage plays when, in each looping run.
drive.google. com/drive/folders/ 1QGnLyN0SLjLshgUvSfOhIqi4qQQuxoQr?usp=drive_link
Questions
1. Can the looping on repeated input be fixed?
2. Is the 16,384-token output limit meant to apply? This run went to 30,184 tokens, with 10 minutes of trailing silence.
3. Are runaway outputs like this billable?
What we do meanwhile
● We set generationConfig.maxOutputTokens to about twice the expected length. The Gemini API honours it and stops with MAX_TOKENS.
● We would rather not need it.
Related, for 2.5 Flash TTS: Gemini-2.5-flash-tts : Repeats text and reads out a section of the prompt
