Sarvam AI

App · 20 actions

Translate and transliterate text, work with speech and voice libraries, and call Sarvam language models.

Actions

ActionWhat it does
Convert text to speechConvert text to speech.
Create a chat completionCreate a chat completion.
Create a custom voiceCreate a custom voice.
Delete a custom voiceDelete a custom voice.
Delete a pronunciation dictionaryDelete a pronunciation dictionary.
Detect a speech watermarkDetect a speech watermark.
Get a language modelGet a language model.
Get a pronunciation dictionaryGet a pronunciation dictionary.
Get a voiceGet a voice.
Get document processing capabilitiesGet document processing capabilities.
Identify the language of textIdentify the language of text.
List language modelsList language models.
List pronunciation dictionariesList pronunciation dictionaries.
List voicesList voices.
Replace a pronunciation dictionary fileReplace a pronunciation dictionary file.
Transcribe audioTranscribe audio.
Transcribe audio into EnglishTranscribe audio into English.
Translate textTranslate text.
Transliterate textTransliterate text.
Upload a pronunciation dictionaryUpload a pronunciation dictionary.

Convert text to speech

Convert text to speech.

Inputs

TexttexttextRequired
Text.
Language codelanguage_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.
Speakerspeakertext
Speaker.One of: anushka, abhilash, manisha, vidya, arya, karun, hitesh, aditya, ritu, priya, and 256 more.
Pacepacenumber
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.
Modelmodeltext
Model.One of: bulbul:v2, bulbul:v3, bulbul:v4-flash.
Output audio codecoutput_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 IDdict_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

MessagesmessageslistRequired
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.
ModelmodeltextRequired
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.
Temperaturetemperaturenumber
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 ptop_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 effortreasoning_efforttext
Reasoning effort.One of: none, low, medium, high, max.
Max tokensmax_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

FilefiletextRequired
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.
NamenametextRequired
Display name for the cloned voice (1-100 characters).
LanguagelanguagetextRequired
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.
Stylestyletext
Optional speaking style for the cloned voice.One of: conversational, audiobooks, entertainment, sales.
Gendergendertext
Optional gender tag for the cloned voice.One of: male, female.
Remove background noiseremove_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

Voicevoice_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 IDdict_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

FilefiletextRequired
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

Modelmodel_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 IDdict_idtextRequired
Dict id.

Outputs

dataobject
The response from Sarvam AI.
Example output
{
  "data": {
    "pronunciations": {}
  }
}

Get a voice

Get a voice.

Inputs

Voicevoice_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

InputinputtextRequired
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

Searchsearchtext
Filter voices by name (substring match).
Gendergendertext
Filter by gender tag (`male` or `female`).
Accentaccenttext
Filter by accent tag.
Limitlimitnumber
Page size (max 200).From 1 to 200.
Offsetoffsetnumber
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 IDdict_idtextRequired
ID of the dictionary to update.
FilefiletextRequired
File.

Outputs

dataobject
The response from Sarvam AI.
Example output
{
  "data": {
    "dictionary_id": "example",
    "updated_pronunciations": {}
  }
}

Transcribe audio

Transcribe audio.

Inputs

FilefiletextRequired
File.
Modelmodeltext
Model.One of: saaras:v3, saaras:v4.
Modemodetext
Mode.One of: transcribe, translate, verbatim, translit, codemix.
Language codelanguage_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 timestampswith_timestampstrue/false
With timestamps.
Input audio codecinput_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.
Keytermskeytermslist
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

FilefiletextRequired
File.
Promptprompttext
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.
Modelmodeltext
Model.One of: saaras:v3, saaras:v2.5.
Input audio codecinput_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

InputinputtextRequired
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 codesource_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 codetarget_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 genderspeaker_gendertext
Please specify the gender of the speaker for better translations.One of: Male, Female.
Modemodetext
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.
Modelmodeltext
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 scriptoutput_scripttext
Output script.One of: roman, fully-native, spoken-form-in-native.
Numerals formatnumerals_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

InputinputtextRequired
The text you want to transliterate.
Source language codesource_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 codetarget_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 formatnumerals_formattext
Numerals format.One of: international, native.
Spoken form numerals languagespoken_form_numerals_languagetext
Spoken form numerals language.One of: english, native.
Spoken formspoken_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

FilefiletextRequired
File.

Outputs

dataobject
The response from Sarvam AI.
Example output
{
  "data": {
    "dictionary_id": "example"
  }
}

On this page