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 withseq,format,sample_rate, andelapsed_msfields. Concatenate client-side for progressive playback.audio.timestamps: emitted whentimestamp_typeisWORDorCHARACTER, carrying per-token timing info.audio.done: final event with the complete file’s hostedurland itsformat, the total duration, andusage, plusvoice_idandvoice_id_expires_atwhen the request created a custom voice.audio.warning: a notice with amessagethat does not end the stream, for example when the hosted copy of the audio could not be created;audio.donethen has an emptyurl.audio.error: a failure after the stream started, with itstype,seq, anderror; followed by[DONE].[DONE]: terminator (standard SSE).
A failure before the first event returns an ordinary error
response with the HTTP status of that failure, such as 400,
404, or 429, instead of a stream.
Models that stream list POST /v1/audio/speech:stream in
supported_endpoints on GET /v1/models/{id}; other TTS models
use the synchronous /v1/audio/speech endpoint. Billing matches
/v1/audio/speech for the same model, and a stream the client
cancels is billed for the synthesis the model completed.
On Gemini 3.8 Flash TTS and Flash-Lite TTS, every audio.chunk
carries 16-bit PCM at 24 kHz, and audio.done links the complete
file in the requested output_format and sample_rate. speed
is available on /v1/audio/speech only.
Authentication
Pass your EmpirioLabs API key as a bearer token. The Anthropic-style
x-api-key header is also accepted on every endpoint.
Request
Free-form voice ID; use to address the full 271-voice catalog.
Response
Server-Sent Events stream (text/event-stream).
