Skip to main content

Deepgram TTS

How to use Deepgram TTS with LiveKit Agents.

Use in Agent Builder

Create a new agent in your browser using this model

Overview

Deepgram text-to-speech is available in LiveKit Agents through LiveKit Inference and the Deepgram plugin. With LiveKit Inference, your agent runs on LiveKit's infrastructure to minimize latency. No separate provider API key is required, and usage and rate limits are managed through LiveKit Cloud. Use the plugin instead if you want to manage your own billing and rate limits. Pricing for LiveKit Inference is available on the pricing page.

LiveKit Inference

Use LiveKit Inference to access Deepgram TTS without a separate Deepgram API key.

Model nameModel IDLanguages
Aura-2
deepgram/aura-2
enen-USen-PHen-GBen-AUeses-COes-MXes-ESes-419es-ARnlnl-NLfrfr-FRdede-DEitit-ITjaja-JP
Aura-1
Retired
deepgram/aura
enen-USen-IEen-GB
Retired models
Retired models are no longer accessible. If you're using a retired model, switch to a currently available model.

Usage

To use Deepgram, use the TTS class from the inference module:

from livekit.agents import AgentSession, inference
session = AgentSession(
tts=inference.TTS(
model="deepgram/aura-2",
voice="athena",
language="en"
),
# ... stt, llm, vad, turn_handling, etc.
)
import { AgentSession, inference } from '@livekit/agents';
session = new AgentSession({
tts: new inference.TTS({
model: "deepgram/aura-2",
voice: "athena",
language: "en"
}),
// ... stt, llm, vad, turnHandling, etc.
});

Parameters

model
Required
string

The model ID from the models list.

voice
Required
string

See voices for guidance on selecting a voice.

languageLanguageCode

Language code for the input text. If not set, the model default applies.

extra_kwargsdict

Additional parameters to pass to the Deepgram TTS API. See model parameters for supported fields.

In Node.js this parameter is called modelOptions.

Model parameters

Pass the following parameters inside extra_kwargs (Python) or modelOptions (Node.js):

ParameterTypeDefaultNotes
mip_opt_outboolFalseOpt out of the Deepgram Model Improvement Program.

Voices

LiveKit Inference supports Deepgram Aura voices. You can explore the available voices in the Deepgram voice library, and use the voice by copying its name into your LiveKit agent session.

The following is a small sample of the Deepgram voices available in LiveKit Inference.

Apollo

Comfortable, casual male

🇺🇸
Athena

Smooth, professional female

🇺🇸
Odysseus

Calm, professional male

🇺🇸
Theia

Expressive, polite female

🇦🇺

String descriptors

As a shortcut, you can also pass a descriptor with the model ID and voice directly to the tts argument in your AgentSession:

from livekit.agents import AgentSession
session = AgentSession(
tts="deepgram/aura-2:athena",
# ... stt, llm, vad, turn_handling, etc.
)
import { AgentSession } from '@livekit/agents';
session = new AgentSession({
tts: "deepgram/aura-2:athena",
// ... stt, llm, vad, turnHandling, etc.
});

Plugin

LiveKit's plugin support for Deepgram lets you connect directly to Deepgram's TTS API with your own API key.

Available in
Python
|
Node.js

Installation

Install the plugin:

uv add "livekit-agents[deepgram]~=1.4"
pnpm add @livekit/agents-plugin-deepgram@1.x

Authentication

The Deepgram plugin requires a Deepgram API key.

Set DEEPGRAM_API_KEY in your .env file.

Usage

Use Deepgram 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 deepgram
session = AgentSession(
tts=deepgram.TTS(
model="aura-2-asteria-en",
)
# ... llm, stt, etc.
)
import * as deepgram from '@livekit/agents-plugin-deepgram';
const session = new voice.AgentSession({
tts: deepgram.TTS(
model: "aura-2-asteria-en",
),
// ... llm, stt, etc.
});

Parameters

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

modelstringDefault: aura-2-asteria-en

ID of the model to use for generation. To learn more, see supported models.

Prompting

Deepgram supports filler words and natural pauses through prompting. To learn more, see Text to Speech Prompting.

Additional resources

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