Translate Text
Translation converts text from one language to another while preserving its meaning. For Example: ‘मैं ऑफिस जा रहा हूँ’ translates to ‘I am going to the office’ in English, where the script and language change, but the original meaning remains the same.
Available languages:
bn-IN
: Bengalien-IN
: Englishgu-IN
: Gujaratihi-IN
: Hindikn-IN
: Kannadaml-IN
: Malayalammr-IN
: Marathiod-IN
: Odiapa-IN
: Punjabita-IN
: Tamilte-IN
: Telugu
Newly added languages:
as-IN
: Assamesebrx-IN
: Bododoi-IN
: Dogrikok-IN
: Konkaniks-IN
: Kashmirimai-IN
: Maithilimni-IN
: Manipuri (Meiteilon)ne-IN
: Nepalisa-IN
: Sanskritsat-IN
: Santalisd-IN
: Sindhiur-IN
: Urdu
For hands-on practice, you can explore the notebook tutorial on Translate API Tutorial.
Headers
Request
The text you want to translate is the input text that will be processed by the translation model. The maximum is 1000 characters for Mayura:v1 and 2000 characters for Sarvam-Translate:v1.
Source language code for translation input.
mayura:v1 Languages: Bengali, English, Gujarati, Hindi, Kannada, Malayalam, Marathi, Odia, Punjabi, Tamil, Telugu
sarvam-translate:v1 Languages: All mayura:v1 languages and Assamese, Bodo, Dogri, Konkani, Kashmiri, Maithili, Manipuri, Nepali, Sanskrit, Santali, Sindhi, Urdu
Note: mayura:v1 supports automatic language detection using ‘auto’ as the source language code.
The language code of the translated text. This specifies the target language for translation.
mayura:v1 Languages: Bengali, English, Gujarati, Hindi, Kannada, Malayalam, Marathi, Odia, Punjabi, Tamil, Telugu
sarvam-translate:v1 Languages: All mayura:v1 and Assamese, Bodo, Dogri, Konkani, Kashmiri, Maithili, Manipuri, Nepali, Sanskrit, Santali, Sindhi, Urdu
Specifies the tone or style of the translation.
Model Support:
- mayura:v1: Supports formal, classic-colloquial, and modern-colloquial modes
- sarvam-translate:v1: Only formal mode is supported
Default: formal
Specifies the translation model to use.
- mayura:v1: Supports 12 languages with all modes, output scripts, and automatic language detection.
- sarvam-translate:v1: Supports all 22 scheduled languages of India, formal mode only.
This will enable custom preprocessing of the input text which can result in better translations. Recommendation- You can switch on whenever there is some complex text with difficult vocabulary and sentences, for which you want simple translations that people can understand.
output_script: This is an optional parameter which controls the transliteration style applied to the output text.
Transliteration: Converting text from one script to another while preserving pronunciation.
For mayura:v1 - We support transliteration with four options:
null
(default): No transliteration applied.roman
: Transliteration in Romanized script.fully-native
: Transliteration in the native script with formal style.spoken-form-in-native
: Transliteration in the native script with spoken style.
For sarvam-translate:v1 - Transliteration is not supported.
Example:
English: Your EMI of Rs. 3000 is pending.
Default modern translation: आपका Rs. 3000 का EMI pending है (when null
is passed).
With postprocessing enabled:
- roman output: aapka Rs. 3000 ka EMI pending hai.
numerals_format
is an optional parameter with two options (supported for both mayura:v1 and sarvam-translate:v1):
international
(default): Uses regular numerals (0-9).native
: Uses language-specific native numerals.
Example:
- If
international
format is selected, we use regular numerals (0-9). For example:मेरा phone number है: 9840950950
. - If
native
format is selected, we use language-specific native numerals, like:मेरा phone number है: ९८४०९५०९५०
.