The official Python SDK for ElevenLabs. ElevenLabs brings the most compelling, rich and lifelike voices to creators and developers in just a few lines of code.
Check out the HTTP API documentation.
pip install elevenlabs-
Eleven v3 (
eleven_v3)- Dramatic delivery and performances
- 70+ languages supported
- Supported for natural multi-speaker dialogue
-
Eleven Multilingual v2 (
eleven_multilingual_v2)- Excels in stability, language diversity, and accent accuracy
- Supports 29 languages
- Recommended for most use cases
-
Eleven Flash v2.5 (
eleven_flash_v2_5)- Ultra-low latency
- Supports 32 languages
- Faster model, 50% lower price per character
-
Eleven Turbo v2.5 (
eleven_turbo_v2_5)- Good balance of quality and latency
- Ideal for developer use cases where speed is crucial
- Supports 32 languages
For more detailed information about these models and others, visit the ElevenLabs Models documentation.
from dotenv import load_dotenv
from elevenlabs.client import ElevenLabs
from elevenlabs.play import play
load_dotenv()
elevenlabs = ElevenLabs()
audio = elevenlabs.text_to_speech.convert(
text="The first move is what sets everything in motion.",
voice_id="JBFqnCBsd6RMkjVDRZzb",
model_id="eleven_v3",
output_format="mp3_44100_128",
)
play(audio)Play
🎧 Try it out! Want to hear our voices in action? Visit the ElevenLabs Voice Lab to experiment with different voices, languages, and settings.
List all your available voices with search().
from elevenlabs.client import ElevenLabs
elevenlabs = ElevenLabs(
api_key="YOUR_API_KEY",
)
response = elevenlabs.voices.search()
print(response.voices)For information about the structure of the voices output, please refer to the official ElevenLabs API documentation for Get Voices.
Build a voice object with custom settings to personalize the voice style, or call
elevenlabs.voices.settings.get("your-voice-id") to get the default settings for the voice.
