16:14:13.180 WARNI… livekit.agents failed to s...
# ask-ai
s
161413.180 WARNI… livekit.agents failed to synthesize speech, retrying in 0.1s {"tts": "livekit.plugins.elevenlabs.tts.TTS", "attempt": 1, "streamed": true, "room": "mock_room"} Traceback (most recent call last): File "/Users/apple/Documents/Projects/real_estate_fortune/agent/.venv/lib/python3.12/site-packages/livekit/agents/tts/tts.py", line 396, in _main_task await self._run(output_emitter) File "/Users/apple/Documents/Projects/real_estate_fortune/agent/.venv/lib/python3.12/site-packages/livekit/plugins/elevenlabs/tts.py", line 459, in _run raise e File "/Users/apple/Documents/Projects/real_estate_fortune/agent/.venv/lib/python3.12/site-packages/livekit/plugins/elevenlabs/tts.py", line 454, in _run await waiter livekit.agents._exceptions.APIStatusError: connection closed (status_code=-1, request_id=None, body=None, retryable=True) 161413.584 ERROR livekit.…levenlabs elevenlabs tts returned error
t
Thanks for reaching out, Gaurav. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I see you're hitting an ElevenLabs TTS failure (
APIStatusError: connection closed
, retryable=True) while the agent retries. I can help triage this. Quick questions and immediate checks to narrow the cause: 1. Is
ELEVEN_API_KEY
set and valid in the environment where the agent runs? 2. Can that machine reach ElevenLabs endpoints (e.g., try
curl <https://api.elevenlabs.io/v1>
or DNS lookup)? 3. Are you behind a proxy or firewall that might close outbound HTTPS connections? 4. Are you running a supported plugin/version (ElevenLabs plugin v1.2+)? Which LiveKit / plugin version and Python version are you using? 5. Does this fail consistently or intermittently? If intermittent, how long does it typically retry before erroring? Immediate steps you can try now: • Confirm
ELEVEN_API_KEY
is correct and exported to the agent process. • Test outbound connectivity from the agent host to ElevenLabs (curl or similar). • Temporarily enable verbose/debug logs for the ElevenLabs plugin (set
LK_ELEVENLABS_DEBUG=true
if available) and share the additional logs if the error persists. • Check ElevenLabs’ status page for outages while reproducing the error. Tell me the answers to the questions above and any extra logs after enabling debug — I’ll propose next targeted steps. Sources: ElevenLabs TTS plugin guide | LiveKit Docs | How to Get Help from LiveKit