Text to speech API: speech in 6 languages from text, offline
Updated 2026-11-10
Use when an agent must turn text into spoken audio in English, Spanish, French, Hindi, Italian or Portuguese.
From an MCP client, add https://tanod.dev/mcp and call text_to_speech; the first 5 calls per IP per UTC day are free (shared by all mlpeek tools), then each call is USD 0.005 with x402, no key or signup.
POST up to 2,000 characters of text (English, Spanish, French, Hindi, Italian or Brazilian Portuguese) to /v1/audio/speak. It returns the spoken audio as MP3, WAV or Ogg (Opus), inline as base64, with its duration and size. The voice model, Kokoro-82M (Apache-2.0), runs on Tanod's own CPU: no third-party speech API, no account, no key.
Request
Fields: text (required, 1 to 2,000 characters), voice (default af_heart), speed (0.5 to 2.0, default 1.0) and format (mp3 by default, or wav or ogg). Unknown fields are rejected with a 422.
curl -s -X POST https://tanod.dev/v1/audio/speak \
-H 'content-type: application/json' \
-d '{"text": "Your report is ready.", "voice": "bf_emma", "format": "mp3"}' \
-o reply.json
jq -r .data_base64 reply.json | base64 -d > speech.mp3Without a payment header the call returns 402 with the x402 payment requirements (the body is then those requirements, not audio, so check the status before decoding). An x402 client pays and retries automatically, and the paid retry returns the JSON below.
Response
{
"format": "mp3",
"content_type": "audio/mpeg",
"bytes": 0,
"duration_s": 0.0,
"sample_rate": 24000,
"voice": "af_heart",
"speed": 1.0,
"chars": 0,
"engine": "kokoro-82m (offline)",
"data_base64": "..."
}bytes is the size of the decoded audio, chars the number of characters spoken after control characters are cleaned. Audio is 24 kHz mono: WAV is 16-bit PCM, MP3 is 96 kbit/s, Ogg is Opus.
Voices
41 voices. The first letter of the voice name sets the language and the second the gender (f female, m male). Write the text in the voice's language.
| prefix | language | voices |
|---|---|---|
af_, am_ | English (US) | af_heart (default), af_alloy, af_aoede, af_bella, af_jessica, af_kore, af_nicole, af_nova, af_river, af_sarah, af_sky, am_adam, am_echo, am_eric, am_fenrir, am_liam, am_michael, am_onyx, am_puck, am_santa |
bf_, bm_ | English (UK) | bf_alice, bf_emma, bf_isabella, bf_lily, bm_daniel, bm_fable, bm_george, bm_lewis |
ef_, em_ | Spanish | ef_dora, em_alex, em_santa |
ff_ | French | ff_siwis |
hf_, hm_ | Hindi | hf_alpha, hf_beta, hm_omega, hm_psi |
if_, im_ | Italian | if_sara, im_nicola |
pf_, pm_ | Brazilian Portuguese | pf_dora, pm_alex, pm_santa |
Limits and caveats
There is no language option; the voice decides. Text in another language than the voice's is read with that voice's pronunciation. Japanese and Mandarin are not offered. Text with no letters or digits is a 422 no_speech.
At most 2,000 characters per call (a longer text is a 422). The reply is capped at about 6.5 MB of audio before base64; past that it is a 422 audio_too_long, so send less text or use mp3.
Synthesis stops after about 66 seconds and answers 504. Long text on a busy server can be slow, so send paragraphs separately rather than one huge block.
Validation errors (422), a busy or missing model (503) and a timeout (504) are not settled; you pay only for a 200.
The model is small and open. It sounds natural for short notices and narration, but it can misread names, acronyms and numbers, and there is no SSML or pronunciation control.
The text is not logged and request bodies are not stored; the audio is kept only when output is url, as a download file for 24 hours.
API or local Kokoro
If you can install the model and espeak-ng yourself, running Kokoro locally costs nothing per call. Use this endpoint when the agent runs in a sandbox, has no model install, or needs one stateless call that returns a playable file.
Add "output": "url" to the request and the file is stored for 24 hours and returned as a link (url, expires_at, sha256) instead of base64, which keeps it out of your context window. The price is the same. How the links work.
Price
USD 0.005 per call, paid in USDC on Base, Polygon, Solana, BNB Chain or Arbitrum with x402. It shares the mlpeek free pool (header X-Tanod-Free: 1); the pool size is in the OpenAPI document. MCP tool: text_to_speech at https://tanod.dev/mcp and in the ML family at https://tanod.dev/mcp/ml; over MCP the free allowance is applied automatically, then the call is paid with x402.
Use it from Claude without writing code: in claude.ai or Claude Desktop, add https://tanod.dev/mcp/ml?via=text-to-speech-api as a custom connector (steps), then ask in plain words, for example "Read this paragraph aloud in French and give me the audio." The free daily allowance is applied automatically over MCP. Beyond it a call needs an x402 payment, which these clients can make.
Related guides: Audio transcription API, Translation API, How to get text embeddings with an API, no account. Back to tanod.dev or the guide index. Results are automated and heuristic.