Skip to main content
Panini is SomyaLabs’ text-to-speech model. It streams natural, low-latency audio via POST /v1/speech/synthesize.

Request

Supported languages

Panini supports 15 languages:

Voices

You select a language by choosing a voicevoice is the request parameter; there is no separate language field. The named voices: Omit voice (or send "") to use the default voice.
Pass the slug (e.g. kiran) as voice. panini is the model name, not a voice. For the live, account-specific list call GET /v1/voices (curl https://api.somya.ai/v1/voices -H "X-API-Key: YOUR_API_KEY").

Streaming response (NDJSON)

The endpoint responds with application/x-ndjson — one JSON object per line:
Two ways to consume it:
  • Stream playback — decode each chunk_b64 as it arrives and play the chunks back-to-back to start audio almost immediately.
  • Whole file — ignore partials and keep the is_final: true chunk; it’s the complete WAV, ideal for saving or replay.
Python — save the final WAV

Reference audio

ref_audio conditions synthesis on a reference sample (voice cloning / style transfer). For reusable custom voices, upload one via POST /v1/voices and then pass its slug as voice.
The accepted ref_audio encoding (e.g. URL vs. base64) and custom-voice upload requirements are environment-specific — check the API Reference for the current schema before using it in production.