> 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.

# Change the Form of the Text

> Use style.preset and style.rules to drop fillers, make bullets or checklists, translate, and write rupees and times your way.

Two settings change how `text` is written.

* `style.preset` decides how much is tidied: `clean` (default) drops fillers and keeps only the corrected
  version of a self-correction, `light` keeps every word, `none` skips the finishing step.
* `style.rules` is one or more plain sentences that change the form: lists, translation, ₹, 24-hour time.

> **Tip**
>
> **The one rule to remember:** `style.rules` change the form of `text`. They never add or remove content.
> When you need something new (an email, a summary, JSON), use [`output_rules`](/api/api-guides-tutorials/dictate/how-to/structured-output).

## Bullets and translation

#### Python

```python
import os
from sarvamai import SarvamAI

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

BULLETS = 'Put each task on its own line, as a bullet that starts with "- ".'

with open("tasks_ta.wav", "rb") as f:
    res = client.dictate.transcribe(
        file=f,
        language_code="ta-IN",
        mode="codemix",
        style={"rules": "Translate the text into English. " + BULLETS},
    )

print(res.text)
```

#### JavaScript

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

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

const BULLETS = 'Put each task on its own line, as a bullet that starts with "- ".';

const res = await client.dictate.transcribe({
  file: fs.createReadStream("tasks_ta.wav"),
  language_code: "ta-IN",
  mode: "codemix",
  style: { rules: "Translate the text into English. " + BULLETS },
});

console.log(res.text);
```

**`Output`**

```text title="Output" wordWrap
- I need to go to the bank.
- Then I need to phone my mother.
- After that, I need to book a rail ticket on Friday.
```

## Rupees and 24-hour time

#### Python

```python
RUPEE = (
    "Write money amounts as the ₹ sign and digits with Indian digit grouping, "
    "for example ₹1,25,000. Write no currency word after the amount."
)
H24 = "Write times in 24-hour format, for example 15:30."

with open("money.wav", "rb") as f:
    res = client.dictate.transcribe(
        file=f,
        language_code="en-IN",
        style={"rules": RUPEE + " " + H24},
    )

print(res.text)
```

#### JavaScript

```javascript
const RUPEE =
  "Write money amounts as the ₹ sign and digits with Indian digit grouping, " +
  "for example ₹1,25,000. Write no currency word after the amount.";
const H24 = "Write times in 24-hour format, for example 15:30.";

const res = await client.dictate.transcribe({
  file: fs.createReadStream("money.wav"),
  language_code: "en-IN",
  style: { rules: `${RUPEE} ${H24}` },
});

console.log(res.text);
```

**`Output`**

```text title="Output" wordWrap
Please transfer ₹1,25,000 to Ravi by the 5th of December. The call with the bank is at 15:30 in the afternoon and the second one is at 21:15 at night.
```

## Codes and digit strings

Speech recognition writes a spoken string of digits as one number: "seven, four, two" becomes `742`. For a code, an
OTP or a phone number, that is often wrong. Choose how you want the digits:

| You want         | Do this                                                                                         | You get                                                                 |
| ---------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `742`            | Nothing: this is the default                                                                    | `My phone code is 742 and the price is ₹500.`                           |
| `7 4 2`          | Add a rule: `Write spoken digits of a code one by one, separated by spaces, for example 7 4 2.` | `My phone code is 7 4 2 and the price is ₹500.`                         |
| `seven four two` | Send `mode=verbatim`, which keeps number words everywhere                                       | `My phone code is seven four two and the price is five hundred rupees.` |

#### Python

```python
import os
from sarvamai import SarvamAI

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

with open("code.wav", "rb") as f:
    response = client.dictate.transcribe(
        file=f,
        language_code="en-IN",
        style={"rules": "Write spoken digits of a code one by one, separated by spaces, for example 7 4 2."},
    )

print(response.text)  # My phone code is 7 4 2 and the price is ₹500.
```

#### JavaScript

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

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

const response = await client.dictate.transcribe({
  file: fs.createReadStream("code.wav"),
  language_code: "en-IN",
  style: { rules: "Write spoken digits of a code one by one, separated by spaces, for example 7 4 2." },
});

console.log(response.text); // My phone code is 7 4 2 and the price is ₹500.
```

#### curl

```bash
curl -sS https://api.sarvam.ai/v2/dictate \
  -H "api-subscription-key: $SARVAM_API_KEY" \
  -F file=@code.wav -F language_code=en-IN \
  -F 'style={"rules":"Write spoken digits of a code one by one, separated by spaces, for example 7 4 2."}'
```

## Write good rules

| Do                                                                                                  | Why                                            |
| --------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| Name the change with a verb: "Translate the text into English."                                     | A bare word such as "English." is not a change |
| Say what the result looks like: `Put each task on its own line, as a bullet that starts with "- ".` | Gives the exact marker your app needs          |
| Choose the script with [`mode`](/api/api-guides-tutorials/dictate/how-to/choose-script) first       | `mode=translit` gives Roman Hindi with no rule |
| Put new content in `output_rules`                                                                   | `style.rules` cannot add it                    |
| Keep all rules in one string, one sentence each (up to 2,000 characters)                            | `style.rules` is a single string               |

In Telugu and Tamil, number words can stay as words. Add `Write every number as digits.` to get digits.