> 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 full documentation content in one file, see https://docs.sarvam.ai/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.sarvam.ai/_mcp/server.

# Mayura

> Mayura - Advanced multilingual translation model for Indian languages with customizable translation styles, script control, and intelligent code-mixed content handling.

Mayura is our powerful translation model designed to convert text between English and Indian languages while preserving meaning and context.
It supports advanced features such as:

* **Customizable translation styles**
* **Script control**
* **Intelligent handling of code-mixed content**

For example:\
`"मैं ऑफिस जा रहा हूँ"` → `"I am going to the office"`\
This preserves the original meaning across different scripts and languages.

## Key Features

Support for 11 languages (10 Indian + English). Automatic language detection available by setting source\_language\_code to "auto".

Multiple translation styles: formal, modern-colloquial, classic-colloquial, and code-mixed for different contexts.

Flexible output script options: Roman, native, and spoken forms for customized text representation.

Numeral format control for improved translation accuracy.

Maintains meaning and context across languages while handling cultural nuances appropriately.

Intelligent handling of mixed-language content common in Indian conversations.

## Language Support

Mayura supports bidirectional translation between the following languages:

Languages (Code):

Hindi (`hi-IN`), Bengali (`bn-IN`), Tamil (`ta-IN`), Telugu (`te-IN`), Gujarati (`gu-IN`), Kannada (`kn-IN`), Malayalam (`ml-IN`), Marathi (`mr-IN`), Punjabi (`pa-IN`), Odia (`od-IN`), English (`en-IN`)

All of the above supports both English ↔ Indian language translations.

All Indian languages support bidirectional translation with English. To enable automatic language detection, set source\_language\_code to "auto" in your API request.

Use the [Sarvam-Translate](/api-reference-docs/getting-started/models/sarvam-translate) model to support all 22 official Indian languages.

## Corpus BLEU (Bilingual Evaluation Understudy) Benchmark

Corpus BLEU score is a metric that evaluates the overall quality of machine translation by comparing it to reference translations across an entire dataset.
Higher scores (closer to 100) indicate better performance.

## Key Capabilities

Simple translation between languages with default settings. Perfect for getting started with the Mayura API.

```python
from sarvamai import SarvamAI

client = SarvamAI(
    api_subscription_key="YOUR_SARVAM_API_KEY"
)

response = client.text.translate(
    input="मैं ऑफिस जा रहा हूँ",
    source_language_code="hi-IN",
    target_language_code="en-IN"
)

print(response)
```

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

const client = new SarvamAIClient({
  apiSubscriptionKey: 'YOUR_SARVAM_API_KEY'
});

async function main() {
  const response = await client.text.translate({
    input: 'मैं ऑफिस जा रहा हूँ',
    source_language_code: 'hi-IN',
    target_language_code: 'en-IN'
  });

  console.log(response);
}

main();
```

```bash
curl -X POST https://api.sarvam.ai/translate \
  -H "api-subscription-key: YOUR_SARVAM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "मैं ऑफिस जा रहा हूँ",
    "source_language_code": "hi-IN",
    "target_language_code": "en-IN"
  }'
```

Customize the translation style with different modes to match your needs - formal, colloquial, or code-mixed.

```python
from sarvamai import SarvamAI

client = SarvamAI(
    api_subscription_key="YOUR_SARVAM_API_KEY"
)

# Translation with style control
response = client.text.translate(
    input="Your EMI of Rs. 3000 is pending",
    source_language_code="en-IN",
    target_language_code="hi-IN",
    mode="modern-colloquial",     # Options: formal, modern-colloquial, classic-colloquial, code-mixed
    speaker_gender="Female"       # For code-mixed translations
)

print(response)
```

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

const client = new SarvamAIClient({
  apiSubscriptionKey: 'YOUR_SARVAM_API_KEY'
});

async function main() {
  // Translation with style control
  const response = await client.text.translate({
    input: 'Your EMI of Rs. 3000 is pending',
    source_language_code: 'en-IN',
    target_language_code: 'hi-IN',
    mode: 'modern-colloquial',     // Options: formal, modern-colloquial, classic-colloquial, code-mixed
    speaker_gender: 'Female'        // For code-mixed translations
  });

  console.log(response);
}

main();
```

```bash
curl -X POST https://api.sarvam.ai/translate \
  -H "api-subscription-key: YOUR_SARVAM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "Your EMI of Rs. 3000 is pending",
    "source_language_code": "en-IN",
    "target_language_code": "hi-IN",
    "mode": "modern-colloquial",
    "speaker_gender": "Female"
  }'
```

Control the output script format with options for Roman, native, and spoken forms.

```python
from sarvamai import SarvamAI

client = SarvamAI(
    api_subscription_key="YOUR_SARVAM_API_KEY"
)

# With script and numeral control
response = client.text.translate(
    input="Your EMI of Rs. 3000 is pending",
    source_language_code="en-IN",
    target_language_code="hi-IN",
    output_script="fully-native",    # Options: roman, fully-native, spoken-form-in-native
    numerals_format="native"         # Options: international, native
)

print(response)
```

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

const client = new SarvamAIClient({
  apiSubscriptionKey: 'YOUR_SARVAM_API_KEY'
});

async function main() {
  // With script and numeral control
  const response = await client.text.translate({
    input: 'Your EMI of Rs. 3000 is pending',
    source_language_code: 'en-IN',
    target_language_code: 'hi-IN',
    output_script: 'fully-native',    // Options: roman, fully-native, spoken-form-in-native
    numerals_format: 'native'         // Options: international, native
  });

  console.log(response);
}

main();
```

```bash
curl -X POST https://api.sarvam.ai/translate \
  -H "api-subscription-key: YOUR_SARVAM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "Your EMI of Rs. 3000 is pending",
    "source_language_code": "en-IN",
    "target_language_code": "hi-IN",
    "output_script": "fully-native",
    "numerals_format": "native"
  }'
```

Output script options provide different text representations:

* roman: "aapka Rs. 3000 ka EMI pending hai"
* fully-native: "आपका रु. 3000 का ई.एम.ऐ. पेंडिंग है।"
* spoken-form-in-native: "आपका थ्री थाउजेंड रूपीस का ईएमअइ पेंडिंग है।"

Customize language detection for better translation quality.

```python
from sarvamai import SarvamAI

client = SarvamAI(
    api_subscription_key="YOUR_SARVAM_API_KEY"
)

# With advanced options
response = client.text.translate(
    input="Your text here",
    source_language_code="auto",    # Set to "auto" to enable automatic language detection
    target_language_code="hi-IN"
)

print(response)
```

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

const client = new SarvamAIClient({
  apiSubscriptionKey: 'YOUR_SARVAM_API_KEY'
});

async function main() {
  // With advanced options
  const response = await client.text.translate({
    input: 'Your text here',
    source_language_code: 'auto',     // Set to "auto" to enable automatic language detection
    target_language_code: 'hi-IN'
  });

  console.log(response);
}

main();
```

```bash
curl -X POST https://api.sarvam.ai/translate \
  -H "api-subscription-key: YOUR_SARVAM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "Your text here",
    "source_language_code": "auto",
    "target_language_code": "hi-IN"
  }'
```

To use automatic language detection, you must explicitly set source\_language\_code to "auto" in your request. The model will then automatically detect the input language.

## Next Steps

Learn how to integrate translation into your application.

Complete API documentation for translation endpoints.

Step-by-step tutorial for translation implementation.