ElevenLabs

ElevenLabs is a voice AI platform that offers advanced Text-to-Speech (TTS) capabilities with highly realistic and expressive voices.
It supports multiple languages and voices, making it ideal for real-time conversational agents, narrated content, accessibility tools, and voice-enabled applications.

The ElevenLabs plugin for the Stream Python AI SDK allows you to add TTS functionality to your project.

Installation

Install the Stream ElevenLabs plugin with

uv add getstream-plugins-elevenlabs

Example

Check out our Elevenlabs example to see a practical implementation of the plugin and get inspiration for your own projects, or read on for some key details.

Initialisation

The ElevenLabs plugin for Stream exists in the form of the ElevenLabsTTS class:

from getstream.plugins.elevenlabs import ElevenLabsTTS

tts = ElevenLabsTTS()
To initialise without passing in the API key, make sure the `ELEVENLABS_API_KEY` is available as an environment variable. You can do this either by defining it in a `.env` file or exporting it directly in your terminal.

Parameters

These are the parameters available in the ElevenLabsTTS plugin for you to customise:

NameTypeDefaultDescription
api_keystr or NoneNoneYour ElevenLabs API key. If not provided, the plugin will look for the ELEVENLABS_API_KEY environment variable.
voice_idstr"VR6AewLTigWG4xSOukaG"The ID of the voice to use for TTS. You can use any voice from your ElevenLabs account.
model_idstr"eleven_multilingual_v2"The ID of the ElevenLabs TTS model to use. Controls the language and tone model for synthesis.

Functionality

Send text to convert to speech

The send() method sends the text passed in for the service to synthesize. The resulting audio is then played through the configured output track.

tts.send("Demo text you want AI voice to say")
© Getstream.io, Inc. All Rights Reserved.