When i use different vocies from elevenlabs it reu...
# ask-ai
d
When i use different vocies from elevenlabs it reutrns: raise APIError(message=data["error"]) livekit.agents._exceptions.APIError: voice_id_does_not_exist (body=None, retryable=True)
t
Thanks for reaching out, Ibragim. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
The error
APIError: voice_id_does_not_exist
occurs when the voice ID you are trying to use does not exist in your ElevenLabs account or is invalid. Here are steps to resolve this issue: 1. List Available Voices Use the
list_voices()
method to see which voices are available in your ElevenLabs account:
Copy code
from livekit.plugins import elevenlabs

# Create TTS instance
tts = elevenlabs.TTS()

# List available voices
voices = await tts.list_voices()
for voice in voices:
    print(f"ID: {voice.id}, Name: {voice.name}, Category: {voice.category}")
2. Use a Valid Voice ID Once you have the list of available voices, use a valid voice ID when creating your TTS instance:
Copy code
from livekit.plugins import elevenlabs

# Use a voice ID from your available voices list
tts = elevenlabs.TTS(
    voice_id="your_valid_voice_id_here",  # Replace with actual voice ID
    model="eleven_multilingual_v2"
)
3. Update Voice ID Dynamically You can also update the voice ID after creating the TTS instance using the
update_options()
method:
Copy code
# Update to a different voice
tts.update_options(voice_id="another_valid_voice_id")
4. Use the Default Voice If you are unsure about voice IDs, you can use the default voice by not specifying a
voice_id
parameter:
Copy code
# Uses the default voice ID: "bIHbv24MWmeRgasZH58o"
tts = elevenlabs.TTS()
Common Causes of This Error: • Invalid voice ID: The voice ID string is incorrect or doesn’t exist • Account limitations: The voice might not be available in your ElevenLabs subscription tier • Deleted voices: Custom voices that were previously available but have been deleted • Typos: Simple spelling mistakes in the voice ID string By following these steps, you should be able to resolve the issue and use the desired voice successfully. Sources: livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/__ini...
d
i copied voice id from elevenlabs and it still return livekit.agents._exceptions.APIError: voice_id_does_not_exist (body=None, retryable=True)
t
If you're still running into that pesky APIError: voice_id_does_not_exist error even after carefully copying a voice ID from ElevenLabs, don't worry! I've got your back. Let's walk through some troubleshooting steps together to get things working smoothly. 1. Verify Voice Access with Your API Key Sometimes, not all voices play nice with every API key. Let's do a quick check to see exactly what voices are available to you:
Copy code
from livekit.plugins import elevenlabs

# Create TTS instance with your API key
tts = elevenlabs.TTS()

# List available voices for your account
available_voices = await tts.list_voices()
for voice in available_voices:
    print(f"ID: {voice.id}, Name: {voice.name}, Category: {voice.category}")
2. Common Causes and Solutions • Voice Subscription Tier: Some voices can be a bit picky about account levels. Double-check that your subscription gives you access to the voice you want. • API Key Permissions: Make sure your
ELEVEN_API_KEY
is set up correctly and has all the right permissions. • Voice ID Format: It's easy to accidentally grab an extra space or character. Take a second look at that voice ID! 3. Use a Known Working Voice Need a quick fix? Here are some reliable voice IDs you can try:
Copy code
from livekit.plugins import elevenlabs

# Use the default voice ID
tts = elevenlabs.TTS(voice_id="bIHbv24MWmeRgasZH58o")  # Default voice
Or try another example:
Copy code
tts = elevenlabs.TTS(voice_id="EXAVITQu4vr4xnSDxMaL")  # Bella voice
4. Verify Your Setup • API Key: Let's make sure your API key is set up right:
ELEVEN_API_KEY=<your-elevenlabs-api-key>
• Installation: And don't forget to have the right plugin installed:
pip install "livekit-agents[elevenlabs]~=1.0"
I know tech troubles can be frustrating, but we'll get this sorted out together! If you're still stuck after trying these steps, just give me a shout, and we'll figure it out. Sources: livekit-plugins/livekit-plugins-resemble/livekit/plugins/resemble/tts.py | ElevenLabs TTS integration guide | LiveKit Docs