---
title: "Romanized text"
description: "Synthesize Indian-language text typed in Latin letters by setting the romanized field."
---

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

# Romanized text

Indian languages often arrive typed in Latin letters, in chat messages and in
LLM replies written to sound like chat: `aapka EMI kal due hai, please pay karo`.
By default the engine treats any word in Latin letters as English, so `aapka`
and `karo` get English pronunciations.

Send `"romanized": true` and the engine reads those sentences as the language
in `lang` instead. The field exists on both endpoints, and it is off unless you
ask for it.

## Languages

Romanized input works for the nine Indian languages: `bn`, `gu`, `hi`, `kn`,
`ml`, `mr`, `or`, `ta` and `te`. That is every language in
[Voices and languages](/text-to-speech/voices) except `en`.

**Set `lang` to the language the text is written in.** Latin letters do not say
which language they spell, so the engine goes by `lang`. Send romanized Tamil
with `"lang": "hi"` and the Hindi model reads it, which comes out wrong.

## What changes

The engine looks at the text one sentence at a time.

| Sentence | With `"romanized": true` |
| --- | --- |
| `Aapka EMI kal due hai.` | The engine reads it as Hindi. `EMI` and `due` stay English. |
| `आपका बैलेंस 500 रुपये है।` | Unchanged. A sentence with any native-script letters reads the same as without the flag. |
| `Your payment is due tomorrow.` | Unchanged. The engine recognises an English sentence and leaves it as English. |

Inside a romanized sentence the engine reads the language's own words in the
language. English words that belong in the sentence, like `EMI`, `payment` or
`loan`, keep their English pronunciation.

**Pronunciation overrides mostly still apply.** A single word you have given a
pronunciation in `g2p_overrides`, or `g2p_overrides_json` on the WebSocket,
keeps that pronunciation when you type it in capitals, like `KOTAK`. Typed in
lowercase, a key that is also a common word of the language goes through the
romanizer instead. So do the most common words, such as `ka`, `se` and `hai` in
Hindi, however you type them.

If the romanizer fails on some text, the engine reads that text the same as
without the flag. The request does not fail because of it.

Turn it on when the text may contain romanized sentences, such as chat
messages, LLM replies or message templates written in Latin letters. Text that
is all native script or all English sounds the same either way.

Billing does not change. You pay for the characters you send, counted by
Unicode code point.

## Over HTTP

Add `romanized` to the request body of
[`POST /tts/bytes`](/api-reference/synthesize).

```bash
curl -X POST https://tts.navana.ai/tts/bytes \
  -H "X-API-Key: $BODHI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Aapka EMI kal due hai, please 3 baje tak payment kar dijiye.","lang":"hi","output_format":"8000:pcm16","romanized":true}' \
  --output speech.pcm --dump-header -
```

```python
import os, requests

response = requests.post(
"https://tts.navana.ai/tts/bytes",
headers={
    "X-API-Key": os.environ["BODHI_API_KEY"],
    "Content-Type": "application/json",
},
json={
    "text": "Aapka EMI kal due hai, please 3 baje tak payment kar dijiye.",
    "lang": "hi",
    "output_format": "8000:pcm16",
    "romanized": True,
},
timeout=120,
)
response.raise_for_status()

print(response.headers["X-Romanized-Applied"])  # "true"
```

The response body is raw audio, the same as any other `/tts/bytes` call. See
[Non-streaming synthesis](/text-to-speech/non-streaming) to turn it into a WAV.

### The `X-Romanized-Applied` header

The response carries this header when the request included `romanized`, as
`true` or `false`. A request without the field gets no header, so existing
clients see no change.

| Value | Meaning |
| --- | --- |
| `true` | You sent `true` and the server supports romanized input for `lang`, so the text went through the romanizer. Native-script and English sentences in it still come out unchanged. |
| `false` | You sent `false`, or the server has no romanized support for `lang`. The engine read the text the same as without the flag. |

## Over the WebSocket

Add `romanized` to the `hello` frame of
[`wss://tts.navana.ai/v1`](/api-reference/synthesize-streaming).

```json
{
  "type": "hello",
  "lang": "hi",
  "output_format": "24000:pcm16",
  "romanized": true,
  "auth_token": "bd_xxxxxxxxxxxx.xxxxxxxx…"
}
```

Like every `hello` field, it is fixed for the session and applies to every
`text` frame you send on that connection. There is no per-frame switch. To mix
romanized and non-romanized text, open a connection for each.

The stream has no equivalent of the `X-Romanized-Applied` header.

## Errors

Send `true` or `false`. The server refuses strings and numbers, including
`"true"` and `1`. Over HTTP `null` counts as `false`, but the WebSocket refuses
it.

| Endpoint | What you get |
| --- | --- |
| `POST /tts/bytes` | `400` with `{"error": "field 'romanized' must be true or false"}` |
| WebSocket | An `error` frame with `code: "protocol_violation"` and the message `romanized must be true or false`, then close `1008`. The session never opens. |

## Related

- [Synthesize speech](/api-reference/synthesize) — Every request field and response header.
- [Stream synthesis](/api-reference/synthesize-streaming) — Every hello field and frame.
- [Voices and languages](/text-to-speech/voices) — Language codes and voice ids.

Source: https://docs.navana.ai/text-to-speech/romanized-text/index.mdx
