Limits & Quotas
Rate Limits
Understand the request-level constraints for Shunya TTS to build reliable integrations.
Limits
| LIMIT | VALUE | NOTES |
|---|---|---|
| Max input length | 10,000 characters | Requests exceeding this limit return HTTP 400. |
| Recommended input length | < 500 characters | Shorter inputs produce faster responses and better prosody. |
| Request timeout | 120 seconds | Server-side timeout. The SDK also defaults to 120 s. |
Exponential Backoff
When you receive a 429 or 503 response, retry with exponential backoff:
python
import asyncio
import random
async def synthesize_with_backoff(client, text, config, max_retries=5):
for attempt in range(max_retries):
try:
return await client.tts.synthesize(text, config=config)
except Exception as e:
if attempt == max_retries - 1:
raise
wait = min(2 ** attempt + random.random(), 30)
print(f"Retry {attempt + 1} in {wait:.1f}s — {e}")
await asyncio.sleep(wait)