Limits & Quotas

Rate Limits

Understand the request-level constraints for Shunya TTS to build reliable integrations.


Limits

LIMITVALUENOTES
Max input length10,000 charactersRequests exceeding this limit return HTTP 400.
Recommended input length< 500 charactersShorter inputs produce faster responses and better prosody.
Request timeout120 secondsServer-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)