when using live kit agent with 11 tts, it works fine with the default voiceID. But when I pass voice_id to tts init, it always fails for the custom voice id.
code:
tts=elevenlabs.TTS(_voice_id_="6JsmTroalVewG1gA6Jmw"),
error log (lk agent logs):
{"message": "failed to synthesize speech, retrying in 2.0s\nTraceback (most recent call last):\n File \"/app/.venv/lib/python3.11/site-packages/livekit/agents/tts/tts.py\", line 357, in _main_task\n await self._run(output_emitter)\n File \"/app/.venv/lib/python3.11/site-packages/livekit/plugins/elevenlabs/tts.py\", line 425, in _run\n raise e\n File \"/app/.venv/lib/python3.11/site-packages/livekit/plugins/elevenlabs/tts.py\", line 420, in _run\n await waiter\nlivekit.agents._exceptions.APIStatusError: connection closed (status_code=-1, request_id=None, body=None, retryable=True)", "level": "WARNING", "name": "livekit.agents", "room": "sbx-21ojw0-LBnMymR5khhVi7NqZo6ACd", "tts": "livekit.plugins.elevenlabs.tts.TTS", "attempt": 3, "streamed": true, "pid": 93, "job_id": "AJ_9RsuMuzfBPts", "timestamp": "2025-09-13T020257.576885+00:00"}
{"message": "websocket closed unexpectedly", "level": "WARNING", "name": "livekit.plugins.elevenlabs", "room": "sbx-21ojw0-LBnMymR5khhVi7NqZo6ACd", "pid": 93, "job_id": "AJ_9RsuMuzfBPts", "timestamp": "2025-09-13T020300.432119+00:00"}
{"message": "Error in _tts_inference_task\nTraceback (most recent call last):\n File \"/app/.venv/lib/python3.11/site-packages/livekit/agents/tts/tts.py\", line 529, in __anext__\n val = await self._event_aiter.__anext__()\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nStopAsyncIteration\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/app/.venv/lib/python3.11/site-packages/livekit/agents/utils/log.py\", line 16, in async_fn_logs\n return await fn(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/.venv/lib/python3.11/site-packages/opentelemetry/util/_decorator.py\", line 71, in async_wrapper\n return await func(*args, **kwargs) # type: ignore\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/.venv/lib/python3.11/site-packages/livekit/agents/voice/generation.py\", line 212, in _tts_inference_task\n async for audio_frame in tts_node:\n File \"/app/.venv/lib/python3.11/site-packages/livekit/agents/voice/agent.py\", line 412, in tts_node\n async for ev in stream:\n File \"/app/.venv/lib/python3.11/site-packages/livekit/agents/tts/tts.py\", line 532, in __anext__\n raise exc # noqa: B904\n ^^^^^^^^^\n File \"/app/.venv/lib/python3.11/site-packages/opentelemetry/util/_decorator.py\", line 71, in async_wrapper\n return await func(*args, **kwargs) # type: ignore\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/.venv/lib/python3.11/site-packages/livekit/agents/tts/tts.py\", line 357, in _main_task\n await self._run(output_emitter)\n File \"/app/.venv/lib/python3.11/site-packages/livekit/plugins/elevenlabs/tts.py\", line 425, in _run\n raise e\n File \"/app/.venv/lib/python3.11/site-packages/livekit/plugins/elevenlabs/tts.py\", line 420, in _run\n await waiter\nlivekit.agents._exceptions.APIStatusError: connection closed (status_code=-1, request_id=None, body=None, retryable=True)", "level": "ERROR", "name": "livekit.agents", "room": "sbx-21ojw0-LBnMymR5khhVi7NqZo6ACd", "pid": 93, "job_id": "AJ_9RsuMuzfBPts", "timestamp": "2025-09-13T020300.433209+00:00"}
{"message": "STT metrics", "level": "INFO", "name": "livekit.agents", "room": "sbx-21ojw0-LBnMymR5khhVi7NqZo6ACd", "audio_duration": 5.05, "pid": 93, "job_id": "AJ_9RsuMuzfBPts", "timestamp": "2025-09-13T020300.790786+00:00"}
{"message": "STT metrics", "level": "INFO", "name": "livekit.agents", "room": "sbx-21ojw0-LBnMymR5khhVi7NqZo6ACd", "audio_duration": 5.05, "pid": 93, "job_id": "AJ_9RsuMuzfBPts", "timestamp": "2025-09-13T020305.842590+00:00"}
{"message": "STT metrics", "level": "INFO", "name": "livekit.agents", "room": "sbx-21ojw0-LBnMymR5khhVi7NqZo6ACd", "audio_duration": 5.0, "pid": 93, "job_id": "AJ_9RsuMuzfBPts", "timestamp": "2025-09-13T020310.842821+00:00"}
{"message": "STT metrics", "level": "INFO", "name": "livekit.agents", "room": "sbx-21ojw0-LBnMymR5khhVi7NqZo6ACd", "audio_duration": 5.05, "pid": 93, "job_id": "AJ_9RsuMuzfBPts", "timestamp": "2025-09-13T020315.893005+00:00"}