Sonex Labs

Developers · Pāṇini text to speech

Text to speech API for 250+ languages

Pāṇini TTS turns text into speech from one endpoint, including mixed-language text such as Hinglish. Paste the Python on the right, add your key and run it.

Free API tier: 10,000 free text-to-speech characters and one free voice clone that speaks every language, no card required.

Then: $0.03125 per 1,000 characters, the same rate for every language.

speak.py
1# pip install requests
2import requests
3
4r = requests.post(
5 "https://api.sonexlabs.com/v1/speech",
6 headers={"Authorization": "Bearer YOUR_API_KEY"},
7 json={
8 "text": "नमस्ते! आपका order कल शाम तक पहुँच जाएगा।",
9 "output_format": "mp3", # wav, mp3, ogg, opus or mulaw
10 # "voice_id": "...", # optional: GET /v1/voices lists them
11 },
12)
13r.raise_for_status()
14with open("hello.mp3", "wb") as f:
15 f.write(r.content)
16print("characters billed:", r.headers["X-Chars-Billed"])

Only text is required. Text is capped at 5,000 characters per request here; use the streaming endpoint below for longer scripts.

Try it

Pick a language, pick a voice, listen.

39 chars · about 3 s39/220

Voices

    Capabilities

    What the API does today.

    Each option is a field on the same request body. No separate models, no per-feature endpoints.

    Mixed-language text

    Hinglish and beyond

    Pāṇini TTS reads mixed-language text such as Hinglish naturally, in one voice.

    Any voice, any language

    Language comes from the text

    One voice can speak across languages, and a cloned voice carries across languages too. There is no language setting to manage: the language is read from the text itself.

    Voice cloning

    From a 10-second sample

    Upload a short reference recording to POST /v1/voices/clone and use the new voice id in any request. The speaker's accent carries over to every language the clone reads.

    Streaming

    Sentence by sentence

    POST /v1/speech/stream returns audio as it is generated, for text up to 20,000 characters. Pāṇini TTS starts streaming audio in under 200 ms (time to first byte).

    Phone audio

    8 kHz and mu-law

    Pāṇini TTS is trained for 8 kHz phone audio. Request 8000 Hz and mulaw output for telephony bridges, or 16 to 48 kHz for apps and video.

    Formats and speed

    WAV, MP3, OGG, Opus, mu-law

    Pick the output format and sample rate per request, and set speed from 0.5 to 2.0. Every response reports the characters billed in the X-Chars-Billed header.

    Stream long text in Python

    stream.py
    1# pip install requests
    2import requests
    3
    4with requests.post(
    5 "https://api.sonexlabs.com/v1/speech/stream",
    6 headers={"Authorization": "Bearer YOUR_API_KEY"},
    7 json={"text": open("chapter.txt", encoding="utf-8").read(), "sample_rate": 24000},
    8 stream=True,
    9) as r:
    10 r.raise_for_status()
    11 with open("chapter.wav", "wb") as f:
    12 for chunk in r.iter_content(chunk_size=None): # audio arrives sentence by sentence
    13 f.write(chunk)

    Phone-ready audio with cURL

    prompt.sh
    1curl https://api.sonexlabs.com/v1/speech \
    2 --header 'Authorization: Bearer YOUR_API_KEY' \
    3 --header 'Content-Type: application/json' \
    4 --data '{"text": "Your appointment is at 10 am tomorrow.", "output_format": "mulaw", "sample_rate": 8000}' \
    5 --output prompt.wav

    Voices

    Dozens of platform voices, or your own.

    A voice is a recording of one speaker, and the language comes from your text, so any voice can read any supported language. The accent comes from the speaker. Pāṇini TTS has voices recorded by native speakers for Hindi, Tamil, Telugu, Bengali, Marathi, Japanese, English, French, Spanish (Latin American) and Modern Standard Arabic. For other languages, the text is read correctly by a voice from another language; for a local accent, clone a native speaker from a 10-second sample.

    List the voices available to your workspace with GET /v1/voices and pass the id as voice_id.

    Languages

    Text to speech by language.

    Every language costs the same. Each page has a live playground and notes on how that language is written and read.

    See every language grouped by region on text to speech by language, or the full register below.

    The register

    223 of 250 languages listed

    A

    • Abkhazian
    • Afrikaans
    • Albanian
    • Algerian Arabic
    • Amdo Tibetan
    • Amharic
    • Angika
    • Armenian
    • Assamese
    • Asturian
    • Atayal
    • Ayacucho Quechua
    • Azerbaijani

    B

    • Baatonum
    • Bafia
    • Bafut
    • Bamun
    • Banjar
    • Baoulé
    • Basa Cameroon
    • Bashkir
    • Basque
    • Belarusian
    • Bengali
    • Bhili
    • Bhojpuri
    • Bodo
    • Bosnian
    • Braj
    • Breton
    • Buginese
    • Bulgarian
    • Bundeli
    • Burmese

    C

    • Cameroon Pidgin
    • Cantonese
    • Catalan
    • Cebuano
    • Central Nahuatl
    • Central Yupik
    • Chadian Arabic
    • Chhattisgarhi
    • Chichewa
    • Chimborazo Highland Quichua
    • Chinese
    • Chuvash
    • Cornish
    • Croatian
    • Czech

    D

    • Dagbani
    • Danish
    • Dogri
    • Dotyali
    • Dutch
    • Dyula

    E

    • Eastern Balochi
    • Eastern Mari
    • Egyptian Arabic
    • Embu
    • English
    • Erzya
    • Esperanto
    • Estonian
    • Extremaduran

    F

    • Farefare
    • Filipino
    • Finnish
    • French
    • Fulah

    G

    • Galician
    • Ganda
    • Garhwali
    • Georgian
    • German
    • Goan Konkani
    • Greek
    • Guarani
    • Gujarati
    • Gujari
    • Gulf Arabic
    • Gusii

    H

    • Hadothi
    • Haitian
    • Haryanvi
    • Hausa
    • Hawaiian
    • Hebrew
    • Hindi
    • Huautla Mazatec
    • Hungarian

    I

    • Icelandic
    • Igbo
    • Indonesian
    • Interlingua
    • Inupiaq
    • Irish
    • Iron Ossetic
    • Italian

    J

    • Japanese
    • Javanese

    K

    • Kabyle
    • Kalenjin
    • Kamba
    • Kannada
    • Kashmiri
    • Kazakh
    • Khams Tibetan
    • Khmer
    • Kinnauri
    • Kinyarwanda
    • Kirghiz
    • Konkani
    • Korean
    • Kuanyama

    L

    • Lao
    • Latgalian
    • Latvian
    • Levantine Arabic
    • Libyan Arabic
    • Ligurian
    • Lingala
    • Lithuanian
    • Luba-Lulua
    • Luo
    • Lushai
    • Luxembourgish

    M

    • Macedo-Romanian
    • Macedonian
    • Maithili
    • Malay
    • Malayalam
    • Manipuri
    • Manx
    • Maori
    • Marathi
    • Marwari
    • Meru
    • Mesopotamian Arabic
    • Mewari
    • Min Nan Chinese
    • Moksha
    • Mongolian
    • Moroccan Arabic

    N

    • Najdi Arabic
    • Ndonga
    • Neapolitan
    • Nepali
    • Nigerian Pidgin
    • Nimadi
    • Norwegian

    O

    • Occitan
    • Odia
    • Omani Arabic
    • Oromo

    P

    • Pahari-Potwari
    • Paiwan
    • Panjabi
    • Persian
    • Piemontese
    • Plateau Malagasy
    • Polish
    • Portuguese

    R

    • Rangi
    • Romanian
    • Romansh
    • Rombo
    • Russian

    S

    • Sakizaya
    • Sanskrit
    • Santali
    • Saraiki
    • Sardinian
    • Sediq
    • Serbian
    • Shona
    • Sicilian
    • Sikkimese
    • Sindhi
    • Sinhala
    • Slovak
    • Slovenian
    • Somali
    • Soninke
    • Spanish
    • Standard Arabic
    • Sudanese Arabic
    • Swahili
    • Swedish
    • Sylheti

    T

    • Taita
    • Tajik
    • Tamil
    • Tatar
    • Telugu
    • Thai
    • Tibetan
    • Tigrinya
    • Tlingit
    • Toki Pona
    • Tswana
    • Tulu
    • Tunisian Arabic
    • Turkish
    • Turkmen
    • Twi

    U

    • Udmurt
    • Uighur
    • Ukrainian
    • Umbundu
    • Upper Sorbian
    • Urdu
    • Uzbek

    V

    • Vietnamese
    • Võro

    W

    • Welsh
    • Western Mari
    • Wolof

    X

    • Xhosa

    Y

    • Yakut
    • Yangben
    • Yaqui
    • Yoruba

    Z

    • Zarma

    Choosing an API

    How to choose a text to speech API.

    We sell one, so read this as a checklist to apply to every option, us included. The right choice depends on your languages and your channel, not on a ranking.

    Listen in your languages, with your own text

    A demo sentence hides the hard parts. Paste real lines with prices, dates, phone numbers, product names and mixed scripts, and listen to each API in every language you need.

    Ask which languages have a native voice

    Many APIs, this one included, read some languages with a voice recorded in another language, which carries that speaker's accent. Pāṇini TTS has native voices for Hindi, Tamil, Telugu, Bengali, Marathi, Japanese, English, French, Spanish (Latin American) and Modern Standard Arabic. Elsewhere, clone a native speaker.

    Check mixed-language text stays in one voice

    If your text mixes Hindi and English, check the voice does not switch accent or speaker halfway through a sentence.

    Measure time to first audio yourself

    For agents and IVR, what matters is how soon audio starts, measured from the region your servers run in, not the vendor's own benchmark.

    Compare how characters are billed

    Per character, per credit and per minute of audio are hard to compare. Find out whether spaces, markup and retries count, and whether every language costs the same.

    Check formats and rights

    Phone systems need 8 kHz or mu-law; video needs 44.1 or 48 kHz. For cloning, check what consent the vendor asks for and who may use the voice.

    Pricing

    Per character, one rate.

    Bhojpuri costs what English costs. No language tiers, no minimum commitment.

    Pāṇini TTS API$0.03125 / 1K chars
    1,000,000 characters$31.25
    Free to start10,000 chars

    FAQ

    Text to speech API, answered.

    Yes. 10,000 free text-to-speech characters and one free voice clone that speaks every language, no card required. After that, Pāṇini TTS costs $0.03125 per 1,000 characters, the same rate for every language.

    There is no single best one: it depends on your languages, your channel (phone, app or video) and your budget. Use the checklist on this page and test each option on your own text. We sell Pāṇini TTS, so we are not neutral.

    POST your text as JSON to /v1/speech with requests and write the response body to a file, as in the snippet at the top of this page. Add output_format for MP3, Opus or mu-law, and voice_id to pick a voice.

    No. Pāṇini TTS reads the language from the text. The API accepts a language field, but it has no effect on pronunciation, so you can leave it out.

    Yes. Pāṇini TTS is trained for 8 kHz phone audio. Ask for output_format mulaw and sample_rate 8000 to get G.711 mu-law audio in a WAV container.

    Yes, from a 10-second sample, and the free tier includes one clone. The cloned voice can read any supported language; its accent stays the reference speaker's.

    Need the other direction? Valmiki speech to text transcribes audio, billed by the second.

    Make your first audio file in a minute.

    Free tier: 10,000 free text-to-speech characters and one free voice clone that speaks every language, no card required.