Text to speech (WAV)
text_to_speech[PAID $0.005 USDC per call via x402 on Base; errors are free] Turn text (up to 2000 chars) into spoken audio with MeloTTS on Cloudflare Workers AI, in English, Spanish, French, Chinese, Japanese or Korean. Returns JSON with audio_base64 + mimeType (audio/wav, 44.1 kHz mono), or the raw audio bytes with format=wav. Good for voice replies, narration, accessibility and language practice. Text with sexual, hateful or violent content is refused (HTTP 400, not charged). All params optional: with none it speaks a short English sample. GET with query params or POST a JSON body.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "text_to_speech"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | Language of the text / voice (default en). | |
| text | No | Text to speak (max 2000 chars). Optional: defaults to a short English sample. |