Prompt
Why is my speech synthesis request failing for long text?
Latest observation
Oct 11, 2026
OpenAI APIWeb search: off
Most speech-synthesis APIs fail on long input for one of these reasons:
-
Text length limit
- Many services cap the number of characters per request.
- If your text exceeds that limit, the API may return an error or silently truncate.
-
Token/context limits
- If you’re sending the text through an LLM first, the text may exceed the model’s input limit before it even reaches TTS.
-
Payload size / request timeout
- Large requests can exceed HTTP body limits or take too long to process, causing timeouts.
-
Unsupported formatting
- Very long text with lots of punctuation, markup, or special characters may break parsing.
-
Rate limiting or concurrency
- Long requests sometimes trigger retries or exceed per-request quotas.
What to do
- Split the text into smaller chunks and synthesize each chunk separately.
- Keep chunks aligned with natural boundaries:
- paragraphs
- sentences
- dialogue blocks
- Concatenate the audio afterward.
- If the API supports it, use:
- streaming synthesis
- batch jobs
- asynchronous endpoints
Practical rule
If you’re unsure, try:
- ~1–3 paragraphs per request
- or a few thousand characters max, depending on the provider
If you want, paste the exact error message or the API/provider you’re using, and I can tell you the likely limit and how to split the text correctly.