Getting Started

ShunyaLabs Text-to-Speech

A high-quality, low-latency speech synthesis API built specifically for Indian languages. Generate natural speech from text with 46 voices across 23 Indic languages and English.


Choose your path

Before you start, decide which synthesis mode fits your use case.

Batch

Batch synthesis

Send text via HTTP POST and receive a complete audio file in a single response. Best for pre-rendered content, notifications, and offline pipelines.

IVR promptsnotificationspodcastsaudiobooks
Get started →
Streaming

Real-time streaming

Open a persistent WebSocket connection and receive audio chunks in real time as synthesis happens. Best for voice agents, IVR, and conversational AI.

voice agentslive IVRconversational AIreal-time playback
Get started →

Key features

Indic-first voices

23 languages, 46 speakers — purpose-built for Indian speech patterns and pronunciation.

Cross-lingual synthesis

Any voice can speak any language. Voice controls accent, not language — mix and match freely.

Expression styles

11 style tags — Happy, Sad, News, Narrative, Conversational, and more — for natural, expressive speech.


Feature overview

FeatureDescription
Indic-first voices23 languages, 46 speakers — purpose-built for Indian speech patterns
Cross-lingual synthesisAny voice can speak any language. Voice controls accent, not language.
Expression styles11 style tags — Happy, Sad, News, Narrative, Conversational, and more
Voice CloningClone any voice from 1–6 seconds of reference audio
7 audio formatsPCM, WAV, MP3, OGG Opus, FLAC, mulaw, alaw
Audio processingSpeed control, silence trimming, volume normalization, background audio

How the API works

BatchStreaming
TransportHTTP POSTWebSocket
InputText stringText chunks
ResponseSingle audio fileAudio chunks in real time
Config objectTTSConfigTTSConfig
Best forPre-rendered content, notificationsVoice agents, IVR, conversational AI

Minimal example

python
import asyncio
from shunyalabs import AsyncShunyaClient
from shunyalabs.tts import TTSConfig

async def main():
    async with AsyncShunyaClient() as client:
        result = await client.tts.synthesize(
            "नमस्ते, आज मौसम बहुत अच्छा है।",
            config=TTSConfig(model="zero-indic", voice="Varun"),
        )
        result.save("output.mp3")

asyncio.run(main())
Environment variable:
Set SHUNYALABS_API_KEY and omit api_key=. The SDK picks it up automatically.

Next steps