Transliteration API

Transliteration Types

Romanization

Convert Indic scripts to Roman script (English alphabet). Example: मैं ऑफिस → main office

Indic Script Conversion

Convert code-mixed, romanized, or English text to Indic scripts. Example: main office → मैं ऑफिस

Spoken Form

Convert written text to natural spoken form. Example: 9:30am → सुबह साढ़े नौ बजे

Code Examples

1from sarvamai import SarvamAI
2
3client = SarvamAI(
4 api_subscription_key="YOUR_SARVAM_API_KEY"
5)
6
7response = client.text.transliterate(
8 input="मैं ऑफिस जा रहा हूँ",
9 source_language_code="hi-IN",
10 target_language_code="en-IN",
11 spoken_form=True
12)
13
14print(response)

API Features

Input Options
  • Multiple Indic languages - Code-mixed text support - Romanized text input
  • English text input
Output Formats
  • Roman script (English) - Native script conversion - Spoken form output - Natural number formats
Number Handling
  • International numerals (0-9) - Native numerals (१-९) - English number words
  • Native number words

API Response Format

request_id
string

Unique identifier for the request

transliterated_text
stringRequired

The transliterated text result in the requested target language script

Example: "main office ja raha hun"

source_language_code
stringRequired

The detected or provided source language of the input text in BCP-47 format

Supported Languages: bn-IN, en-IN, gu-IN, hi-IN, kn-IN, ml-IN, mr-IN, od-IN, pa-IN, ta-IN, te-IN

Example: "hi-IN"

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