Overview
Gemini TTS generates speech from text with customizable style, tone, accent, and pace through natural language prompts. It’s designed for scenarios that require precise recitation and nuanced audio output. With LiveKit's Gemini TTS integration and the Agents framework, you can build voice AI applications with accurate and nuanced speech.
Quick reference
This section includes a basic usage example and some reference material. For links to more detailed documentation, see Additional resources.
Installation
Install the plugin from PyPI:
pip install "livekit-agents[google]~=1.2"
Authentication
Credentials must be provided by one of the following methods:
- To use VertexAI: Set the
GOOGLE_APPLICATION_CREDENTIALS
environment variable to the path of the service account key file. - To use Gemini API: Set the
api_key
argument or theGOOGLE_API_KEY
environment variable.
Usage
Use a Gemini TTS in an AgentSession
or as a standalone speech generator. For example, you can use this TTS in the Voice AI quickstart.
from livekit.plugins import googlesession = AgentSession(tts = google.beta.GeminiTTS(model="gemini-2.5-flash-preview-tts",voice_name="Zephyr",instructions="Speak in a friendly and engaging tone.",),# ... llm, stt, etc.)
Parameters
This section describes some of the available parameters. See the plugin reference for a complete list of all available parameters.
The model to use for speech generation. For a list of models, see Supported models.
Voice name. For supported voices, see Voice options.
Name of the voice to use for speech. For a full list of voices, see Supported voices and languages.
Prompt to control the style, tone, accent, and pace. To learn more, see Controlling speech style with prompts.
Additional resources
The following resources provide more information about using Gemini TTS with LiveKit Agents.
Python package
The livekit-plugins-google
package on PyPI.
Plugin reference
Reference for the Gemini TTS plugin.
GitHub repo
View the source or contribute to the LiveKit Google plugin.
Gemini TTS docs
Gemini Developer API docs for TTS.
Voice AI quickstart
Get started with LiveKit Agents and Gemini TTS.
Google ecosystem guide
Overview of the entire Google AI and LiveKit Agents integration.