audio

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.

post/v1/audio/stream

Request

  • Base URL: https://api.speechify.ai
  • URL: https://api.speechify.ai/v1/audio/stream
  • Auth: HTTP bearer

Headers

Speechify-Versionstring
Accept'audio/mpeg' | 'audio/ogg' | 'audio/aac' | 'audio/pcm'

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.

Request body

inputstring required

Plain text or SSML to be synthesized to speech. Up to 20,000 characters as sent, SSML markup included. Refer to https://docs.speechify.ai/docs/api-limits for the input size limits. SSML sets pauses (<break>), speaking rate (<prosody rate>) and pronunciation (<sub alias>): see https://docs.speechify.ai/build/guides/text-to-speech/ssml for each tag. Emotion styles, pitch, volume and emphasis are applied only by the Simba 1.6 models, until 2026-11-21; simba-3.2 and simba-3.0 accept those tags without applying them.

languagestring

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.

model'simba-3.0' | 'simba-3.2'

Model used for audio synthesis. Defaults to simba-3.0, which 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). 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.

The legacy Simba 1.6 models simba-english and simba-multilingual are retired from API version 2026-09-21: naming one returns 400 model_retired. Pinning your API version to a date before 2026-09-21 keeps them on their Simba 1.6 training until 2026-11-21; from then both ids are served by our current models on every API version that can still name them. Migrate to simba-3.2 (English) or simba-3.0 before then; call GET /v1/audio/models to see the set your workspace can select today.

output_format'pcm_8000' | 'pcm_16000' | 'pcm_22050' | 'pcm_24000' | 'pcm_44100' | 'pcm_48000' | 'mp3_22050_32' | 'mp3_22050_64' | 'mp3_22050_96' | 'mp3_22050_128' | 'mp3_22050_160' | 'mp3_22050_192' | 'mp3_24000_32' | 'mp3_24000_64' | 'mp3_24000_96' | 'mp3_24000_128' | 'mp3_24000_160' | 'mp3_24000_192' | 'ulaw_8000' | 'ogg_24000' | 'aac_24000'

Audio output format for the streaming endpoint (POST /v1/audio/stream), as a codec_sampleRate_bitrate string. Same as AudioOutputFormat minus the wav_* formats: wav is only available on POST /v1/audio/speech. pcm_* and ulaw_8000 are headerless raw audio; pcm_16000 and ulaw_8000 are the telephony formats Twilio/LiveKit SIP expect. From API version 2026-09-30, pcm_16000 is 16 kHz audio; a workspace pinned to an earlier version keeps receiving 24 kHz audio for pcm_16000, as it always has.

160 kbps is the highest bitrate an mp3 can carry at 22.05 and 24 kHz, so mp3_22050_160 and mp3_24000_160 are the maximum-fidelity mp3 formats; a request for mp3_*_192 is encoded at 160 kbps. The two mp3_*_160 formats are served by the Simba 3 models only.

safety_identifierstring

A stable, opaque identifier for the end user of your application on whose behalf this request is made. Use it when many of your own users share one Speechify workspace, for example behind a gateway, a reseller or a consumer app.

Send a hash of your internal user id (for example a hex or base64 SHA-256), or an opaque id that means nothing outside your system. Never send an email address, a name, a phone number or any other personal data: the field accepts only letters, digits and . _ - : | + / =, so an email address is refused with 400 validation_failed.

The identifier is request metadata, not content. It is recorded with the request even when your workspace has zero data retention, so abuse can be attributed to one end user rather than to your whole workspace. When your workspace has per-end-user limits, it also has its own rate and concurrency allowance inside the workspace's (429 with a message naming the safety_identifier), and a blocked identifier is refused with 403 safety_identifier_blocked while your other end users are unaffected. Omitting it changes nothing. See https://docs.speechify.ai/build/guides/concepts/safety-identifiers.

voice_idstring required

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

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. A content policy refusal that lands after the audio has started aborts the transfer, so the client raises instead of completing the body; only a completed transfer was served in full.

Changes

No recorded changes to this operation across all 1 revision of this API.