Sarvam AI
App · 20 actions
Translate and transliterate text, work with speech and voice libraries, and call Sarvam language models.
Actions
| Action | What it does |
|---|---|
| Convert text to speech | Convert text to speech. |
| Create a chat completion | Create a chat completion. |
| Create a custom voice | Create a custom voice. |
| Delete a custom voice | Delete a custom voice. |
| Delete a pronunciation dictionary | Delete a pronunciation dictionary. |
| Detect a speech watermark | Detect a speech watermark. |
| Get a language model | Get a language model. |
| Get a pronunciation dictionary | Get a pronunciation dictionary. |
| Get a voice | Get a voice. |
| Get document processing capabilities | Get document processing capabilities. |
| Identify the language of text | Identify the language of text. |
| List language models | List language models. |
| List pronunciation dictionaries | List pronunciation dictionaries. |
| List voices | List voices. |
| Replace a pronunciation dictionary file | Replace a pronunciation dictionary file. |
| Transcribe audio | Transcribe audio. |
| Transcribe audio into English | Transcribe audio into English. |
| Translate text | Translate text. |
| Transliterate text | Transliterate text. |
| Upload a pronunciation dictionary | Upload a pronunciation dictionary. |
Convert text to speech
Convert text to speech.
Inputs
- Text
texttextRequired - Text.
- Language code
language_codetextRequired - The language code in BCP-47 format.One of:
bn-IN,en-IN,gu-IN,hi-IN,kn-IN,ml-IN,mr-IN,od-IN,pa-IN,ta-IN,te-IN. - Speaker
speakertext - Speaker.One of:
anushka,abhilash,manisha,vidya,arya,karun,hitesh,aditya,ritu,priya, and 256 more. - Pace
pacenumber - Controls the speed of the audio. Lower values result in slower speech, while higher values make it faster. Default is 1.0. **Model-specific ranges:** - **bulbul:v3:** 0.5 to 2.0 - **bulbul:v4-flash:** 0.5 to 2.0 - **bulbul:v2:** 0.3 to 3.0.From 0.3 to 3.
- Model
modeltext - Model.One of:
bulbul:v2,bulbul:v3,bulbul:v4-flash. - Output audio codec
output_audio_codectext - Specifies the audio codec for the output audio file. Different codecs offer various compression and quality characteristics. **Note:** On `/text-to-speech` with **bulbul:v3** and **bulbul:v4-flash**, `opus` is listed for schema compatibility but currently returns a validation error; use `wav`, `mp3`, `aac`, `flac`, or `linear16`.One of:
mp3,linear16,mulaw,alaw,opus,flac,aac,wav. - Dict ID
dict_idtext - Dict id.
Outputs
dataobject- The response from Sarvam AI.
Example output
{
"data": {
"audios": [
"example"
],
"request_id": "example"
}
}Create a chat completion
Create a chat completion.
Inputs
- Messages
messageslistRequired - Non-empty conversation history. Roles: `system`, `developer`, `user`, `assistant`, `tool`. Content is a string or an array of parts (`text`, `image_url`). Images must use inline `data:image/…;base64,…` URLs. Inline image URLs are required.
- Model
modeltextRequired - Model.One of:
sarvam-105b,sarvam-105b-conversations,glm5.3,glm5.3-flash,gemma4,deepseekv4.1-flash-1017,deepseekv4.1-flash-1017-interactive,deepseekv4-pro,kimi-k3.1-pro,qwen38-27b. - Temperature
temperaturenumber - Sampling temperature from `0` to `2`. Higher values increase variation; lower values focus the output. Output is not guaranteed to be identical across requests, even at `0`. Prefer changing either `temperature` or `top_p`, not both.From 0 to 2.
- Top p
top_pnumber - Nucleus sampling: greater than `0` and at most `1`. On `glm5.3`, `top_p: 0` is rejected. Prefer changing either `top_p` or `temperature`, not both.At most 1.
- Reasoning effort
reasoning_efforttext - Reasoning effort.One of:
none,low,medium,high,max. - Max tokens
max_tokensnumber - Maximum tokens to generate in the completion, including reasoning tokens on reasoning models. Default `2048`. Set explicitly when you need longer answers. A low limit can yield `finish_reason: "length"` with little or no visible `content` if reasoning consumes the budget.At least 1.
Outputs
dataobject- The response from Sarvam AI.
Example output
{
"data": {
"choices": [
{
"finish_reason": "stop",
"index": 1,
"logprobs": {},
"message": {
"content": "example",
"reasoning_content": "example",
"refusal": "example",
"role": "assistant",
"tool_calls": [
{}
]
}
}
],
"created": 1,
"id": "example",
"model": "example",
"object": "chat.completion",
"service_tier": "example",
"system_fingerprint": "example",
"usage": {
"completion_tokens": 1,
"completion_tokens_details": {
"reasoning_tokens": 1
},
"prompt_tokens": 1,
"prompt_tokens_details": {
"cached_tokens": 1
},
"total_tokens": 1
}
}
}Create a custom voice
Create a custom voice.
Inputs
- File
filetextRequired - Reference audio file used to create the cloned voice. Supported formats: WAV, MP3, FLAC, OPUS, AAC, MULAW, ALAW, LINEAR16. WAV is recommended. Limits: max file size 50 MB. Recommended duration is 10-15 seconds, single speaker, minimal background noise.
- Name
nametextRequired - Display name for the cloned voice (1-100 characters).
- Language
languagetextRequired - BCP-47 language code of the reference audio (e.g. `en-IN`, `hi-IN`). The transcript is auto-generated via ASR; you do not need to pass it.
- Style
styletext - Optional speaking style for the cloned voice.One of:
conversational,audiobooks,entertainment,sales. - Gender
gendertext - Optional gender tag for the cloned voice.One of:
male,female. - Remove background noise
remove_background_noisetrue/false - Remove background noise from the reference audio before saving. Uses ML-powered vocal extraction to isolate the speaker's voice. Defaults to `true`. Pass `false` to keep the original clip.
Outputs
dataobject- The response from Sarvam AI.
Example output
{
"data": {
"data": {
"background_noise_removed": true,
"reference_text": "example",
"status": "example",
"voice_id": "example"
},
"status": "example"
}
}Delete a custom voice
Delete a custom voice.
Inputs
- Voice
voice_idtextRequired - ID of the cloned voice to delete.
Outputs
dataobject- The response from Sarvam AI.
Example output
{
"data": {}
}Delete a pronunciation dictionary
Delete a pronunciation dictionary.
Inputs
- Dict ID
dict_idtextRequired - ID of the dictionary to delete.
Outputs
dataobject- The response from Sarvam AI.
Example output
{
"data": {
"message": "example",
"success": true
}
}Detect a speech watermark
Detect a speech watermark.
Inputs
- File
filetextRequired - Audio clip to analyse. Supported formats include WAV, MP3, FLAC, OGG, M4A, and WebM. Max file size 10 MB. Analysis uses at most the first 120 seconds.
Outputs
dataobject- The response from Sarvam AI.
Example output
{
"data": {
"data": {
"algorithm_version": "example",
"analysed_seconds": 1,
"inconclusive": true,
"n_pairs_scored": 1,
"p_value": 1,
"probability": 1,
"verdict": "watermarked",
"z_score": 1
},
"status": "example"
}
}Get a language model
Get a language model.
Inputs
- Model
model_idtextRequired - A model ID from `GET /v2/models`, e.g. `glm5.3`.
Outputs
dataobject- The response from Sarvam AI.
Example output
{
"data": {
"access": "standard",
"created": 1,
"id": "example",
"object": "model",
"owned_by": "example"
}
}Get a pronunciation dictionary
Get a pronunciation dictionary.
Inputs
- Dict ID
dict_idtextRequired - Dict id.
Outputs
dataobject- The response from Sarvam AI.
Example output
{
"data": {
"pronunciations": {}
}
}Get a voice
Get a voice.
Inputs
- Voice
voice_idtextRequired - ID of the cloned voice.
Outputs
dataobject- The response from Sarvam AI.
Example output
{
"data": {
"data": {
"accent": "example",
"created_at": "example",
"created_by": "example",
"created_by_email": "example",
"created_by_name": "example",
"descriptor": "example",
"gender": "example",
"has_preview": true,
"id": "example",
"is_favorited": true,
"language": "example",
"metadata": {},
"name": "example",
"noise_reduction_applied": true,
"preview_audio_url": "example",
"previews": [
{
"audio_url": "example",
"duration": 1,
"text": "example"
}
],
"recorded_audio_url": "example",
"reference_audio_url": "example",
"reference_text": "example",
"sample_duration_seconds": 1,
"source": "example",
"status": "example",
"tags": [
"example"
]
},
"status": "example"
}
}Get document processing capabilities
Get document processing capabilities.
Inputs
None.
Outputs
dataobject- The response from Sarvam AI.
Example output
{
"data": {
"api_contract": "example",
"features": {},
"input_formats": [
"example"
],
"inspection_policies": [
"example"
],
"limits": {
"max_categories": 1,
"max_inline_result_bytes": 1,
"max_segments": 1,
"max_source_bytes": 1,
"max_source_pages": 1
},
"operations": [
"example"
],
"reasoning_input_modes": [
"example"
],
"retention_seconds": 1,
"review_timeout_hours_max": 1,
"split_methods": [
"example"
]
}
}Identify the language of text
Identify the language of text.
Inputs
- Input
inputtextRequired - The text input for language and script identification. Max Input Limit is 1000 characters.
Outputs
dataobject- The response from Sarvam AI.
Example output
{
"data": {
"language_code": "example",
"request_id": "example",
"script_code": "example"
}
}List language models
List language models.
Inputs
None.
Outputs
dataobject- The response from Sarvam AI.
Example output
{
"data": {
"data": [
{
"access": "standard",
"created": 1,
"id": "example",
"object": "model",
"owned_by": "example"
}
],
"object": "list"
}
}List pronunciation dictionaries
List pronunciation dictionaries.
Inputs
None.
Outputs
dataobject- The response from Sarvam AI.
Example output
{
"data": {
"dictionaries": [
"example"
],
"dictionary_count": 1
}
}List voices
List voices.
Inputs
- Search
searchtext - Filter voices by name (substring match).
- Gender
gendertext - Filter by gender tag (`male` or `female`).
- Accent
accenttext - Filter by accent tag.
- Limit
limitnumber - Page size (max 200).From 1 to 200.
- Offset
offsetnumber - Pagination offset.At least 0.
Outputs
dataobject- The response from Sarvam AI.
Example output
{
"data": {
"data": {
"total": 1,
"voices": [
{
"accent": "example",
"created_at": "example",
"created_by": "example",
"created_by_email": "example",
"created_by_name": "example",
"descriptor": "example",
"gender": "example",
"has_preview": true,
"id": "example",
"is_favorited": true,
"language": "example",
"name": "example",
"sample_duration_seconds": 1,
"source": "example",
"status": "example"
}
]
},
"status": "example"
}
}Replace a pronunciation dictionary file
Replace a pronunciation dictionary file.
Inputs
- Dict ID
dict_idtextRequired - ID of the dictionary to update.
- File
filetextRequired - File.
Outputs
dataobject- The response from Sarvam AI.
Example output
{
"data": {
"dictionary_id": "example",
"updated_pronunciations": {}
}
}Transcribe audio
Transcribe audio.
Inputs
- File
filetextRequired - File.
- Model
modeltext - Model.One of:
saaras:v3,saaras:v4. - Mode
modetext - Mode.One of:
transcribe,translate,verbatim,translit,codemix. - Language code
language_codetext - Language code.One of:
unknown,hi-IN,bn-IN,kn-IN,ml-IN,mr-IN,od-IN,pa-IN,ta-IN,te-IN, and 14 more. - With timestamps
with_timestampstrue/false - With timestamps.
- Input audio codec
input_audio_codectext - Input Audio codec/format of the input file. PCM files are supported only at 16kHz sample rate.One of:
wav,x-wav,wave,mp3,mpeg,mpeg3,x-mp3,x-mpeg-3,aac,x-aac, and 14 more. - Keyterms
keytermslist - Keyterms.
Outputs
dataobject- The response from Sarvam AI.
Example output
{
"data": {
"language_code": "example",
"language_probability": 1,
"request_id": "example",
"timestamps": {
"end_time_seconds": [
1
],
"start_time_seconds": [
1
],
"words": [
"example"
]
},
"transcript": "example"
}
}Transcribe audio into English
Transcribe audio into English.
Inputs
- File
filetextRequired - File.
- Prompt
prompttext - Conversation context can be passed as a prompt to boost model accuracy. However, the current system is at an experimentation stage and doesn't match the prompt performance of large language models.
- Model
modeltext - Model.One of:
saaras:v3,saaras:v2.5. - Input audio codec
input_audio_codectext - Audio codec/format of the input file. Our API automatically detects all codec formats, but for PCM files specifically (pcm_s16le, pcm_l16, pcm_raw), you must pass this parameter. PCM files are supported only at 16kHz sample rate.One of:
wav,x-wav,wave,mp3,mpeg,mpeg3,x-mp3,x-mpeg-3,aac,x-aac, and 14 more.
Outputs
dataobject- The response from Sarvam AI.
Example output
{
"data": {
"diarized_transcript": {
"entries": [
{
"end_time_seconds": 1,
"speaker_id": "example",
"start_time_seconds": 1,
"transcript": "example"
}
]
},
"language_code": "hi-IN",
"language_probability": 1,
"request_id": "example",
"transcript": "example"
}
}Translate text
Translate text.
Inputs
- Input
inputtextRequired - 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
source_language_codetextRequired - Source language code.One of:
auto,bn-IN,en-IN,gu-IN,hi-IN,kn-IN,ml-IN,mr-IN,od-IN,pa-IN, and 14 more. - Target language code
target_language_codetextRequired - Target language code.One of:
bn-IN,en-IN,gu-IN,hi-IN,kn-IN,ml-IN,mr-IN,od-IN,pa-IN,ta-IN, and 13 more. - Speaker gender
speaker_gendertext - Please specify the gender of the speaker for better translations.One of:
Male,Female. - Mode
modetext - Specifies the tone or style of the translation. **Model Support:** - **mayura:v1**: Supports formal, classic-colloquial, modern-colloquial, and code-mixed modes - **sarvam-translate:v1**: Only formal mode is supported **Default:** formal.One of:
formal,modern-colloquial,classic-colloquial,code-mixed. - Model
modeltext - 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.One of:
mayura:v1,sarvam-translate:v1. - Output script
output_scripttext - Output script.One of:
roman,fully-native,spoken-form-in-native. - Numerals format
numerals_formattext - Numerals format.One of:
international,native.
Outputs
dataobject- The response from Sarvam AI.
Example output
{
"data": {
"request_id": "example",
"source_language_code": "example",
"translated_text": "example"
}
}Transliterate text
Transliterate text.
Inputs
- Input
inputtextRequired - The text you want to transliterate.
- Source language code
source_language_codetextRequired - The language code of the input text. This specifies the source language for transliteration. Note: The source language should either be an Indic language or English. As we supports both Indic-to-English and English-to-Indic transliteration.One of:
auto,bn-IN,en-IN,gu-IN,hi-IN,kn-IN,ml-IN,mr-IN,od-IN,pa-IN,ta-IN,te-IN. - Target language code
target_language_codetextRequired - The language code of the transliteration text. This specifies the target language for transliteration. Note:The target language should either be an Indic language or English. As we supports both Indic-to-English and English-to-Indic transliteration.One of:
bn-IN,en-IN,gu-IN,hi-IN,kn-IN,ml-IN,mr-IN,od-IN,pa-IN,ta-IN,te-IN. - Numerals format
numerals_formattext - Numerals format.One of:
international,native. - Spoken form numerals language
spoken_form_numerals_languagetext - Spoken form numerals language.One of:
english,native. - Spoken form
spoken_formtrue/false - - Default: `False` - Converts text into a natural spoken form when `True`. - **Note:** No effect if output language is `en-IN`. ### Example: - **Input:** `मुझे कल 9:30am को appointment है` - **Output:** `मुझे कल सुबह साढ़े नौ बजे को अपॉइंटमेंट है`.
Outputs
dataobject- The response from Sarvam AI.
Example output
{
"data": {
"request_id": "example",
"source_language_code": "example",
"transliterated_text": "example"
}
}Upload a pronunciation dictionary
Upload a pronunciation dictionary.
Inputs
- File
filetextRequired - File.
Outputs
dataobject- The response from Sarvam AI.
Example output
{
"data": {
"dictionary_id": "example"
}
}