Traceback (most recent call last): File "C:\User...
# ask-ai
c
Traceback (most recent call last): File "C:\Users\KC\AppData\Local\Programs\Python\Python313\Lib\site-packages\livekit\agents\tts\tts.py", line 231, in _main_task await self._run(output_emitter) File "C:\Users\KC\AppData\Local\Programs\Python\Python313\Lib\site-packages\livekit\plugins\inworld\tts.py", line 261, in _run raise APIStatusError( message=e.message, status_code=e.status, request_id=None, body=None ) from None livekit.agents._exceptions.APIStatusError: Bad Request (status_code=400, request_id=None, body=None, retryable=False) {"message": "failed to synthesize speech, retrying in 0.1s", "level": "WARNING", "name": "livekit.agents", "exc_info": "Traceback (most recent call last):\n File \"C:\\Users\\KC\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\site-packages\\livekit\\agents\\tts\\tts.py\", line 231, in _main_task\n await self._run(output_emitter)\n File \"C:\\Users\\KC\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\site-packages\\livekit\\plugins\\inworld\\tts.py\", line 261, in _run\n raise APIStatusError(\n message=e.message, status_code=e.status, request_id=None, body=None\n ) from None\nlivekit.agents._exceptions.APIStatusError: Bad Request (status_code=400, request_id=None, body=None, retryable=False)", "tts": "livekit.plugins.inworld.tts.TTS", "attempt": 1, "streamed": false, "timestamp": "2025-10-08T214020.830499+00:00"} WARNINGlivekit.agentsfailed to synthesize speech, retrying in 2.0s Traceback (most recent call last): File "C:\Users\KC\AppData\Local\Programs\Python\Python313\Lib\site-packages\livekit\agents\tts\tts.py", line 231, in _main_task await self._run(output_emitter) File "C:\Users\KC\AppData\Local\Programs\Python\Python313\Lib\site-packages\livekit\plugins\inworld\tts.py", line 261, in _run raise APIStatusError( message=e.message, status_code=e.status, request_id=None, body=None ) from None livekit.agents._exceptions.APIStatusError: Bad Request (status_code=400, request_id=None, body=None, retryable=False) {"message": "failed to synthesize speech, retrying in 2.0s", "level": "WARNING", "name": "livekit.agents", "exc_info": "Traceback (most recent call last):\n File \"C:\\Users\\KC\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\site-packages\\livekit\\agents\\tts\\tts.py\", line 231, in _main_task\n await self._run(output_emitter)\n File \"C:\\Users\\KC\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\site-packages\\livekit\\plugins\\inworld\\tts.py\", line 261, in _run\n raise APIStatusError(\n message=e.message, status_code=e.status, request_id=None, body=None\n ) from None\nlivekit.agents._exceptions.APIStatusError: Bad Request (status_code=400, request_id=None, body=None, retryable=False)", "tts": "livekit.plugins.inworld.tts.TTS", "attempt": 2, "streamed": false, "timestamp": "2025-10-08T214021.078244+00:00"} WARNINGlivekit.agentsfailed to synthesize speech, retrying in 2.0s Traceback (most recent call last): File "C:\Users\KC\AppData\Local\Programs\Python\Python313\Lib\site-packages\livekit\agents\tts\tts.py", line 231, in _main_task await self._run(output_emitter) File "C:\Users\KC\AppData\Local\Programs\Python\Python313\Lib\site-packages\livekit\plugins\inworld\tts.py", line 261, in _run raise APIStatusError( message=e.message, status_code=e.status, request_id=None, body=None ) from None livekit.agents._exceptions.APIStatusError: Bad Request (status_code=400, request_id=None, body=None, retryable=False) {"message": "failed to synthesize speech, retrying in 2.0s", "level": "WARNING", "name": "livekit.agents", "exc_info": "Traceback (most recent call last):\n File \"C:\\Users\\KC\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\site-packages\\livekit\\agents\\tts\\tts.py\", line 231, in _main_task\n await self._run(output_emitter)\n File \"C:\\Users\\KC\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\site-packages\\livekit\\plugins\\inworld\\tts.py\", line 261, in _run\n raise APIStatusError(\n message=e.message, status_code=e.status, request_id=None, body=None\n ) from None\nlivekit.agents._exceptions.APIStatusError: Bad Request (status_code=400, request_id=None, body=None, retryable=False)", "tts": "livekit.plugins.inworld.tts.TTS", "attempt": 3, "streamed": false, "timestamp": "2025-10-08T214023.190667+00:00"} INFOlivekit.agentsclosing agent session due to participant disconnect (disable via
RoomInputOptions.close_on_disconnect=False
) {"message": "closing agent session due to participant disconnect (disable via
RoomInputOptions.close_on_disconnect=False
)", "level": "INFO", "name": "livekit.agents", "participant": "sip_+15715051131", "reason": "CLIENT_INITIATED", "timestamp": "2025-10-08T214024.037596+00:00"} INFO main Auto hanging up due to customer inactivity {"message": "Auto hanging up due to customer inactivity", "level": "INFO", "name": "__main__", "timestamp": "2025-10-08T214028.769717+00:00"} WARNINGlivekitlivekit:rtc engine453livekit:rtc_engine - received session close: "signal client closed: \"stream closed\"" UnknownReason Resume
t
Thanks for reaching out, Hai. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Could you please let me know which TTS provider plugin you're using (like OpenAI, Inworld, Gemini, or others)? This will really help me guide you better by checking the right parameters and settings. I'm here to help! Sources: livekit-plugins/livekit-plugins-upliftai/livekit/plugins/upliftai/tts.py
c
inworld
t
The
APIStatusError: Bad Request (status_code=400)
in the Inworld TTS plugin usually happens when some parameter values in the request are invalid or not supported. Let’s walk through some key parameters together to make sure everything is set up correctly: • Model: Double-check that the
model
is set to a valid ID, like
"inworld-tts-1"
. • Voice: Make sure you’re using a valid voice ID, such as
"Ashley"
. You can find valid voice IDs by using the Inworld List Voices API. • Encoding: Supported options include
"OGG_OPUS"
,
"LINEAR16"
, and
"MP3"
. • Sample Rate: Verify the
sample_rate
is set to a supported value, for example,
48000
. • Pitch: The
pitch
should be within the range of -20.0 to 20.0 (default is 0.0). • Speaking Rate: Set the
speaking_rate
between 0.25 and 4.0 (default is 1.0). • Temperature: Use a value between 0.6 and 1.0 (default is 0.8). Also, please double-check that your API key is correctly configured and formatted as expected. If you’re still running into issues, capturing the raw API request and response can be really helpful in pinpointing exactly which field might be causing trouble. I’m here to help, so feel free to reach out if you want to go over this together! Sources: Inworld TTS plugin guide | LiveKit Docs | livekit-plugins/livekit-plugins-inworld/livekit/plugins/inworld/__init__.py