Sarvam AI

Usage Instructions

Integrate Sarvam AI into the workflow. Generate natural Indian-language and Hinglish speech with Bulbul voices, transcribe or translate voice notes and call recordings of up to 2 hours with Saaras, with speaker labels, translate and transliterate short text, and detect the language and script of a message.

Actions

Sarvam Text to Speech

Generate natural Indian-language or Hinglish speech with Sarvam Bulbul voices and save it as an audio file

Input

ParameterTypeRequiredDescription
textstringYesThe text to speak, up to 3500 characters (text over 2500 characters uses the streaming endpoint; 1500 on bulbul:v2). Supports Hinglish and other code-mixed text (e.g., "Namaste! Aapka order kal deliver hoga.")
apiKeystringYesSarvam API subscription key
languageCodestringYesBCP-47 language of the text: bn-IN, en-IN, gu-IN, hi-IN, kn-IN, ml-IN, mr-IN, od-IN, pa-IN, ta-IN, or te-IN
modelstringNoBulbul model: bulbul:v4-flash (default), bulbul:v3, or bulbul:v2
speakerstringNoSpeaker voice for the chosen model (e.g., "shubh_enhi_ads" on bulbul:v4-flash, "priya" on bulbul:v3, "anushka" on bulbul:v2)
pacenumberNoSpeech speed: 0.5 to 2.0 on v3/v4, 0.3 to 3.0 on v2 (default 1.0)
temperaturenumberNoExpressiveness from 0.01 to 1.0 (default 0.6); bulbul:v3 and bulbul:v4-flash only
pitchnumberNoVoice pitch from -0.75 to 0.75 (default 0); bulbul:v2 only
loudnessnumberNoLoudness from 0.3 to 3.0 (default 1.0); bulbul:v2 only
sampleRatenumberNoOutput sample rate in Hz: 8000, 16000, 22050 (default), 24000, 32000, 44100, 48000
outputCodecstringNoOutput audio codec: wav (default), mp3, aac, flac, linear16, mulaw, or alaw
streambooleanNoUse the REST streaming endpoint, which returns raw audio and accepts up to 3500 characters
bitratestringNoStreaming endpoint only: 32k, 64k, 96k, 128k (default), or 192k

Output

ParameterTypeDescription
audioUrlstringURL to the generated audio file
audioFilefileGenerated audio file (UserFile)
characterCountnumberNumber of characters spoken
formatstringAudio format
transcriptstringTranscribed text (English text for Speech to English Text)
segmentsjsonSegments (text, start, end in seconds, speaker) when timestamps or speaker labels are on
jobIdstringSarvam batch job ID (long audio, or audio over 30 seconds)
jobStatestringJob state: Accepted, Pending, Running, Completed, or Failed
failureReasonstringWhy the batch job failed, when it failed
languagestringBCP-47 code of the predominant spoken language
languageProbabilitynumberConfidence (0 to 1) in the detected spoken language
translatedTextstringTranslated text
transliteratedTextstringText written in the target script
sourceLanguageCodestringDetected or provided source language code
languageCodestringDetected language code (e.g. hi-IN)
scriptCodestringDetected script code (e.g. Latn, Deva)
requestIdstringSarvam request ID

Sarvam Speech to Text

Transcribe Indian-language, English, or Hinglish speech with Sarvam Saaras; audio over 30 seconds runs as a batch job automatically

Input

ParameterTypeRequiredDescription
apiKeystringYesSarvam API subscription key
modelstringNoSaaras model: saaras:v4 (default) or saaras:v3
audioFilefileNoAudio or video file (e.g., WAV, MP3, AAC, OGG, OPUS, FLAC, M4A, WEBM). Audio over 30 seconds uses the Sarvam Batch API automatically (up to 2 hours)
audioFileReferencefileNoReference to audio/video file from previous blocks
languagestringNoBCP-47 language of the audio (e.g., "hi-IN", "ta-IN") or "unknown" to auto-detect
timestampsstringNonone, or sentence/word for chunk-level (sentence or phrase) timestamps
keytermsarrayNoUp to 50 names, places, or brand terms (64 characters each) to bias recognition toward; saaras:v4 only
modestringNoOutput mode: transcribe (default), verbatim (no normalization), translit (Roman script), or codemix (English words in English, Indic words in native script)

