dazzling-guitar-12115
08/29/2025, 7:02 AMFile "D:\Voice AI Agent\Voice_ai_project\.venv\Lib\site-packages\livekit\plugins\elevenlabs\tts.py", line 381, in _run
raise APIConnectionError() from e
livekit.agents._exceptions.APIConnectionError: Connection error.
[Audio] Array (AMD Audio Dev [-86.58 dBFS] [------------------------------]2025-08-29 121840,651 - INFO - shutting down worker
2025-08-29 121840,651 - INFO livekit.agents - shutting down worker {"id": "unregistered"}
2025-08-29 121840,653 - DEBUG - shutting down job task
2025-08-29 121840,653 - DEBUG livekit.agents - shutting down job task {"reason": "", "user_initiated": false}
2025-08-29 121840,654 - DEBUG - http_session(): closing the httpclient ctx
2025-08-29 121840,654 - DEBUG livekit.agents - http_session(): closing the httpclient ctx
2025-08-29 121840,656 - DEBUG - job exiting
^^^^^^^^^^^^^^^^^
File "D:\Voice AI Agent\Voice_ai_project\.venv\Lib\site-packages\livekit\plugins\elevenlabs\tts.py", line 381, in _run
raise APIConnectionError() from e
livekit.agents._exceptions.APIConnectionError: Connection error.
[Audio] Array (AMD Audio Dev [-86.58 dBFS] [------------------------------]2025-08-29 121840,651 - INFO - shutting down worker
2025-08-29 121840,651 - INFO livekit.agents - shutting down worker {"id": "unregistered"}
2025-08-29 121840,653 - DEBUG - shutting down job task
2025-08-29 121840,653 - DEBUG livekit.agents - shutting down job task {"reason": "", "user_initiated": false}
2025-08-29 121840,654 - DEBUG - http_session(): closing the httpclient ctx
^^^^^^^^^^^^^^^^^
File "D:\Voice AI Agent\Voice_ai_project\.venv\Lib\site-packages\livekit\plugins\elevenlabs\tts.py", line 381, in _run
raise APIConnectionError() from e
^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^
File "D:\Voice AI Agent\Voice_ai_project\.venv\Lib\site-packages\livekit\plugins\elevenlabs\tts.py", line 381, in _run
raise APIConnectionError() from e
livekit.agents._exceptions.APIConnectionError: Connection error.
[Audio] Array (AMD Audio Dev [-86.58 dBFS] [------------------------------]2025-08-29 121840,651 - INFO - shutting down worker
2025-08-29 121840,651 - INFO livekit.agents - shutting down worker {"id": "unregistered"}
2025-08-29 121840,653 - DEBUG - shutting down job task
2025-08-29 121840,653 - DEBUG livekit.agents - shutting down job task {"reason": "", "user_initiated": false}
2025-08-29 121840,654 - DEBUG - http_session(): closing the httpclient ctx
2025-08-29 121840,654 - DEBUG livekit.agents - http_session(): closing the httpclient ctx
^^^^^^^^^^^^^^^^^
File "D:\Voice AI Agent\Voice_ai_project\.venv\Lib\site-packages\livekit\plugins\elevenlabs\tts.py", line 381, in _run
raise APIConnectionError() from e
livekit.agents._exceptions.APIConnectionError: Connection error.
[Audio] Array (AMD Audio Dev [-86.58 dBFS] [------------------------------]2025-08-29 121840,651 - INFO - shutting down worker
2025-08-29 121840,651 - INFO livekit.agents - shutting down worker {"id": "unregistered"}
2025-08-29 121840,653 - DEBUG - shutting down job task
^^^^^^^^^^^^^^^^^
File "D:\Voice AI Agent\Voice_ai_project\.venv\Lib\site-packages\livekit\plugins\elevenlabs\tts.py", line 381, in _run
^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^
File "D:\Voice AI Agent\Voice_ai_project\.venv\Lib\site-packages\livekit\plugins\elevenlabs\tts.py", line 381, in _run
raise APIConnectionError() from e
livekit.agents._exceptions.APIConnectionError: Connection error.
[Audio] Array (AMD Audio Dev [-86.58 dBFS] [------------------------------]2025-08-29 121840,651 - INFO - shutting down worker
2025-08-29 121840,651 - INFO livekit.agents - shutting down worker {"id": "unregistered"}
2025-08-29 121840,653 - DEBUG - shutting down job task
2025-08-29 121840,653 - DEBUG livetall-airline-16756
08/29/2025, 7:02 AMtall-airline-16756
08/29/2025, 7:02 AMAPIConnectionError
in the ElevenLabs TTS plugin usually pops up when there’s a hiccup connecting to the ElevenLabs API. Don’t worry—here are some friendly steps to help you get it sorted:
1. Double-check that your ElevenLabs API key is entered correctly, either as an argument or set in the ELEVEN_API_KEY
environment variable.
2. Make sure your network is up and running, and that you can reach the API endpoint at <https://api.elevenlabs.io/v1>
from where you’re working.
3. If you’re using streaming, take a quick look to confirm the WebSocket connection URL is properly formed and accessible.
4. Try adding some retry logic with backoff to handle any temporary connection glitches.
If you want, I’m here to help walk you through any of these steps—just let me know!
Sources: livekit-plugins/livekit-plugins-inworld/livekit/plugins/inworld/tts.py | plugins/elevenlabs/src/tts.ts