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. Speech marks are produced by the streaming-native models. Use `simba-3.0` or `simba-3.2`; the legacy `simba-english` and `simba-multilingual` models return 400 `speech_marks_unsupported` here. For Base64-encoded audio and speech marks in one non-streamed JSON response, on any model, use POST /v1/audio/speech.

Authentication

AuthorizationBearer

Enter your API key with the Bearer prefix, e.g. ‘Bearer sk_…’.

Headers

Speechify-VersionstringOptional
AcceptenumOptional

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.

Allowed values:

Request

This endpoint expects an object.
inputstringRequired<=20000 characters

Plain text or SSML to be synthesized to speech. Refer to https://docs.speechify.ai/docs/api-limits for the input size limits. Emotion, Pitch and Speed Rate are configured in the ssml input, please refer to the ssml documentation for more information: https://docs.speechify.ai/docs/ssml#prosody

voice_idstringRequired

Id of the voice to be used for synthesizing speech. Refer to /v1/voices endpoint for available voices

languagestringOptional

Language of the input. Follow the format of an ISO 639-1 language code and an ISO 3166-1 region code, separated by a hyphen, e.g. en-US. Please refer to the list of the supported languages and recommendations regarding this parameter: https://docs.speechify.ai/docs/language-support.

modelenumOptionalDefaults to simba-english

Model used for audio synthesis. simba-english and simba-multilingual are the legacy Simba 1.6 models, kept for compatibility. simba-3.2 is the streaming-native model with the lowest TTFB and richest expressivity, and the recommended Simba 3 model; it is English only, so a non-English voice returns 400. simba-3.0 is streaming-native and multilingual: it officially supports English plus de-DE, es-ES, es-MX, fr-FR, it-IT and pt-BR, and routes each request to its English or its multilingual training based on language (falling back to the voice’s locale when language is omitted).

optionsobjectOptional
GetStreamOptionsRequest is the wrapper for request parameters to the client
output_formatenumOptional

The output audio format as a codec_sampleRate_bitrate string. Takes precedence over the Accept header when set, so you can request formats the Accept enum does not cover (e.g. pcm_16000, ulaw_8000). wav_* formats are not supported on streaming - use POST /v1/audio/speech for wav.

Response headers

Speechify-Request-Idstring
Unique identifier for this request, present on every response (2xx and non-2xx alike). If the caller sends a `Speechify-Request-Id` request header the server echoes it back (sanitized and length-capped) so one logical request can be traced end-to-end; otherwise the server generates a fresh value. Log it on every response and quote it in support requests - it is the stable handle that ties your observation to Speechify's server-side logs, and it matches the `request_id` field in the error envelope. The legacy alias `X-Request-ID` carries the same value and is still accepted on requests, until 2027-07-24. Prefer the un-prefixed name (RFC 6648).
RateLimit-Limitinteger

Request-rate budget: the maximum number of requests in the current window (the bucket capacity). The IETF-draft un-prefixed name; the legacy alias X-RateLimit-Limit carries the same value. Rides every response.

RateLimit-Remaininginteger

Request-rate budget: requests left in the current window. Legacy alias: X-RateLimit-Remaining.

RateLimit-Resetinteger

Request-rate budget: integer delta-seconds until the window fully refills (same unit as Retry-After). Legacy alias: X-RateLimit-Reset.

Speechify-Audio-Content-Typestring

Media type of the audio carried inside the events (for example audio/mpeg), which the response’s own text/event-stream Content-Type cannot express.

Response

A Server-Sent Events stream of speech.chunk events followed by one terminal speech.done event. A failure after the stream has started is delivered as a speech.error event carrying the standard error envelope, because the status code is already committed.

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error
500
Internal Server Error
502
Bad Gateway Error
503
Service Unavailable Error