Text Processing Quickstart

Sarvam AI offers two powerful text processing models:

View our pricing page for detailed information about model-specific pricing and usage tiers.

Sarvam-Translate

Sarvam Translate enables high-quality translation between English and 22 scheduled Indian languages and is optimized for structured, long-form text.

Text Processing Features

Basic Text Translation

Translate structured, long-form text between Indian languages. Features include:

  • Support for all 22 scheduled Indian languages
  • Formal Style Translation
  • Automatic language detection
  • Numeral Format Control between international and native numeral systems
1from sarvamai import SarvamAI
2
3client = SarvamAI(api_subscription_key="YOUR_API_SUBSCRIPTION_KEY")
4
5response = client.text.translate(
6 input="भारत एक महान देश है। इसकी संस्कृति बहुत पुरानी और समृद्ध है।",
7 source_language_code="hi-IN",
8 target_language_code="gu-IN",
9 model="sarvam-translate:v1"
10)
11print(response)

Check out our detailed API Reference to explore Translation and all available options.

Mayura: Our Text Processing Model

Mayura is our state-of-the-art text processing model that excels in handling Indian languages with features like translation, transliteration, and script conversion.

Text Processing Features

Basic Text Translation

Translate text between Indian languages with high accuracy. Features include:

  • Support for multiple Indian languages
  • Automatic language detection
  • Natural and fluent translations
  • Context-aware processing
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="auto",
10 target_language_code="hi-IN",
11 speaker_gender="Male"
12)
13
14print(response)
Key Considerations
  • Maximum text length: 1000 characters per request
  • Supports 10 Indic Langagues and English
  • Automatic language detection available
  • Translation modes: formal (default), modern-colloquial, classic-colloquial, code-mixed

Check out our detailed API Reference to explore Translation and all available options.