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.
# 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.
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.