Synthesise speech to an MP3 file
speakSynthesizes text into an MP3 using a selected provider voice, returning the audio, file path, duration, character count, and estimated list-price cost.
Instructions
Synthesises text with a Telnyx voice and writes an MP3 file. Returns the absolute file path, byte size, measured duration, character count and the estimated list-price cost, plus the MP3 itself as an audio block (up to 8 MB, unless TELNYX_TTS_EMBED_AUDIO=false).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"text": "<text>",
"voice": "<voice>"
},
"name": "speak"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rate | No | Speaking rate multiplier (1 = normal). Mapped per provider: voice_speed for Telnyx Ultra/Grok, speed for Minimax/Soniox, SSML <prosody rate> for AWS Polly and Azure. Other providers reject it. | |
| text | Yes | Text to synthesise. Markdown is stripped by Telnyx. | |
| voice | Yes | Voice id in Provider.Model.VoiceId format, e.g. "Telnyx.Ultra.Clara" or "aws.Polly.Vicki". | |
| language | No | BCP-47 language code, e.g. "de-DE". Used by AWS Polly, Azure, ElevenLabs, Inworld and Soniox; ignored by other providers. | |
| file_name | No | Base name for the MP3 inside the output directory. Sanitised; no paths allowed. | |
| text_type | No | Set "ssml" to send your own SSML. Only AWS Polly and Azure support it. | |
| voice_settings | No | Provider-specific tuning. |