Stream speech (real-time TTS)
Stream speech (real-time TTS)
Streaming variant of `/v1/audio/speech`. Returns Server-Sent
Events as the model synthesizes, with sub-130ms time-to-first-byte
on Inworld TTS Mini, sub-250ms on Max. Use this for voice
agents and other interactive playback paths.
Event types:
* `audio.chunk`: base64-encoded audio bytes with `seq`,
`format`, `sample_rate`, and `elapsed_ms` fields. Concatenate
client-side for progressive playback.
* `audio.timestamps`: emitted when `timestamp_type` is
`WORD` or `CHARACTER`, carrying per-token timing info.
* `audio.done`: final event with the assembled hosted URL,
total duration, and usage payload for billing.
* `audio.error`: only on upstream errors; followed by `[DONE]`.
* `[DONE]`: terminator (standard SSE).
Currently supported on Inworld TTS Mini / Max. Other TTS models
use the synchronous `/v1/audio/speech` endpoint. Cancelled
streams are billed for the characters synthesized up to the
cancellation point.
Authentication
AuthorizationBearer
Pass your EmpirioLabs API key as a bearer token. The Anthropic-style
x-api-key header is also accepted on every endpoint.
Request
This endpoint expects an object.
model
input
Text to synthesize. Max 3000 characters per request.
voice
voice_id
Free-form voice ID; use to address the full 271-voice catalog.
language
output_format
Allowed values:
sample_rate
speed
temperature
timestamp_type
Allowed values:
Response
Server-Sent Events stream (text/event-stream).
