why are certain elevenlabs voice id's not availabl...
# ask-ai
w
why are certain elevenlabs voice id's not available for livekit? I am trying voiceid aEO01A4wXwd1O8GPgGlF and I am getting errors
t
Thanks for reaching out, Sunil. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'd love to help you with the error you're experiencing with the ElevenLabs voice ID aEO01A4wXwd1O8GPgGlF. Could you please share a bit more detail? Specifically: • The exact error message or code you're seeing • How you're integrating ElevenLabs with LiveKit (for example, through API calls, SDKs, etc.) • Whether any other voice IDs are working or not working for you With this information, I'll be better equipped to assist you and get this sorted out together.
w
2025-10-02 130824,156 - WARNING livekit.agents - failed to synthesize speech, retrying in 0.1s {"tts": "livekit.plugins.elevenlabs.tts.TTS", "attempt": 1, "streamed": true} Traceback (most recent call last): File "C:\RUNTIME\VSCode_Workspace_AI_Agents\debt_collection_voice_agent_livekit\multi_agent_squad\venv\Lib\site-packages\livekit\plugins\elevenlabs\tts.py", line 358, in _run connection = await asyncio.wait_for( ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\RUNTIME\VSCode_Workspace_AI_Agents\debt_collection_voice_agent_livekit\multi_agent_squad\venv\Lib\asyncio\tasks.py", line 479, in wait_for return fut.result() ^^^^^^^^^^^^ File "C:\RUNTIME\VSCode_Workspace_AI_Agents\debt_collection_voice_agent_livekit\multi_agent_squad\venv\Lib\site-packages\livekit\plugins\elevenlabs\tts.py", line 239, in current_connection await conn.connect() File "C:\RUNTIME\VSCode_Workspace_AI_Agents\debt_collection_voice_agent_livekit\multi_agent_squad\venv\Lib\site-packages\livekit\plugins\elevenlabs\tts.py", line 513, in connect self._ws = await self._session.ws_connect(url, headers=headers) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\kvs_s\AppData\Roaming\Python\Python311\site-packages\aiohttp\client.py", line 1078, in _ws_connect raise WSServerHandshakeError( aiohttp.client_exceptions.WSServerHandshakeError: 403, message='Invalid response status', url='wss://api.elevenlabs.io/v1/text-to-speech/aEO01A4wXwd1O8GPgGlF/multi-stream-input?model_id=eleven_flash_v2.5&output_format=mp3_22050_32&language_code=en&enable_ssml_parsing=false&inactivity_timeout=180&apply_text_normalization=auto&sync_alignment=true&auto_mode=true' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\RUNTIME\VSCode_Workspace_AI_Agents\debt_collection_voice_agent_livekit\multi_agent_squad\venv\Lib\site-packages\livekit\agents\tts\tts.py", line 357, in _main_task await self._run(output_emitter) File "C:\RUNTIME\VSCode_Workspace_AI_Agents\debt_collection_voice_agent_livekit\multi_agent_squad\venv\Lib\site-packages\livekit\plugins\elevenlabs\tts.py", line 364, in _run raise APIConnectionError("could not connect to ElevenLabs") from e livekit.agents._exceptions.APIConnectionError: could not connect to ElevenLabs (body=None, retryable=True) 2025-10-02 130824,536 - WARNING livekit.agents - failed to synthesize speech, retrying in 2.0s {"tts": "livekit.plugins.elevenlabs.tts.TTS", "attempt": 2, "streamed": true} Traceback (most recent call last): File "C:\RUNTIME\VSCode_Workspace_AI_Agents\debt_collection_voice_agent_livekit\multi_agent_squad\venv\Lib\site-packages\livekit\plugins\elevenlabs\tts.py", line 358, in _run connection = await asyncio.wait_for( ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\RUNTIME\VSCode_Workspace_AI_Agents\debt_collection_voice_agent_livekit\multi_agent_squad\venv\Lib\asyncio\tasks.py", line 479, in wait_for return fut.result() ^^^^^^^^^^^^ File "C:\RUNTIME\VSCode_Workspace_AI_Agents\debt_collection_voice_agent_livekit\multi_agent_squad\venv\Lib\site-packages\livekit\plugins\elevenlabs\tts.py", line 239, in current_connection await conn.connect() File "C:\RUNTIME\VSCode_Workspace_AI_Agents\debt_collection_voice_agent_livekit\multi_agent_squad\venv\Lib\site-packages\livekit\plugins\elevenlabs\tts.py", line 513, in connect self._ws = await self._session.ws_connect(url, headers=headers) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\kvs_s\AppData\Roaming\Python\Python311\site-packages\aiohttp\client.py", line 1078, in _ws_connect raise WSServerHandshakeError( aiohttp.client_exceptions.WSServerHandshakeError: 403, message='Invalid response status', url='wss://api.elevenlabs.io/v1/text-to-speech/aEO01A4wXwd1O8GPgGlF/multi-stream-input?model_id=eleven_flash_v2.5&output_format=mp3_22050_32&language_code=en&enable_ssml_parsing=false&inactivity_timeout=180&apply_text_normalization=auto&sync_alignment=true&auto_mode=true' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\RUNTIME\VSCode_Workspace_AI_Agents\debt_collection_voice_agent_livekit\multi_agent_squad\venv\Lib\site-packages\livekit\agents\tts\tts.py", line 357, in _main_task await self._run(output_emitter) File "C:\RUNTIME\VSCode_Workspace_AI_Agents\debt_collection_voice_agent_livekit\multi_agent_squad\venv\Lib\site-packages\livekit\plugins\elevenlabs\tts.py", line 364, in _run raise APIConnectionError("could not connect to ElevenLabs") from e
t
I'm sorry to hear you're running into a 403 error when connecting to the ElevenLabs voice ID. Let's work through some common causes together: • Authentication Issues: Please double-check that your
ELEVEN_API_KEY
is valid and properly set in your environment or passed to the TTS object. Sometimes a small typo can cause this. • Voice ID Access Permissions: Make sure the voice ID
aEO01A4wXwd1O8GPgGlF
is accessible in your ElevenLabs account. You can easily verify this by using the
list_voices()
method to see which voices are available to you. • Network or Regional Restrictions: It’s worth confirming that there aren’t any network policies or regional restrictions blocking access to
https://api.elevenlabs.io
. • Rate Limiting: Sometimes usage limits or account restrictions can cause errors, so please check your ElevenLabs account for any such notifications. • Incorrect API Endpoint: Lastly, double-check that the WebSocket connection URL and parameters are set up correctly. To get a clearer picture, you might want to enable debug logging in LiveKit—this will capture detailed error messages from the API response. If you’d like, I’m here to help you with any of these steps, just let me know! Sources: livekit-plugins/livekit-plugins-bey/livekit/plugins/bey/avatar.py | plugins/elevenlabs/src/tts.ts | Docs::Agents | ElevenLabs TTS integration guide | LiveKit Docs | SIP troubleshooting guide | LiveKit Docs
w
give me the code on how to use list_voices(). please give me complete python code
t
Here is a complete Python code example to use the
list_voices()
method with the ElevenLabs TTS plugin in LiveKit:
Copy code
from livekit.plugins import elevenlabs
import asyncio

async def main():
    # Initialize TTS (API key should be set via environment variable ELEVEN_API_KEY)
    tts_11labs = elevenlabs.TTS()
    
    # Fetch the list of available voices
    voices = await tts_11labs.list_voices()
    
    # Print voice details
    for voice in voices:
        print(f"Voice ID: {voice.id}, Name: {voice.name}, Category: {voice.category}")

# Run the example
if __name__ == "__main__":
    asyncio.run(main())
Key Details: • The
list_voices()
method fetches available voices from ElevenLabs. • Make sure your
ELEVEN_API_KEY
environment variable is set with your API key to get started smoothly. • This method is asynchronous, so don’t forget to
await
it. If you have any questions or need a hand with anything else, just let me know — I’m here to help! Sources: Docs::Agents | livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/__ini...
w
I am getting the following error when I try to get voices - voices = await tts.list_voices() ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\RUNTIME\VSCode_Workspace_AI_Agents\debt_collection_voice_agent_livekit\multi_agent_squad\venv\Lib\site-packages\livekit\plugins\elevenlabs\tts.py", line 188, in list_voices return _dict_to_voices_list(await resp.json()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\RUNTIME\VSCode_Workspace_AI_Agents\debt_collection_voice_agent_livekit\multi_agent_squad\venv\Lib\site-packages\livekit\plugins\elevenlabs\tts.py", line 754, in _dict_to_voices_list for voice in data["voices"]: ~~~~^^^^^^^^^^ KeyError: 'voices' 2025-10-02 141317,270 - ERROR debt-collection-agent-first-contact - ######EXCEPTION IN ENTRY POINT - Traceback (most recent call last): File "C:\RUNTIME\VSCode_Workspace_AI_Agents\debt_collection_voice_agent_livekit\multi_agent_squad\debt_collection_agent_first_contact.py", line 290, in entrypoint voices = await tts.list_voices() ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\RUNTIME\VSCode_Workspace_AI_Agents\debt_collection_voice_agent_livekit\multi_agent_squad\venv\Lib\site-packages\livekit\plugins\elevenlabs\tts.py", line 188, in list_voices return _dict_to_voices_list(await resp.json()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\RUNTIME\VSCode_Workspace_AI_Agents\debt_collection_voice_agent_livekit\multi_agent_squad\venv\Lib\site-packages\livekit\plugins\elevenlabs\tts.py", line 754, in _dict_to_voices_list for voice in data["voices"]: ~~~~^^^^^^^^^^ KeyError: 'voices'
t
It looks like the
KeyError: 'voices'
pops up when the ElevenLabs API response doesn’t include the
voices
field we’re expecting. This can happen if the API response format has changed or is different from what the SDK anticipates. Let’s work through this together: 1. Verify Your API Key: Please double-check that your API key is valid and has the right permissions. Sometimes this small step can make a big difference. 2. Check the API Response Directly: It’s helpful to manually call the API and see what it’s returning. You can use this Python snippet to take a look:
Copy code
import requests

response = requests.get(
    "https://api.elevenlabs.io/v1/voices",
    headers={"xi-api-key": "your_api_key"}
)
print(response.json())  # This will show you the actual response structure
1. Confirm You’re Using the Right Endpoint: Make sure the endpoint
https://api.elevenlabs.io/v1/voices
is correct in your requests. 2. Inspect the Response: Check if the response actually contains the
voices
key. If it’s missing, the SDK might need an update to match the current API format. If you’d like, I’m here to help you through any of these steps—just let me know! Sources: ElevenLabs integration guide | LiveKit Docs | plugins/elevenlabs/src/tts.ts | livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/stt.p...
w
it is not working...as I indicated before, some voice id's work and some dont. is there a way to check which ones do from elevenlabs website?
t
Thanks for reaching out! While there isn't a specific feature on the ElevenLabs website to check voice IDs directly, you can easily get a list of all available voices using the
list_voices()
method in the ElevenLabs API. This will give you all the details about the voices linked to your account. If you'd prefer a visual way to explore this, I recommend taking a look at the ElevenLabs dashboard or their official documentation—they usually have some helpful tips there. And of course, if you’d like, I’m here to guide you through the API method or assist with anything else you might need. Just let me know! Sources: livekit-plugins/livekit-plugins-elevenlabs/pyproject.toml | plugins/elevenlabs/README.md