Stream Speech

Synthesize speech and stream the audio back as it is generated, for low-latency playback. Set `output_format` in the body for explicit codec/sample-rate/bitrate control (e.g. `pcm_16000` or `ulaw_8000` for telephony), or fall back to the Accept header for the container; the response is raw audio bytes (HTTP chunked). For Base64-encoded audio with speech-mark metadata in a single JSON response, 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 for the streamed response when `output_format` is not set in the request body. The response Content-Type echoes this value, except `audio/pcm` returns `audio/L16` with rate and channels parameters (raw 16-bit linear PCM, 24 kHz mono, little-endian). For explicit sample-rate/bitrate control (e.g. `pcm_16000`, `ulaw_8000`), set `output_format` in the body instead; it takes precedence over this header.
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 is optimized for English, simba-multilingual for non-English or mixed input. simba-3.2 is the streaming-native model with lower TTFB and richer expressivity, and the recommended Simba 3 model. simba-3.0 is the earlier Simba 3.0 model, still available. simba-3.0 and simba-3.2 are currently English only; multilingual coming soon, and non-English voices return 400 until it ships.

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

X-Request-IDstring
Unique identifier for this request, present on every response (2xx and non-2xx alike). If the caller sends an `X-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.
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.

Response

Streamed audio. When output_format is set it selects the codec/sample rate; otherwise the Accept header does. The Content-Type reflects the selected format: it matches the Accept header, except raw PCM returns audio/L16 (with rate and channels parameters) and u-law returns audio/basic.

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