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

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