Speak text in a voice and get a link to the audio
POST /Platform/tts/speak
Speak text in a voice and get a link to the audio.
Runs the same path as a call's speech: text normalization, your
organization's pronunciation dictionary, the voice's provider and
model, and the speech cache (a sentence spoken before comes from the
cache). Billed like a call's speech, per character. For long text
use async mode (?async=true) and poll the job; for audio while it
is generated use speak/stream or the speech socket.
Body parameters
text: str. What to say (at most 20,000 characters).provider: optional str. Voice provider, as in an agent'stts.provider; the default call voice when omitted.voice_id: optional str. Voice from the voice list; the provider's default voice when omitted.model_id: optional str. Model; the provider's default model when omitted.speed: optional float. Speed multiplier (0.5 to 2.0); the provider's default when omitted.language: optional str. Two-letter language code of the text, e.g. es.cheaper_streaming: optional bool. Stream the rest of long text in the model's cheaper pair, as on calls.controls: optional VoiceControls or null. The provider's voice controls (seetts.controls), e.g.{"stability": 0.4}.format: optional "wav" or "mp3" or "pcm" or "mulaw". wav (default), mp3, pcm (16-bit little-endian mono) or mulaw (G.711, for phone lines).sample_rate: optional int. Samples per second; 24000 by default, 8000 for mulaw.timestamps: optional bool. True to also return each word with its start and end.
Returns
SpeechResult
audio_url: str. Signed link to the audio in the requested format, valid for 24 hours.format: str. The audio format: wav, mp3, pcm (16-bit little-endian mono) or mulaw.sample_rate: int. Samples per second of the audio.duration_ms: int. Length of the audio in milliseconds.characters: int. Characters synthesized (what speech is billed by).words: optional List[SpokenWord] or null. Each word with its start and end, whentimestampswas true.
Example request
curl -X POST "https://api.hilus.ai/Platform/tts/speak" \
-H "Authorization: Bearer $HILUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'