Stream Speech With Timestamps
Synthesize speech and stream it back together with word-level speech marks, for text highlighting, captions and audio-text synchronization while the audio is still arriving.
The response is a Server-Sent Events stream. Each speech.chunk event carries a Base64-encoded run of audio, the speech marks that became final with it, or both - a chunk may carry only one of the two, and the last chunk of a stream is often marks-only. A terminal speech.done event ends the stream; there is no [DONE] sentinel. Ignore any event type you do not recognize, so that new event types do not break your integration.
Speech-mark times are absolute milliseconds from the start of the synthesis, so concatenate the audio chunks into one stream and apply the marks against that single timeline. Which chunk a mark arrives on is a delivery detail and carries no meaning. Times stay correct for every output_format: changing the codec or sample rate does not change the duration.
Every model this route accepts produces speech marks here. The default simba-3.0 and simba-3.2 stream marks word by word alongside the audio. The legacy simba-english and simba-multilingual models, still selectable on a workspace pinned before API version 2026-09-21, synthesize a sentence at a time, so their marks arrive a sentence at a time with that sentence's audio; from that version on they return 400 model_retired on every synthesis route, and from 2026-11-21 both ids are served by our current models. For Base64-encoded audio and speech marks in one non-streamed JSON response, use POST /v1/audio/speech.
Request
- Base URL: https://api.speechify.ai
- URL: https://api.speechify.ai/v1/audio/stream/with-timestamps
- Auth: HTTP bearer
Headers
Selects the audio container/codec carried inside the events when output_format is not set in the request body. The selected media type is echoed on the Speechify-Audio-Content-Type response header, since the response's own Content-Type is text/event-stream.
Request body
Response
A Server-Sent Events stream of speech.chunk events followed by one terminal speech.done event. A failure after the stream has started, including a content_policy_violation refusal, is delivered as a speech.error event carrying the standard error envelope, because the status code is already committed.
The transport is text/event-stream: each event is an event:/data: pair whose data is one JSON payload matching the schema below. The payload's type field mirrors the event: name, so the stream is also parseable from data: lines alone. Ignore event types you do not recognize.
Changes
No recorded changes to this operation across all 1 revision of this API.