Output

ParameterTypeDescription
audioUrlstringURL to the generated audio file
audioFilefileGenerated audio file (UserFile)
characterCountnumberNumber of characters spoken
formatstringAudio format
transcriptstringTranscribed text (English text for Speech to English Text)
segmentsjsonSegments (text, start, end in seconds, speaker) when timestamps or speaker labels are on
jobIdstringSarvam batch job ID (long audio, or audio over 30 seconds)
jobStatestringJob state: Accepted, Pending, Running, Completed, or Failed
failureReasonstringWhy the batch job failed, when it failed
languagestringBCP-47 code of the predominant spoken language
languageProbabilitynumberConfidence (0 to 1) in the detected spoken language
translatedTextstringTranslated text
transliteratedTextstringText written in the target script
sourceLanguageCodestringDetected or provided source language code
languageCodestringDetected language code (e.g. hi-IN)
scriptCodestringDetected script code (e.g. Latn, Deva)
requestIdstringSarvam request ID

Sarvam Speech to English Text

Translate speech in any supported Indian language directly into English text with Sarvam Saaras; audio over 30 seconds runs as a batch job automatically

Input

ParameterTypeRequiredDescription
apiKeystringYesSarvam API subscription key
modelstringNoSaaras model: saaras:v4 (default) or saaras:v3
audioFilefileNoAudio or video file (e.g., WAV, MP3, AAC, OGG, OPUS, FLAC, M4A, WEBM). Audio over 30 seconds uses the Sarvam Batch API automatically (up to 2 hours)
audioFileReferencefileNoReference to audio/video file from previous blocks
languagestringNoBCP-47 language of the audio (e.g., "hi-IN", "ta-IN") or "unknown" to auto-detect
timestampsstringNonone, or sentence/word for chunk-level (sentence or phrase) timestamps
keytermsarrayNoUp to 50 names, places, or brand terms (64 characters each) to bias recognition toward; saaras:v4 only

Output

ParameterTypeDescription
audioUrlstringURL to the generated audio file
audioFilefileGenerated audio file (UserFile)
characterCountnumberNumber of characters spoken
formatstringAudio format
transcriptstringTranscribed text (English text for Speech to English Text)
segmentsjsonSegments (text, start, end in seconds, speaker) when timestamps or speaker labels are on
jobIdstringSarvam batch job ID (long audio, or audio over 30 seconds)
jobStatestringJob state: Accepted, Pending, Running, Completed, or Failed
failureReasonstringWhy the batch job failed, when it failed
languagestringBCP-47 code of the predominant spoken language
languageProbabilitynumberConfidence (0 to 1) in the detected spoken language
translatedTextstringTranslated text
transliteratedTextstringText written in the target script
sourceLanguageCodestringDetected or provided source language code
languageCodestringDetected language code (e.g. hi-IN)
scriptCodestringDetected script code (e.g. Latn, Deva)
requestIdstringSarvam request ID

Sarvam Translate Text

Translate short text between English and Indian languages with Sarvam, in a formal, colloquial, or code-mixed (Hinglish) tone

Input

ParameterTypeRequiredDescription
apiKeystringYesSarvam API subscription key
inputstringYesText to translate: up to 1000 characters on mayura:v1, 2000 on sarvam-translate:v1
sourceLanguageCodestringYesBCP-47 source language (e.g., "en-IN", "hi-IN") or "auto" to detect it (mayura:v1 only)
targetLanguageCodestringYesBCP-47 target language (e.g., "hi-IN", "ta-IN", "en-IN")
modelstringNomayura:v1 (11 languages, all tones, auto-detect) or sarvam-translate:v1 (all 22 scheduled Indian languages, formal only)
modestringNoTone: formal (default), modern-colloquial, classic-colloquial, or code-mixed (mayura:v1 only for non-formal tones)
speakerGenderstringNoSpeaker gender for better translations: Male or Female
outputScriptstringNoOutput transliteration style (mayura:v1 only): roman, fully-native, or spoken-form-in-native
numeralsFormatstringNointernational (0-9, default) or native numerals

