- Preamble — a short acknowledgement that can play immediately.
- First sentence — the first complete sentence from the model response.
- Remainder — the rest of the response, split only at natural sentence boundaries.
Concurrency budget
Studio and Developer API generations share the account’s concurrent-generation limit. Starter accounts have six concurrent generations, so a character application should normally use an application-side semaphore of 5. The spare slot leaves room for Studio activity, cancellation overlap, and another product flow. One logical reply split into three simultaneous requests consumes three slots. A second reply can therefore reach the six-slot account limit before the first reply finishes. When that happens, Breeze returns429 GENERATION_CONCURRENCY_EXCEEDED with Retry-After; it does not queue the request on your behalf.
Retry policy
- Retry
429after the delay inRetry-After, adding a small amount of jitter. - Retry transient
502,503, and504responses with bounded exponential backoff. - Do not retry
400or422without changing the request. - Set a maximum attempt count and discard remainders that have lost their playback value.
- Log the Breeze request or trace ID, HTTP status, and stable error code. Do not log API keys or full private dialogue text.
Python example
TypeScript example
async-mutex package. You can replace it with any bounded semaphore already used by your application.
Language handling
language_code is optional for breeze-tts-2. Short English and Chinese text, including Hi and OK, is resolved without requiring the field. When your character has a fixed language, explicitly send language_code: "en" or language_code: "zh" to make intent unambiguous. Multilingual preview models remain conservative and can ask for an explicit language when a short input cannot be identified reliably.
Choosing HTTP or realtime WebSocket
Use HTTP streaming when you already have a complete preamble or sentence and want independent encoded streams. Use the realtime text-to-speech WebSocket when text arrives incrementally and you want one persistent synthesis connection with turn cancellation and barge-in.Rate limits
Review account concurrency,
Retry-After, and realtime session limits.
