tts slot.
Setup
Cloud TTS authenticates with either a service account or an API key. Create one in the Google Cloud console and export it in the worker environment:Credential resolution
The plugin chooses one credential when it is constructed, and takes the first that is present:GOOGLE_API_KEYwhen it is unset it will useGOOGLE_APPLICATION_CREDENTIALS.GOOGLE_APPLICATION_CREDENTIALS, when it points at a readable file — used as service-account credentials.
Usage
Import the plugin and pass it to the pipeline’stts slot.
voice_config — there is no separate voice or
language_code argument. Omit it entirely and the plugin uses
en-US-Chirp3-HD-Charon / en-US / MALE.
Streaming
streaming=True (the default) synthesizes over gRPC StreamingSynthesize, which starts
returning audio while the LLM is still producing text. Without a Gemini-TTS model, that path
only accepts Chirp 3 HD voices; any other voice raises ValueError from the constructor.
For a Neural2, Studio, WaveNet, or Standard voice, turn streaming off and the plugin falls back
to per-segment SynthesizeSpeech requests:
pitch is only sent on the non-streaming path — Cloud TTS’s streaming audio config carries
speaking_rate but has no pitch field, so pitch is silently inert when streaming=True.streaming=True and vertexai=True cannot be combined; the constructor raises ValueError.
Gemini-TTS
Setmodel to a Gemini-TTS engine to synthesize with Gemini instead of standard Cloud TTS.
The voice name becomes a bare Gemini voice, and prompt takes a natural-language style
instruction:
"gemini-3.1-flash-tts-preview", "gemini-3.5-flash-tts",
"gemini-3.5-flash-lite-preview-tts", and "gemini-2.5-pro-tts". A Gemini model lifts the
Chirp 3 HD restriction on streaming, and prompt is only valid alongside one — passing
prompt without model raises ValueError.
Vertex AI
vertexai=True routes synthesis through the regional Vertex AI endpoint
({location}-texttospeech.googleapis.com) using Application Default Credentials rather than an
API key. It requires streaming=False.
Custom pronunciations
custom_pronunciations overrides how specific phrases are read. The short form is a mapping of
phrase to IPA:
"ipa" (default) or
"x-sampa". An unrecognized encoding logs a warning and falls back to IPA:
Cloud TTS only applies custom pronunciations to
en-US. With any other languageCode the
plugin logs a warning and the overrides are ignored.Parameters
Constructor parameters forGoogleTTS. The Python and Node JS SDKs share these field names.
Output audio is fixed at 24 kHz, mono, 16-bit PCM — there is no
sample_rate argument.
Import paths
The same plugin is also reachable without a Google credential of your own, billed against your
Zero Runtime token, as
from zeroruntime.inference import GoogleTTS — see
Zero Runtime inference.
The synthesized audio is streamed back to the caller as the final stage of the
pipeline.
Inference models
These Google models also run through the Inference Gateway on your Zero Runtime auth token, with no Google API key. Pass the model id to the same class imported fromzeroruntime.inference (Python) or @zeroruntime/js-sdk/inference (Node JS).