{"message": "failed to synthesize speech, retrying...
# ask-ai
b
{"message": "failed to synthesize speech, retrying in 2.0s\nTraceback (most recent call last):\n File \"/Users/dj/Documents/../voice_agent/.venv/lib/python3.12/site-packages/livekit/agents/tts/tts.py\", line 257, in _main_task\n await self._run(output_emitter)\n File \"/Users/dj/Documents/.../voice_agent/.venv/lib/python3.12/site-packages/livekit/plugins/openai/tts.py\", line 238, in _run\n raise APIStatusError(\nlivekit.agents._exceptions.APIStatusError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} (status_code=404, request_id=None, body={'code': '404', 'message': 'Resource not found'}, retryable=False)", "level": "WARNING", "name": "livekit.agents", "tts": "livekit.plugins.openai.tts.TTS", "attempt": 2, "streamed": false, "pid": 11650, "job_id": "......", "timestamp": "2025-11-24T063230.555260+00:00"}
t
Thanks for reaching out, Aman. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I see the 404 "Resource not found" raised by the OpenAI TTS plugin while your agent retried synthesis. To help pinpoint and fix it, please share the following details: 1. Are you using OpenAI or Azure OpenAI as the TTS provider? 2. The exact TTS config you’re passing (model and voice names). Mask secrets/API keys. 3. Any
azure_deployment
and
azure_endpoint
values if using Azure. 4. The environment variables set for keys (just names present, e.g.,
OPENAI_API_KEY
or
AZURE_OPENAI_API_KEY
). 5. A short copy of the debug log around the request/response (if you can enable DEBUG) — especially the outgoing request path or model/voice fields. Quick checks you can run now: • Confirm the model name is one of the supported OpenAI TTS models (for example
gpt-4o-mini-tts
,
tts-1
,
tts-1-hd
). • Confirm the voice is valid (examples:
alloy
,
ash
,
ballad
,
coral
,
echo
,
sage
,
shelby
). • If using Azure, ensure
azure_deployment
exactly matches the deployment name in the Azure portal and
azure_endpoint
includes the full https:// URL. Send the requested config/log snippets and I’ll suggest the exact fix. Sources: OpenAI TTS plugin guide | LiveKit Docs | Events and error handling | LiveKit docs | Azure OpenAI TTS plugin guide | LiveKit Docs | Text-to-speech (TTS) models | LiveKit Docs