Text Translation API

Translation Types

English to Indic

Translate from English to various Indian languages with support for different translation modes.

Indic to English

Convert Indian languages to English with high accuracy and natural output.

Indic to Indic

Translate between different Indian languages while preserving context and meaning.

Translation Modes

Formal

Highly professional, uses pure language forms. Ideal for official documents and legal papers.

Classic-Colloquial

Balanced mix of languages, slightly informal. Perfect for business emails and general communication.

Modern-Colloquial

Casual and direct style with mixed language. Best for chatbots and social media content.

Code Examples

1from sarvamai import SarvamAI
2
3client = SarvamAI(
4 api_subscription_key="YOUR_SARVAM_API_KEY"
5)
6
7response = client.text.translate(
8 input="Hello, how are you?",
9 source_language_code="en-IN",
10 target_language_code="hi-IN",
11 speaker_gender="Male"
12)
13
14print(response)

API Features

Translation Options
  • Multiple Indian languages support - Three translation modes - Gender-specific translations - Code-mixed text support
Output Formats
  • Multiple script options - Native/International numerals - Customizable formatting - Transliteration support
Advanced Features
  • Automatic language detection - Context preservation - Entity handling - Preprocessing options
Integration
  • Simple REST API - Multiple language SDKs - Comprehensive documentation - Easy-to-follow examples

Need help with translation? Contact us on discord for guidance.