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
str
default:"UNSET"
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’.
str
default:"UNSET"
Prebuilt voice name, e.g. “Kore”, “Puck”, “Charon” or “Zephyr”. Defaults to ‘Kore’.
str | None
default:"UNSET"
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
float
default:"UNSET"
Speaking rate multiplier, 0.25 to 4.0, where 1.0 is normal speed. Defaults to 1.0.
float
default:"UNSET"
Pitch shift in semitones, -20.0 to 20.0. Not supported by Chirp 3 HD or Gemini voices. Defaults to 0.0.
Literal['pcm']
default:"UNSET"
Audio encoding of the synthesized speech; only “pcm” is supported. Defaults to ‘pcm’.
Mapping[str, Any] | None
default:"UNSET"
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).
list[dict] | dict | None
default:"UNSET"
IPA pronunciation overrides for specific words, e.g. [{“tomato”: “tə’meɪtoʊ”}]. Defaults to None (not set).
bool
default:"UNSET"
Set to True to synthesize through the Vertex AI endpoint using your gcloud application credentials (ADC). Defaults to False.
Mapping[str, Any] | None
default:"UNSET"
Vertex AI settings such as {“project”: “my-project”, “location”: “us-central1”}. Only used when vertexai is True. Defaults to None (not set).
bool
default:"UNSET"
Whether to stream audio as it is synthesized for lower latency, instead of waiting for the whole utterance. Defaults to True.
str | None
default:"UNSET"
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).
str | None
default:"UNSET"
Natural-language style instruction, e.g. “Speak in a warm, professional tone”. Only works with a Gemini TTS model. Defaults to None (not set).