---
title: "Speech to Text"
method: POST
path: "/speech-to-text"
tags: ["speechToText"]
---

# Speech to Text

`POST /speech-to-text`

## Speech to Text API

This API transcribes speech to text in multiple Indian languages and English. Supports transcription for interactive applications.

### Available Options:
- **REST API** (Current Endpoint): For quick responses under 30 seconds with immediate results
- **Batch API**: For longer audio files, [Follow This Documentation](https://docs.sarvam.ai/api-reference-docs/api-guides-tutorials/speech-to-text/batch-api)
  - Supports diarization (speaker identification)

### Note:
- Pricing differs for REST and Batch APIs
- Diarization is only available in Batch API with separate pricing
- Please refer to [here](https://docs.sarvam.ai/api-reference-docs/pricing) for detailed pricing information

## Headers

- `api-subscription-key` string, required

## Response `200`

Successful Response

- SarvamModelAPISpeechToTextResponse
  - `request_id` string, nullable, required
  - `transcript` string, required — The transcribed text from the provided audio file.
  - `timestamps` SarvamModelAPITimestampsModel
    - `words` string[], required — List of words in the transcript.
    - `start_time_seconds` number[], required — List of start times of words in seconds.
    - `end_time_seconds` number[], required — List of end times of words in seconds.
  - `diarized_transcript` SarvamModelAPIDiarizedTranscript
    - `entries` SarvamModelAPIDiarizedEntry[], required — List of diarized transcript entries.
      - `transcript` string, required — transcript of the segment of that audio
      - `start_time_seconds` number, double, required — Start time of the word in seconds.
      - `end_time_seconds` number, double, required — End time of the word in seconds.
      - `speaker_id` string, required — Speaker ID for the word.
  - `language_code` string, nullable, required — 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
  - `language_probability` number, double, nullable — Float value (0.0 to 1.0) indicating the probability of the detected language being correct. Higher values indicate higher confidence. **When it returns a value:** - When `language_code` is not provided in the request - When `language_code` is set to `unknown` **When it returns null:** - When a specific `language_code` is provided (language detection is skipped) The parameter is always present in the response.

## Other responses

- `400` — Bad Request
- `403` — Forbidden
- `422` — Unprocessable Entity
- `429` — Quota Exceeded
- `500` — Internal Server Error
- `503` — Service Overloaded

---

[API](https://skmtc.dev/sarvam/apis/endpoints.md) · [All operations](https://skmtc.dev/sarvam/apis/endpoints/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/sarvam/endpoints/revisions/2b7f7955b147/schema)
