> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gnani.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Building for Indian languages

> Choose language codes, handle speech that mixes languages, pick a script, and get numbers, names and voices right for Indian languages in the Speech APIs.

Use this guide when your users speak, or your text is written in, an Indian language: which language code to send, what happens when people mix languages, which script you get back, and how to get numbers, names and voices right.

## Languages at a glance

Both Speech-to-Text models (Prisma v3.0 and v2.5) and both Text-to-Speech models cover the same ten languages. Every Timbre v3.0 voice speaks all ten; each Timbre v2.5 voice speaks one.

| Language | Code | Script | Timbre v2.5 voices |
| - | - | - | - |
| Hindi | `hi-IN` | Devanagari | 13 |
| English | `en-IN` | Latin | 6 |
| Bengali | `bn-IN` | Bengali | 2 |
| Gujarati | `gu-IN` | Gujarati | 2 |
| Kannada | `kn-IN` | Kannada | 2 |
| Malayalam | `ml-IN` | Malayalam | 2 |
| Marathi | `mr-IN` | Devanagari | 2 |
| Punjabi | `pa-IN` | Gurmukhi | 2 |
| Tamil | `ta-IN` | Tamil | 5 |
| Telugu | `te-IN` | Telugu | 5 |
| Hinglish | `hi-en` | Devanagari and Latin | 1 (Poorvi). Text-to-Speech only; for speech, see [mixed languages](#people-who-mix-languages). Timbre v3.0: TBC. |

Some Timbre v3.0 voices sound best in particular languages: see [Recommended voices by language](https://docs.gnani.ai/api/TTS/available-voices.md#recommended-voices-by-language). Odia and Urdu are not supported for Speech-to-Text. Voice Cloning languages: TBC.

## Speech-to-Text: which language code to send

| You know | Send `language_code` | Model |
| - | - | - |
| The one language the caller speaks | That code, such as `ta-IN` | Either |
| It is one of a few, such as Hindi or English | A list of 1 to 4, such as `hi-IN,en-IN` | Prisma v3.0 (Prisma v2.5: Batch only, up to 3) |
| Nothing about the language | `indic-auto` | Prisma v3.0 |

Prisma v3.0 tells you the language it heard in `detected_language_code`. That tag comes from the script of the transcript, so:

* **Hindi and Marathi share a script.** A very short utterance in Marathi, such as a greeting or a number, may be tagged `hi-IN`. If you know which one to expect, send only that code.
* **Mostly English with a short Hindi phrase** can be tagged `en-IN`. The native-language tag needs at least 30 % of the letters in the native script.

More in [Detect the language](https://docs.gnani.ai/api/STT/detect-language.md).

## People who mix languages

Callers often switch languages mid-sentence: *मेरा account balance check करना है*. Prisma v3.0 handles mixed-language speech. Choose how the English words are written with `format`:

| `format` | English words | Numbers | Use it for |
| - | - | - | - |
| `verbatim` | In the native script | As words | Seeing exactly what was said |
| `transcribe` | Latin on Prisma v3.0, native script on Prisma v2.5 | Digits | Most apps: search, display, extracting amounts |
| `codemix` | Latin | Mostly as words | Keeping English terms readable without changing numbers |
| `transliterate` | The whole transcript in Latin letters | As words | Users who read Hindi written in English letters |

`codemix` and `transliterate` are Prisma v3.0 only; Prisma v2.5 has `verbatim` and `transcribe`. On either model, `en-IN` accepts Hindi and English mixed audio and returns the transcript in Latin script. Examples with audio are on [Choose an output style](https://docs.gnani.ai/api/STT/output-styles.md).

```bash cURL theme={null}
curl -o mixed.wav https://docs.gnani.ai/audio/samples/hi-IN-en-IN-codemix.wav

curl --request POST \
  --url https://api.vachana.ai/stt/v3 \
  --header "X-API-Key-ID: $GNANI_API_KEY" \
  --form audio_file=@mixed.wav \
  --form model=prisma-v3.0 \
  --form language_code=hi-IN \
  --form format=codemix
```

```python Python theme={null}
import os

import requests

with open("mixed.wav", "rb") as f:
    r = requests.post(
        "https://api.vachana.ai/stt/v3",
        headers={"X-API-Key-ID": os.environ["GNANI_API_KEY"]},
        files={"audio_file": ("mixed.wav", f, "audio/wav")},
        data={"model": "prisma-v3.0", "language_code": "hi-IN", "format": "codemix"},
        timeout=60,
    )
r.raise_for_status()
print(r.json()["transcript"])
```

```javascript Node.js theme={null}
import { readFileSync } from "node:fs";

const form = new FormData();
form.append("audio_file", new Blob([readFileSync("mixed.wav")], { type: "audio/wav" }), "mixed.wav");
form.append("model", "prisma-v3.0");
form.append("language_code", "hi-IN");
form.append("format", "codemix");

const response = await fetch("https://api.vachana.ai/stt/v3", {
  method: "POST",
  headers: { "X-API-Key-ID": process.env.GNANI_API_KEY },
  body: form,
});
const body = await response.json();
console.log(body.transcript);
```

```python Python SDK theme={null}
from gnani.stt import GnaniSTTClient

client = GnaniSTTClient()  # reads GNANI_API_KEY

result = client.transcribe("mixed.wav", model="prisma-v3.0", language_code="hi-IN", format="codemix")
print(result["transcript"])
```

Whether a word counts as English is the model's call: a common English word may still be written in Devanagari. Test with your own recordings before you match on English words.

## Numbers

**Speech-to-Text.** Prisma v3.0 writes digits in every supported language with `format=transcribe`. Prisma v2.5 formats numbers only for `hi-IN` and `en-IN`, with Indian grouping (*5,20,000*), and can write them in the native script (*₹५,०००*) with `itn_native_numerals`. The two models write the same number differently, so test before you parse. See [Format numbers](https://docs.gnani.ai/api/STT/format-numbers.md).

**Text-to-Speech.** Write numbers, amounts, dates and IDs as you would show them on screen; they are read in the request's `language`. Two things to know:

* **Hindi dates:** write *15/03/2026* or *पंद्रह मार्च*. *15 मार्च* was read digit by digit.
* **Set `language`** for non-English text that contains Latin digits. With `auto`, text that is only Latin letters and digits is read as English.

See [Numbers, IDs and dates](https://docs.gnani.ai/api/TTS/tts-input-formating.md).

## Names and local terms

Names of people, places, products and banking terms are the words most often misheard, especially on phone lines.

* **Prisma v3.0:** send up to 200 `keyterms`, in any script, such as `["NACH mandate", "खाता नंबर"]`. Write them in the script you expect in the transcript, and in Latin letters with `format=transliterate`.
* **Prisma v2.5:** `bias_list`, single words only.
* **Realtime:** headers are bytes, so send Indic words as a JSON array with `\u` escapes. See [Indic words in a header](https://docs.gnani.ai/api/STT/stt-websocket.md#indic-words-in-a-header).
* **Text-to-Speech:** for a name that is read wrongly, ask your Gnani contact about a custom pronunciation.

See [Improve names and terms](https://docs.gnani.ai/api/STT/names-and-terms.md).

## Phone calls

Most Indian contact-centre audio is 8 kHz. Send `x-sample-rate: 8000` on Realtime, use the telephony voice-activity settings, and add `keyterms` for names. See [Phone audio](https://docs.gnani.ai/api/STT/phone-audio.md). For audio you play on a phone line, ask Text-to-Speech for `mulaw` or `alaw`: see [Audio formats](https://docs.gnani.ai/api/TTS/audio-formats.md).

## Text-to-Speech: choosing a voice and language

* **Timbre v3.0:** any voice, any of the ten languages. Start with the [recommended voices](https://docs.gnani.ai/api/TTS/available-voices.md#recommended-voices-by-language) for your language, and [listen to them](https://docs.gnani.ai/api/TTS/available-voices.md#listen-to-the-voices).
* **Timbre v2.5:** pick a voice whose language matches your text. For Hinglish, use Poorvi with `hi-en`.
* **Write text in the language's own script.** `auto` picks the language from the script. How romanised text (Hindi in Latin letters) is read: TBC.
* **Voices belong to one model.** A Timbre v2.5 voice sent with `timbre-v3.0`, or the reverse, returns `400`.

## Before you go live

* Test with recordings from your real callers, in each language and on each channel (app, phone).
* Fix the output style with an explicit `format`. Defaults differ between models and SDK versions.
* Check numbers and names: compare your parsed amounts, dates and IDs with what was said.
* Get each caller's consent before recording, and tell callers when they are talking to an automated assistant.

## Related

> [card] [Supported languages](https://docs.gnani.ai/api/STT/languages.md)
>
> Codes, scripts and example sentences for Speech-to-Text.

> [card] [Choose an output style](https://docs.gnani.ai/api/STT/output-styles.md)
>
> Verbatim, digits, codemix or romanised, with audio examples.

> [card] [Available voices](https://docs.gnani.ai/api/TTS/available-voices.md)
>
> Every voice, with a preview, by language.

> [card] [Sample audio](https://docs.gnani.ai/api/introduction/sample-audio.md)
>
> Clips in each language to try the API with.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.