Skip to main content

Gradium TTS plugin guide

How to use the Gradium TTS plugin for LiveKit Agents.

Available in
Python

Overview

This plugin allows you to use Gradium as a TTS provider for your voice agents.

Quick reference

This section includes a brief overview of the Gradium TTS plugin.

Installation

Install the plugin from PyPI:

pip install "livekit-agents[gradium]~=1.3"

Authentication

The Gradium plugin requires a Gradium API key.

Set GRADIUM_API_KEY in your .env file.

Usage

Use Gradium TTS within an AgentSession or as a standalone speech generator. For example, you can use this TTS in the Voice AI quickstart.

from livekit.plugins import gradium
session = AgentSession(
tts=gradium.TTS(
),
# ... llm, stt, etc.
)

Parameters

This section describes some of the available parameters. See the plugin reference for a complete list of all available parameters.

voice_idstringOptionalDefault: YTpq7expH9539ERJ

Gradium TTS voice id to use.

json_configdict[str, Any]Optional

Defines advanced options for Gradium TTS such as speed, rewrite rules, and more. See the Gradium API docs for details on available options.

model_namestringOptionalDefault: default

Gradium TTS model to use.

model_endpointstringOptionalDefault: wss://eu.api.gradium.ai/api/speech/tts

Sets the endpoint to be used, switch to us.api.gradium.ai for US region.

Additional resources

The following resources provide more information about using Gradium with LiveKit Agents.