Output

ParameterTypeDescription
translatedTextstringTranslated text in the target language
sourceLanguageCodestringDetected or provided source language code
requestIdstringSarvam request ID

Sarvam Transliterate

Convert text between Roman and Indian scripts while keeping its pronunciation, e.g. "namaste" to "नमस्ते"

Input

ParameterTypeRequiredDescription
apiKeystringYesSarvam API subscription key
inputstringYesText to transliterate
sourceLanguageCodestringYesBCP-47 language of the input (e.g., "en-IN" for Romanized text, "hi-IN") or "auto"
targetLanguageCodestringYesBCP-47 language whose script to write in (e.g., "hi-IN" for Devanagari, "en-IN" for Roman)
numeralsFormatstringNointernational (0-9, default) or native numerals
spokenFormbooleanNoRewrite the text in natural spoken form, e.g. "9:30am" as words (no effect when the target is en-IN)
spokenFormNumeralsLanguagestringNoWith spoken form, speak numbers in native (default) or english

Output

ParameterTypeDescription
transliteratedTextstringText written in the target script
sourceLanguageCodestringDetected or provided source language code
requestIdstringSarvam request ID

Sarvam Identify Language

Detect the language and script of a short text, e.g. Hindi written in Roman script (Hinglish) or Devanagari

Input

ParameterTypeRequiredDescription
apiKeystringYesSarvam API subscription key
inputstringYesText to identify, up to 1000 characters

Output

ParameterTypeDescription
languageCodestringDetected BCP-47 language code (e.g., hi-IN), or null when undetected
scriptCodestringDetected script (e.g., Latn for Roman, Deva for Devanagari), or null
requestIdstringSarvam request ID

Sarvam Transcribe Long Audio

Transcribe a call or meeting recording of up to 2 hours with the Sarvam Batch API, with optional speaker labels and sentence timestamps

Input

ParameterTypeRequiredDescription
apiKeystringYesSarvam API subscription key
modelstringNoSaaras model: saaras:v4 (default) or saaras:v3
audioFilefileNoAudio or video file (e.g., WAV, MP3, AAC, OGG, OPUS, FLAC, M4A, WEBM). Audio over 30 seconds uses the Sarvam Batch API automatically (up to 2 hours)
audioFileReferencefileNoReference to audio/video file from previous blocks
languagestringNoBCP-47 language of the audio (e.g., "hi-IN", "ta-IN") or "unknown" to auto-detect
timestampsstringNonone, or sentence/word for chunk-level (sentence or phrase) timestamps
keytermsarrayNoUp to 50 names, places, or brand terms (64 characters each) to bias recognition toward; saaras:v4 only
modestringNoOutput mode: transcribe (default), translate (to English), verbatim, translit (Roman script), or codemix
withTimestampsbooleanNoReturn sentence-level timestamps
withDiarizationbooleanNoLabel each speaker turn (e.g., agent and customer on a call)
numSpeakersnumberNoExpected number of speakers when speaker labels are on (e.g., 2 for a call)
maxWaitSecondsnumberNoHow long to wait for the job, 30 to 7200 seconds (default 600, capped by the run time limit). If it is not done, the error includes the job ID for Get Transcription Job

Output

ParameterTypeDescription
jobIdstringSarvam batch job ID

Sarvam Get Transcription Job

Check a Sarvam batch transcription job and return its transcript once it has completed

Input

ParameterTypeRequiredDescription
apiKeystringYesSarvam API subscription key
jobIdstringYesBatch job ID returned by Transcribe Long Audio

Output

ParameterTypeDescription
jobIdstringSarvam batch job ID
jobStatestringJob state: Accepted, Pending, Running, Completed, or Failed
transcriptstringTranscript, once the job has completed
segmentsarraySpeaker turns or sentence segments, when requested for the job
languagestringBCP-47 code of the predominant spoken language
failureReasonstringWhy the job failed, when it failed