Speech To Text Translate

Real-Time Speech to Text Translation API

This API automatically detects the input language, transcribes the speech, and translates the text to English.

Available Options:

  • Real-Time API (Current Endpoint): For quick responses under 30 seconds with immediate results
  • Batch API: For longer audio files, requires following a notebook script - View Notebook
    • Supports diarization (speaker identification)

Note:

  • Pricing differs for Real-Time and Batch APIs
  • Diarization is only available in Batch API with separate pricing
  • Please refer to dashboard.sarvam.ai for detailed pricing information

Headers

api-subscription-keystringRequired

Request

This endpoint expects a multipart form containing a file.
filefileRequired

The audio file to transcribe. Supported formats are wave (.wav) and MPEG-3 (.mp3). Works best at 16kHz. Multiple channels will be merged.

promptstringOptional

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.

modelenumOptional

Model to be used for converting speech to text in target language

Allowed values:

Response

Successful Response

transcriptstring

Transcript of the provided speech

request_idstringOptional
language_codeenumOptional

This will return the BCP-47 code of language spoken in the input. If multiple languages are detected, this will return language code of most predominant spoken language. If no language is detected, this will be null

diarized_transcriptobjectOptional

Diarized transcript of the provided speech

Errors