I got this error when using hume as TTS: ```2025-0...
# ask-ai
a
I got this error when using hume as TTS:
Copy code
2025-09-10 00:50:18,223 - WARNING livekit.agents - failed to synthesize speech, retrying in 0.1s
Traceback (most recent call last):
  File "/Users/affahrizain/kata-ai/dda-ai-agent/.venv/lib/python3.13/site-packages/livekit/plugins/hume/tts.py", line 260, in _run
    resp.raise_for_status()
    ~~~~~~~~~~~~~~~~~~~~~^^
  File "/Users/affahrizain/kata-ai/dda-ai-agent/.venv/lib/python3.13/site-packages/aiohttp/client_reqrep.py", line 1161, in raise_for_status
    raise ClientResponseError(
    ...<5 lines>...
    )
aiohttp.client_exceptions.ClientResponseError: 422, message='Unprocessable Entity', url='https://api.hume.ai/v0/tts/stream/json'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/affahrizain/kata-ai/dda-ai-agent/.venv/lib/python3.13/site-packages/livekit/agents/tts/tts.py", line 228, in _main_task
    await self._run(output_emitter)
  File "/Users/affahrizain/kata-ai/dda-ai-agent/.venv/lib/python3.13/site-packages/livekit/plugins/hume/tts.py", line 287, in _run
    raise APIConnectionError() from e
livekit.agents._exceptions.APIConnectionError: Connection error. (body=None, retryable=True) {"tts": "livekit.plugins.hume.tts.TTS", "attempt": 1, "streamed": false, "pid": 64591, "job_id": "AJ_eXtTjd8NzrXy"}
these are my installed libraries
Copy code
livekit                                  1.0.12
livekit-agents                           1.2.2
livekit-api                              1.0.5
livekit-blingfire                        1.0.0
livekit-plugins-azure                    1.0.21
livekit-plugins-cartesia                 1.2.2
livekit-plugins-deepgram                 1.2.2
livekit-plugins-elevenlabs               1.2.2
livekit-plugins-groq                     1.2.2
livekit-plugins-hume                     1.2.2
livekit-plugins-noise-cancellation       0.2.3
livekit-plugins-openai                   1.2.2
livekit-plugins-silero                   1.2.2
livekit-plugins-turn-detector            1.2.2
livekit-protocol                         1.0.4
how to fix it?
t
Thanks for reaching out, affandy. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm here to help you understand the "422 Unprocessable Entity" error you’re encountering with the Hume TTS API. This error usually means your request is well-formed but has some invalid parameters. Let’s walk through some common reasons and how to fix them: • Omitting a Voice in Instant Mode: If you have "instant_mode" enabled but haven’t specified a "voice," the request won’t go through. Make sure to include a valid voice when using instant mode. • Malformed Payload: It’s a good idea to double-check your JSON payload, especially the "utterances" array and the "format" field, to ensure everything is correctly formatted and all required fields are included. • Invalid Parameters: Please verify that the "speed" parameter is set between 0.25 and 3.0, and that the "description" is under 1000 characters. To get to the bottom of this, take a look at the specific error message returned by the Hume API—it usually points out exactly which parameter needs attention. If you’d like, I’m more than happy to help you debug your configuration or payload further. Just let me know! Sources: tests/test_agent_session.py | Hume TTS integration guide | LiveKit Docs | errors.go