API Reference
POST/v1/audio/transcriptions

Speech-to-Text

Transcribe audio to text. Accepts multipart/form-data and returns an OpenAI Whisper-compatible response. Supports 23 Indic languages via Sarvam AI (saaras:v3) with optional translation and transliteration modes.

Request body (multipart/form-data)

ParameterTypeDescription
filerequiredfileAudio file to transcribe. Formats: WAV, MP3, AAC, AIFF, OGG, OPUS, FLAC, MP4/M4A, AMR, WMA, WebM.
modelrequiredstringSTT model ID. Call GET /v1/models and pick an STT model.
language_codestringLanguage hint in BCP-47 format (e.g. "hi-IN", "en-IN"). Omit to let the model auto-detect.

Sarvam STT models

saaras:v3Latest
23 languages. Supports multiple output modes (transcribe, translate, verbatim, translit, codemix). State-of-the-art accuracy.
saarika:v2.5Standard
12 languages. Standard transcription in the original language. Simpler and faster for common use cases.

Output modes (saaras:v3)

The mode is configured per model route in Admin → Models via extra_params. It controls what the model returns for each audio input:

transcribeDefault. Returns the transcript in the original spoken language with proper formatting.
translateTranslates Indic language speech directly to English text.
verbatimWord-for-word transcription without normalization or punctuation correction.
translitRomanizes the transcript — output is in Latin script.
codemixMixed script output — blends English and native scripts for code-switched speech.

curl — transcribe

bash
curl https://api.inferexai.in/v1/audio/transcriptions \
  -H "Authorization: Bearer sk-live-your-key" \
  -F "file=@audio.wav" \
  -F "model=sarvam-stt" \
  -F "language_code=hi-IN"

curl — translate to English

bash
# Translate Indic speech directly to English
curl https://api.inferexai.in/v1/audio/transcriptions \
  -H "Authorization: Bearer sk-live-your-key" \
  -F "file=@audio.wav" \
  -F "model=sarvam-stt-pro"

Python

transcribe.py
from inferexai import InferexAI

client = InferexAI(api_key="sk-live-your-key")

with open("audio.wav", "rb") as f:
    transcript = client.audio.transcriptions.create(
        model="sarvam-stt",   # use an STT model ID from /v1/models
        file=f,
        language="hi-IN",
    )

print(transcript.text)

Node.js

transcribe.ts
import InferexAI from "inferexai";
import fs from "fs";

const client = new InferexAI({ apiKey: "sk-live-your-key" });

const transcript = await client.audio.transcriptions.create({
  model: "sarvam-stt",
  file: fs.createReadStream("audio.wav"),
  language: "hi-IN",
});

console.log(transcript.text);

Response

Returns a JSON object. text always contains the full transcript. Optional fields appear when returned by the model.

response.json
{
  "text": "नमस्ते, आप कैसे हैं?",
  "language": "hi",
  "duration": 2.14
}

With word/segment timestamps (when supported by the model):

response-with-segments.json
{
  "text": "Hello, how can I help you today?",
  "language": "en",
  "duration": 3.42,
  "segments": [
    { "id": 0, "start": 0.0, "end": 1.8, "text": "Hello, how can I help" },
    { "id": 1, "start": 1.8, "end": 3.42, "text": " you today?" }
  ]
}

Supported languages

Pass the language code in BCP-47 format. Omit for auto-detection. saaras:v3 supports 23 languages; saarika:v2.5 supports 12.

Hindihi-IN
English (India)en-IN
Tamilta-IN
Telugute-IN
Kannadakn-IN
Malayalamml-IN
Marathimr-IN
Gujaratigu-IN
Bengalibn-IN
Punjabipa-IN
Odiaor-IN
Assameseas-IN

Error codes

401
Unauthorized
Missing or invalid API key.
402
Insufficient balance
Wallet is empty. Top up credits before retrying.
413
File too large
Audio file exceeds the maximum upload size (25 MB).
422
Validation error
Missing required field or unsupported audio format.
502
Upstream error
The STT service returned an error. Retry the request.