For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
CommunityAPI StatusAPI PricingSign Up
DocumentationAPI ReferencesCookbookIntegrationDeveloper Tools
DocumentationAPI ReferencesCookbookIntegrationDeveloper Tools
  • Getting Started
    • Welcome
    • Quickstart
    • SDKs & Libraries
    • Building for Indian Languages
    • Models
    • Credits & Rate Limits
    • Errors & Troubleshooting
    • Talk to us
    • Pricing
    • Changelog
  • API Guides & Tutorials
      • Overview
      • Translation
      • Transliteration
      • Language Detection
LogoLogo
CommunityAPI StatusAPI PricingSign Up
On this page
  • Sarvam-Translate
  • Text Processing Features
  • Mayura: Our Text Processing Model
  • Text Processing Features
API Guides & TutorialsText Processing

Text Processing Overview

||View as Markdown|
Was this page helpful?
Previous

Text Translation API

Next
Built with

Sarvam AI offers two powerful text processing models:

Sarvam-Translate

Translation model that supports all 22 official Indian languages and is optimized for structured, long-form text.

Mayura

Advanced text processing model with translation, transliteration, and script conversion capabilities for Indian languages.

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 Translation
Advanced Options

Basic Text Translation

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

  • Support for all 22 scheduled Indian languages
  • Formal Style Translation
  • Numeral Format Control between international and native numeral systems
1from sarvamai import SarvamAI
2
3client = SarvamAI(api_subscription_key="YOUR_SARVAM_API_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 Translation
Advanced Options

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