Preview how the voice engine says a sentence
GET /Platform/tts/pronunciations/preview
Preview how the voice engine says a sentence.
Applies the same text normalization and your organization's current
pronunciation dictionary that a call applies, and returns what the
voice engine is sent, so you can check a new entry before any call
uses it. The dictionary is read fresh, so an entry saved a moment ago
already applies. With speak true it also speaks the result and
returns a link to the audio: in the voice you name (the same settings
as an agent's or a phone menu's voice), or the default call voice;
that is one text-to-speech request, billed like a call's speech.
With term and spoken it previews an entry you have not saved,
as if it were in your dictionary; nothing is saved.
Query parameters
text: str. A sentence as the agent would write it (at most 500 characters).spoken_textshows it as the named voice receives it: with that provider's phoneme markup for entries that have IPA.speak: optional bool. True to also synthesize the sentence and returnaudio_url.provider: optional str. Voice provider to speak in, as in a voice's settings; omit for the default call voice.voice_id: optional str. Voice to speak in (from the voice list); omit for the provider's default.model_id: optional str. Voice model, when the provider has several.speed: optional float. Speech speed multiplier (0.5 to 2.0); omit for the provider's default.language: optional str. Two-letter language code of the sentence, e.g. es.term: optional str. A word or phrase to preview an entry for without saving it, as written intext(withspoken).spoken: optional str. How to sayterm, e.g. a phonetic respelling likeWUSS-ter.ipa: optional str. Optional: the sounds oftermin IPA, used where the voice's provider and model accept phonemes.
Returns
PronunciationPreview
text: str. The sentence as given.spoken_text: str. The sentence after text normalization and the pronunciation dictionary: what the voice engine is sent.audio_url: optional str or null. Signed URL of the sentence spoken in the default call voice (WAV, valid for 24 hours); set only whenspeakwas true.
Example request
curl -X GET "https://api.hilus.ai/Platform/tts/pronunciations/preview" \
-H "Authorization: Bearer $HILUS_API_KEY"