Text to speech: long text, up to 2,000 characters as one MP3, natural voices
text_to_speechText to speech for a paragraph or a page: up to 2,000 characters as one MP3 in English (40 voices) or Spanish (10 voices) with Deepgram Aura-2; fr, zh, ja and ko are retired with MeloTTS (Workers AI, 20 Nov 2026). Pick a voice by name or leave the default. Use for narration, article and summary read-outs, voice replies, IVR prompts and accessibility; for a sentence of up to 300 characters ai_speech costs less. Price $0.08/call via x402 USDC or a card key (/credits); failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.
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>"
},
"name": "text_to_speech"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | Language: en or es (Aura-2 MP3, many voices); fr, zh, ja and ko are retired (MeloTTS was removed from Workers AI, 20 Nov 2026); default en | |
| text | Yes | Text to speak, up to 2,000 characters | |
| voice | No | Voice name. English: amalthea, andromeda, apollo, arcas, aries, asteria, athena, atlas, aurora, callista, cora, cordelia, delia, draco, electra, harmonia, helena, hera, hermes, hyperion, iris, janus, juno, jupiter, luna, mars, minerva, neptune, odysseus, ophelia, orion, orpheus, pandora, phoebe, pluto, saturn, thalia, theia, vesta, zeus. Spanish: sirio, nestor, carina, celeste, alvaro, diana, aquila, selena, estrella, javier. Default: luna (en), aquila (es) | |
| format | No | Audio format: mp3 (default), wav, pcm (raw 16-bit little-endian mono), ulaw or alaw (8 kHz telephony, e.g. Twilio), opus (Ogg) or flac. opus and flac only for text spoken in one part (up to 450 characters) | |
| sample_rate | No | Sample rate in Hz for wav and pcm (8000, 16000, 24000 default, 32000, 48000) or ulaw/alaw (8000 default, 16000) | |
| pronunciations | No | How to say words: JSON {"Nginx":"engine x","GIF":"jif"} or Nginx=engine x, GIF=jif (up to 50, whole words, any case) |