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.NaturalHD.Alloy or Telnyx.Ultra.<voice_id>). Alternatively, specify provider explicitly along with provider-specific parameters.
Supported providers: aws, telnyx, azure, elevenlabs, minimax, rime, resemble, xai, humain.
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.
Request body
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.