Skip to content

API Reference

Speech To Text · REST

POSThttps://api.shabd.tech/v1/speech-to-text

Converts spoken audio into accurate written text, supporting multiple languages and accents. Optimized for transcription, accessibility, and voice-driven applications in diverse environments.

Headers

  • x-api-keystringrequired

    API Key for authentication

    Example:
    <your-api-key>
  • Content-Typestringrequired

    Content type of the request body

    Example:
    multipart/form-data
  • x-request-idstringrequired

    Unique request ID in UUID format

    Example:
    550e8400-e29b-41d4-a716-446655440000

Request bodymultipart/form-data

  • languagestringrequired

    Language of the speech

    Example:
    english
  • filefileoptional

    Audio file in WAV format. Optional when audioUrl is supplied.

  • audioUrlstringoptional

    Public http(s) URL to fetch the audio from, as an alternative to uploading file. Exactly one of file or audioUrl is required; if both are sent the uploaded file wins. The URL must be publicly reachable and the downloaded audio is subject to the same size limit as an upload.

    Example:
    https://example.com/audio/sample.wav
  • sampleRatenumber or nulloptional

    Sample rate of the audio (e.g., 16000)

    Example:
    16000
  • projectIdstringoptional

    Optional project identifier

    Example:
    <your-project-id-here>
  • asrModelNamestringoptional

    Optional model. English: asr_en_1, asr_en_2 or asr_en_3 (default). Indic: asr_in_1 (default) or asr_in_2.

    Example:
    asr_in_2
  • customWordsstringoptional

    Optional JSON list of custom words to recognise better: names, brands and terms (a custom word can be one or more words, at most 100). Write them in English letters or in the language of the audio. Add :boost to change how strongly a word is preferred; without it the model's own default is used. Keep boosts at 3 or below: higher values can make the word appear when it wasn't said. Not available with asr_en_1 or asr_en_2. This field was previously named keywords; that name is deprecated but still accepted when customWords is not sent.

    Example:
    ["रूस", "नगर निगम:5"]
  • wordTimestampsbooleanoptional

    Set to true to get a words list with the start and end time of each word.

    Example:
    true

Responses

  • 200Transcribed text

    Bodyapplication/json

    • statusbooleanoptional
      Example:
      true
    • textstringoptional
      Example:
      Text transcribed from the audio
    • languagestringoptional

      Language of the transcript (the detected language when "auto" was sent)

      Example:
      hindi

    Example response

    {  "status": true,  "text": "Text transcribed from the audio",  "language": "hindi"}
  • 400Bad Request - The request is malformed or contains invalid parameters.

    Bodyapplication/json

    • statusbooleanoptional
      Example:
      false
    • messagestringoptional
      Example:
      Invalid input parameters.

    Example response

    {  "status": false,  "message": "Invalid input parameters."}
  • 401Unauthorized Access - Authentication credentials are missing or invalid.

    Bodyapplication/json

    • statusbooleanoptional
      Example:
      false
    • messagestringoptional
      Example:
      Unauthorized access.

    Example response

    {  "status": false,  "message": "Unauthorized access."}
  • 403Usage Limit Exceeded - The usage limit for the API has been exceeded.

    Bodyapplication/json

    • statusbooleanoptional
      Example:
      false
    • messagestringoptional
      Example:
      Limit Exceeded

    Example response

    {  "status": false,  "message": "Limit Exceeded"}
  • 500Internal server error

    Bodyapplication/json

    • statusbooleanoptional
      Example:
      false
    • messagestringoptional
      Example:
      An unexpected error occurred. Please try again later.

    Example response

    {  "status": false,  "message": "An unexpected error occurred. Please try again later."}