> This page is for Model APIs.

> Sarvam Voice Agents (Samvaad) is a voice AI agent platform for Indian languages: build, test and deploy AI calling agents on your own phone numbers, from ₹3 a minute. Start here: https://docs.sarvam.ai/voice-agents/why-voice-agents.
> For clean Markdown of any page, append `.md` to the page URL.
> For a complete documentation index, see https://docs.sarvam.ai/llms.txt. For a section index, append `/llms.txt` to any section URL (for example https://docs.sarvam.ai/voice-agents/llms.txt).
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.sarvam.ai/_mcp/server.

# Choose the Script of the Text

> Use mode to pick the script of the text Dictate returns: Hinglish, Roman Hindi, one script, or every word as spoken.

`mode` decides the script of `text` and how literal it is. Pick it by where the text goes.

| Mode                   | What you get                                                   | Use it for                                                              |
| ---------------------- | -------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `codemix`              | The language in its own script, English words in Latin letters | Chat and messages: WhatsApp, Slack, email                               |
| `transcribe` (default) | One script for everything                                      | A document in one script, search, text that is read aloud               |
| `translit`             | Latin letters only                                             | People who type their language in Latin letters (Roman Hindi, Tanglish) |
| `verbatim`             | Every word as spoken, numbers as words, no edits               | An exact record: legal, medical, an ID read aloud                       |

## Try the four modes

#### Python

```python
import os
from sarvamai import SarvamAI

client = SarvamAI(api_subscription_key=os.environ["SARVAM_API_KEY"])

for mode in ["codemix", "transcribe", "translit", "verbatim"]:
    with open("voice_note.mp3", "rb") as f:
        res = client.dictate.transcribe(file=f, language_code="hi-IN", mode=mode)
    print(f"{mode:>10}: {res.text.splitlines()[0][:100]}")
```

#### JavaScript

```javascript
import fs from "fs";
import { SarvamAIClient } from "sarvamai";

const client = new SarvamAIClient({ apiSubscriptionKey: process.env.SARVAM_API_KEY });

for (const mode of ["codemix", "transcribe", "translit", "verbatim"]) {
  const res = await client.dictate.transcribe({
    file: fs.createReadStream("voice_note.mp3"),
    language_code: "hi-IN",
    mode,
  });
  console.log(`${mode.padStart(10)}: ${res.text.split("\n")[0].slice(0, 100)}`);
}
```

**`Output`**

```text title="Output" wordWrap
   codemix: देखिए भाई साहब, accident में बच्चे का खून काफी बह गया है। आप तो जानती हैं कि AB negative खून बड़ा मु
transcribe: देखिए भाई साहब, एक्सीडेंट में बच्चे का खून काफी बह गया है। आप तो जानती हैं कि AB नेगेटिव खून बड़ा मु
  translit: Dekhiye bhai sahab, accident mein bacche ka khoon kaafi beh gaya hai. Aap to jaanti hain ki AB negat
  verbatim: देखिए भाई साहब, एक्सीडेंट में बच्चे का खून काफी बह गया है। आप तो जानती हैं कि ए बी नेगेटिव खून बड़ा 
```

## Good to know

* Send `language_code` when you know it. `auto` works, but a known language is more reliable.
* There is no `translate` mode. To translate, ask for it in [`style.rules`](/api/api-guides-tutorials/dictate/how-to/style-rules).
* Write the names in your [`vocabulary`](/api/api-guides-tutorials/dictate/how-to/custom-vocabulary) in the script of the mode. With `codemix`, write English names in Latin letters.
* The same setting works on the [live socket](/api/api-guides-tutorials/dictate/how-to/live-dictation): put `mode` in the connection settings.