Synthesize speech
Synthesize speech from text in a single request. Pass text + voice_id, get back binary audio.
Pick the model with the model body parameter: default lightning_v3.1, or lightning_v3.1_pro for the Pro pool. Other request parameters are identical across models.
Language behaviour on lightning_v3.1_pro: pass language: en for UK + American accented English, pass language: hi for Indian accented English + Hindi (code-switching), or omit language to default to en + hi (mixed Indian + Western English coverage). Pro supports 31 languages total (10 Indic, 8 Asian & Middle Eastern, 13 European including Dutch and Swedish). Pass the matching ISO 639-1 code (e.g. ta, de, ja) with a Pro voice from that language, or use auto to route across all supported languages with any English or Hindi voice. See the Lightning v3.1 Pro model card for the full list. On lightning_v3.1 the model accepts 20 language codes (10 European + 10 Indic) plus auto; the trained voice catalog covers 12 of those directly.
When to use this
- Use this for short utterances you can render before playback (notifications, prompts, batch jobs, audio file generation).
- Use /waves/v1/tts/live when you want playback to start before the full audio is ready (long passages, latency-sensitive apps).
- Use /waves/v1/tts/live (WebSocket) when text arrives incrementally (LLM token streams, live captioning).
Key features
- 44 kHz natural, expressive synthesis
- Model selectable per request via model body parameter
- Cloned voice IDs (voice_*) work on lightning_v3.1 — same param as catalog voices
- 20 accepted language codes on lightning_v3.1 (12 with trained voices, 8 additional routed via English/Hindi voices). On lightning_v3.1_pro: 31 languages with dedicated voices (10 Indic, 8 Asian & Middle Eastern, 13 European); language: en → UK + American accented English; language: hi → Indian accented English + Hindi; omit language → defaults to en + hi. Both models accept language: auto for cross-language routing.
- Output formats: pcm, mp3, wav, ulaw, alaw
- Sample rates: 8 kHz – 44.1 kHz
- Speed: 0.5× – 2×
- Per-call pronunciation dictionaries via pronunciation_dicts
Examples
cURL — Lightning v3.1 (default)
curl -X POST "https://api.smallest.ai/waves/v1/tts" \
-H "Authorization: Bearer $SMALLEST_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: audio/wav" \
-d '{
"text": "Hello from Waves TTS.",
"voice_id": "magnus",
"sample_rate": 24000,
"output_format": "wav"
}' --output speech.wav
cURL — Lightning v3.1 Pro (omit language → defaults to en + hi)
curl -X POST "https://api.smallest.ai/waves/v1/tts" \
-H "Authorization: Bearer $SMALLEST_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: audio/wav" \
-d '{
"text": "Hello from the Lightning v3.1 Pro pool.",
"voice_id": "meher",
"model": "lightning_v3.1_pro",
"sample_rate": 24000,
"output_format": "wav"
}' --output speech.wav
cURL — Lightning v3.1 Pro with explicit language: en (UK + American accented English)
curl -X POST "https://api.smallest.ai/waves/v1/tts" \
-H "Authorization: Bearer $SMALLEST_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: audio/wav" \
-d '{
"text": "Good morning, this is a Pro voice speaking.",
"voice_id": "meher",
"model": "lightning_v3.1_pro",
"language": "en",
"sample_rate": 24000,
"output_format": "wav"
}' --output speech.wav
cURL — Lightning v3.1 Pro with explicit language: hi (Indian accented English + Hindi)
curl -X POST "https://api.smallest.ai/waves/v1/tts" \
-H "Authorization: Bearer $SMALLEST_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: audio/wav" \
-d '{
"text": "Namaste, this is an Indian-accented Pro voice.",
"voice_id": "meher",
"model": "lightning_v3.1_pro",
"language": "hi",
"sample_rate": 24000,
"output_format": "wav"
}' --output speech.wav
Common gotchas
- Set Accept: audio/wav. Omitting it can return an empty or unplayable response.
- Pair voice IDs with the right model. Voice catalogs differ between lightning_v3.1 and lightning_v3.1_pro. The API does not reject mismatched pairings, but using a Pro-only voice_id with model=lightning_v3.1 (or omitting model) can return wrong or hallucinated audio. Pair Pro voices with model=lightning_v3.1_pro; standard catalog voices with model=lightning_v3.1 (the default).
- Cloned voices (voice_* from add_voice) work with lightning_v3.1 only; voice cloning is not available on lightning_v3.1_pro.
- 44.1 kHz output is supported but most playback environments are happy with 24 kHz — drop the sample rate if bandwidth matters.
Headers
Must be audio/wav to receive binary audio. Required for proper playback.
Request body
Example request
{
"output_format": "mp3"
}Response
Synthesized speech retrieved successfully.