OtherAPI ReferenceText-to-Speech

Generate speech

Generates audio from text using the TTS REST endpoint.

POST
https://tts-rt.soniox.com/tts

Generates audio from text using the TTS REST endpoint.

Headers

AuthorizationRequiredBearer <SONIOX_API_KEY>

Request

application/jsonRequired
modelRequiredstring

TTS model to use.

Default: "tts-rt-v1"
languageRequiredstring

Language code of the input text.

voiceRequiredstring

Voice to use: a built-in voice name (for example Adrian) or the ID of a cloned voice.

audio_formatRequiredstring

Output audio format (for example mp3, wav, pcm_s16le, pcm_s16be).

textRequiredstring

Input text to generate audio from.

sample_rateinteger

Optional output sample rate in Hz.

bitrateinteger

Optional output bitrate in bits per second.

client_reference_idstring

Optional tracking identifier string. Does not need to be unique. Ignored if the request authenticates with a temporary API key.

Maximum length: 256
speednumber

Optional speaking rate of the generated speech, from 0.7 to 1.3. 1.0 is the normal speed; lower values slow speech down and higher values speed it up. Defaults to 1.0.

reduce_silenceboolean

Optional. When true, shortens the pauses between words so the generated speech flows more naturally. Defaults to false. Only supported on models with supports_silence_reduction set to true; enabling it on any other model returns an invalid_request error.

Header parameters

X-Request-Idstring

Optional request ID for tracing.

Response

200

Generated audio stream.

Response body contains raw audio bytes.

responseRequiredstring
Format: "binary"

Errors

Generated audio stream.

Response body contains raw audio bytes.

"string"