> 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. ## At a Glance | | | | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | **Model ID** | `mayura:v1` | | **What it does** | English ↔ Indian language translation with style, script, and numeral control | | **Languages** | 11 (10 Indian + English), `auto` source detection, [full list](#language-support) | | **APIs** | [Translation REST API](/api/api-guides-tutorials/text-processing/translation) (`/translate`) | | **Input limits** | 1,000 characters per request, [all limits](#limits) | | **Benchmarks** | [Corpus BLEU](#corpus-bleu-bilingual-evaluation-understudy-benchmark) | | **Pricing** | [Pricing page](/api/getting-started/pricing) | | **Best for** | Conversational translation, code-mixed text, colloquial output styles | | **Known limitations** | 1,000-character cap; 11 languages. Use [Sarvam-Translate](/api/getting-started/models/sarvam-translate) for all 22 official Indian languages | ## Key Features #### Language Support Support for 11 languages (10 Indian + English). Automatic language detection available by setting source\_language\_code to "auto". #### Translation Modes Multiple translation styles: formal, modern-colloquial, classic-colloquial, and code-mixed for different contexts. #### Script Control Flexible output script options: Roman, native, and spoken forms for customized text representation. #### Smart Processing Numeral format control for improved translation accuracy. #### Context Preservation Maintains meaning and context across languages while handling cultural nuances appropriately. #### Code-Mixed Support 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. > **Note** > > All Indian languages support bidirectional translation with English. To enable automatic language detection, set source\_language\_code to "auto" in your API request. > **Note** > > Use the [Sarvam-Translate](/api/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 #### Basic Usage Simple translation between languages with default settings. Perfect for getting started with the Mayura API. #### Python ```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 ```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(); ``` #### cURL ```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" }' ``` #### Translation Modes Customize the translation style with different modes to match your needs - formal, colloquial, or code-mixed. #### Python ```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 ```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(); ``` #### cURL ```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" }' ``` #### Script Control Control the output script format with options for Roman, native, and spoken forms. #### Python ```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 ```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(); ``` #### cURL ```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" }' ``` > **Note** > > Output script options provide different text representations: > > * roman: "aapka Rs. 3000 ka EMI pending hai" > * fully-native: "आपका रु. 3000 का ई.एम.ऐ. पेंडिंग है।" > * spoken-form-in-native: "आपका थ्री थाउजेंड रूपीस का ईएमअइ पेंडिंग है।" #### Advanced Options Customize language detection for better translation quality. #### Python ```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 ```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(); ``` #### cURL ```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" }' ``` > **Note** > > 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. ## Limits | Limit | Value | | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | | Max input length per request | 1,000 characters (`mayura:v1`) | | Longer texts | Split into chunks of ≤1,000 characters, or use [`sarvam-translate:v1`](/api/getting-started/models/sarvam-translate) (2,000 characters) | | Rate limits | See [Rate Limits](/api/getting-started/ratelimits) | ## Next Steps #### [Developer quickstart](/api/api-guides-tutorials/text-processing/overview) Learn how to integrate translation into your application. #### [API Reference](/api-reference/text/translate-text) Complete API documentation for translation endpoints. #### [Cookbook](/api/api-guides-tutorials/text-processing/translation) Step-by-step tutorial for translation implementation. > Mayura - Advanced multilingual translation model for Indian languages with customizable translation styles, script control, and intelligent code-mixed content handling.