Usage guide
Setup, environment variables, and Python/JavaScript/Go usage examples.
GeminiTTS
Text-to-speech with Gemini TTS models, using your Gemini API key. Expressive voices whose delivery you can steer with a plain-language style instruction. Authenticates with GOOGLE_API_KEY from your environment, or an explicitapi_key.
Fields
Gemini TTS model, e.g. “gemini-3.8-flash-tts”, “gemini-3.8-flash-lite-tts” (fastest) or “gemini-2.5-flash-preview-tts”. Defaults to ‘gemini-3.8-flash-tts’.
Prebuilt voice name, e.g. “Kore”, “Puck”, “Charon” or “Zephyr”. Defaults to ‘Kore’.
Plain-language instruction for how to speak, e.g. “cheerful and friendly” or “calm and slow”. Defaults to None (not set).
GoogleTTS
Text-to-speech with Google Cloud Text-to-Speech, authenticated with a service account or API key. Use Chirp 3 HD voices, or set model to run Gemini TTS models with style prompts. Authenticates with GOOGLE_API_KEY or GOOGLE_APPLICATION_CREDENTIALS from your environment, or an explicitapi_key.
Fields
Speaking rate multiplier, 0.25 to 4.0, where 1.0 is normal speed. Defaults to 1.0.
Pitch shift in semitones, -20.0 to 20.0. Not supported by Chirp 3 HD or Gemini voices. Defaults to 0.0.
Audio encoding of the synthesized speech; only “pcm” is supported. Defaults to ‘pcm’.
Voice selection, e.g. {“languageCode”: “en-US”, “name”: “en-US-Chirp3-HD-Aoede”}. With a Gemini model, name is a Gemini voice such as “Kore”. Defaults to None (not set).
IPA pronunciation overrides for specific words, e.g. [{“tomato”: “tə’meɪtoʊ”}]. Defaults to None (not set).
Set to True to synthesize through the Vertex AI endpoint using your gcloud application credentials (ADC). Defaults to False.
Vertex AI settings such as {“project”: “my-project”, “location”: “us-central1”}. Only used when vertexai is True. Defaults to None (not set).
Whether to stream audio as it is synthesized for lower latency, instead of waiting for the whole utterance. Defaults to True.
Gemini TTS model, e.g. “gemini-2.5-flash-tts” or “gemini-3.1-flash-tts-preview”. Leave unset to use standard Cloud TTS voices such as Chirp 3 HD. Defaults to None (not set).