Skip to main content

Endpoint

POST https://api.telnyx.com/v2/text-to-speech

Example

curl --request POST \
  --url https://api.telnyx.com/v2/text-to-speech \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "text": "Hello from Telnyx text-to-speech.",
  "voice": "Telnyx.NaturalHD.astra"
}'

Request Body

FieldTypeRequiredDefaultDescription
textstringYesText to synthesize. Markdown is automatically stripped.
voicestringYesDot-separated voice identifier. Format: Provider.Model.VoiceId (e.g., Telnyx.NaturalHD.astra) or Provider.VoiceId when the provider has a single model.
output_typestringNobinary_outputResponse format: binary_output, base64_output, or audio_id.
languagestringNoBCP-47 language code (e.g., en-US). Supported by AWS Polly, Azure, ElevenLabs, and Inworld. Ignored by other providers.
text_typestringNotexttext or ssml. SSML is supported by AWS Polly and Azure. Ultra has its own SSML emotion syntax.
voice_settingsobjectNoProvider-specific tuning (speed, pitch, format, emotion). Fields vary by provider — see individual provider pages.
pronunciation_dict_idstringNoUUID of a custom pronunciation dictionary. Word replacements are applied before synthesis.
disable_cachebooleanNofalseBypass the audio cache and always synthesize fresh.