Skip to main content
Gemini 3.8 Flash-Lite TTS prioritizes lower latency and high-throughput speech generation. Google lists support for 101 languages. Gemini 3.8 Flash-Lite TTS accepts text and returns audio. Provider limits are 8,192 input tokens and 16,384 output tokens; effective limits and availability depend on the MixRoute route. The examples use the existing native generateContent path, not an assumed Interactions or OpenAI audio endpoint.

Request parameters

Write only the words to speak in parts[].text. Put delivery instructions in parts[].speechMetadata.style; do not prepend commands such as Say cheerfully, which can be spoken aloud. SDK/documentation may name this field speech_metadata; REST JSON uses speechMetadata. Unary Gemini 3.8 output defaults to WAV, unlike the older raw-PCM default.

Request examples

Set the MIXROUTE_API_KEY environment variable. The Python example uses only the standard library.

Read the audio output

Read candidates[].content.parts[].inlineData.data and mimeType. Base64-decode WAV data and write it directly; do not add another WAV header. The Python example rejects missing audio or non-WAV data rather than silently writing an invalid WAV file. Custom voice, streaming and other provider capabilities need separate route support.