Text To Speech Commands

Generate speech from text

Generate synthesized speech audio from text input. Returns audio in the requested format (binary audio stream, base64-encoded JSON, or an audio URL for later retrieval).

Authentication is provided via the standard Authorization: Bearer <API_KEY> header.

The voice parameter provides a convenient shorthand to specify provider, model, and voice in a single string (e.g. Telnyx.Ultra.<voice_id>). Alternatively, specify provider explicitly along with provider-specific parameters.

Supported providers: aws, telnyx, azure, elevenlabs, minimax, resemble, xai, humain, soniox.

The Telnyx Ultra model supports 44 languages with emotion control, speed adjustment, and volume control. Use the telnyx provider-specific parameters to configure these features.

post/text-to-speech/speech

Request body

voicestring

Voice identifier in the format provider.model_id.voice_id or provider.voice_id. Examples: Telnyx.Ultra.<voice_id>, Telnyx.Bayan.Ahmed, Telnyx.Sukhan.urdu-professor, azure.en-US-AvaMultilingualNeural, aws.Polly.Generative.Lucia. When provided, provider, model_id, and voice_id are extracted automatically and take precedence over individual parameters.

textstring

The text to convert to speech.

provider'aws' | 'telnyx' | 'azure' | 'elevenlabs' | 'minimax' | 'resemble' | 'xai' | 'humain' | 'soniox'

TTS provider. Required unless voice is provided.

languagestring

Language code (e.g. en-US). Usage varies by provider.

text_type'text' | 'ssml'

Text type. Use ssml for SSML-formatted input (supported by AWS and Azure).

output_type'binary_output' | 'base64_output'

Determines the response format. binary_output returns raw audio bytes, base64_output returns base64-encoded audio in JSON.

disable_cacheboolean

When true, bypass the audio cache and generate fresh audio.

voice_settingsobject

Provider-specific voice settings. Contents vary by provider — see provider-specific parameter objects below.

Response

Speech generated successfully. The response format depends on the output_type parameter:

  • binary_output (default): Returns raw audio bytes with the appropriate Content-Type header. Most providers return audio/mpeg; humain has no MP3 output and always returns raw headerless PCM16LE 24kHz mono as audio/pcm.
  • base64_output: Returns a JSON object with base64_audio field.
base64_audiostring

Base64-encoded audio data.

Changes

Changed in 3 of the 99 revisions of this API.125

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the new soniox enum value to the request property

      request-property-enum-value-added

  • a6a61a29ecdd12See the full diff
    • ▲

      removed the enum value rime of the request property

      request-property-enum-value-removed

    • ●

      removed the request property

      request-property-removed

    • ●

      removed the request property /

      request-property-removed

    This revision also has 34 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the new humain enum value to the request property

      request-property-enum-value-added

    • ○

      added the media type audio/pcm for the response with the status

      response-media-type-added

Of the 99 revisions, 1 has no diff computed.