Skip to Content

Overview

The Speech-to-Text API transcribes an audio file to text in a single synchronous request. Upload audio, get back the transcript in the same response.

POST /api/stt/transcribe/

Billed per second of audio. Pairs with the Text to Speech endpoint.

Authentication

Send your key in the x-api-key header (browser sessions may use a JWT Authorization: Bearer <token> instead). See API Keys to create one.

x-api-key: sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Transcribe audio

POST /api/stt/transcribe/

Send the audio as multipart/form-data.

curl -X POST https://api.oshara.ai/api/stt/transcribe/ \ -H "x-api-key: $OSHARA_KEY" \ -F "file=@recording.wav" \ -F "model=whisper" \ -F "language=en"

Request fields

FieldTypeRequiredDescription
filefileThe audio file to transcribe. Max 50 MB.
modelstringwhisper (default) or omnilingual. Any other value falls back to whisper.
languagestringen (default) or ne (Nepali).

Models

ModelBest for
whisperGeneral transcription; strong Nepali support (default).
omnilingualBroad multilingual coverage (alias: sherpa).

Response

Returns JSON with the transcript:

{ "success": true, "message": "Request successful", "data": { "transcript": "…transcribed text…", "model": "whisper", "language": "en" } }

Billing

Charged per second of audio (rounded up, with a minimum). Duration is measured from the uploaded file.

Errors

StatusMeaning
400No file provided, or the file exceeds the 50 MB limit.
401Missing or invalid x-api-key.
502Transcription failed upstream.
{ "success": false, "message": "An error occurred", "errors": { "error": "..." } }
Last updated on