Transcribe a File
Turn an audio or video file into text with KhasbhaSTT, uploaded or from a public URL
curl -X POST https://api.voice213.com/api/v1/stt \
-H "Authorization: Bearer $VOICE213_API_KEY" \
-F "file=@call.mp3" \
-F "language=ar" \
-F "dialect=algerian" \
-F "speakers=true"from voice213 import Voice213
client = Voice213() # reads VOICE213_API_KEY; waits up to 10 minutes for an answer
transcript = client.speech_to_text.transcribe("call.mp3", language="ar", dialect="algerian", speakers=True)
print(transcript.text)
print(transcript.billable_seconds, "seconds billed:", transcript.cost, "DA")import Voice213 from "@voice213/sdk";
const voice213 = new Voice213(); // reads VOICE213_API_KEY; waits up to 10 minutes for an answer
// The file is streamed from disk as multipart/form-data
const transcript = await voice213.speechToText.transcribe({
file: "call.mp3",
language: "ar",
dialect: "algerian",
speakers: true,
});
console.log(transcript.text);
console.log(`${transcript.billableSeconds} seconds billed: ${transcript.cost} DA`);curl -X POST https://api.voice213.com/api/v1/stt \
-H "Authorization: Bearer $VOICE213_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://cdn.example.com/calls/2026-11-20-1432.mp3",
"language": "ar",
"dialect": "algerian",
"speakers": true
}'{
"success": true,
"text": "السلام عليكم خويا، راني نعيطلك على la commande اللي درتها نهار الخميس. وصلتني اليوم الصباح مع le livreur، بصح الصباط جا صغير شوية عليا. واش نقدر نبدلو؟ ونحب نعرف إذا لازم نخلص la livraison مرة أخرى ولا لا. ردلي خبر كي تشوف le message، يعطيك الصحة.",
"model": "khasbha-stt",
"language": "ar",
"dialect": "algerian",
"durationSeconds": 31.48,
"billableSeconds": 32,
"cost": 1.6,
"currency": "DZD",
"remainingCredit": 4998.4
}{
"success": true,
"text": "المتحدث 1: ألو، السلام عليكم، راني نعيط على la commande تاعي.\nالمتحدث 2: وعليكم السلام، مرحبا بيك. واش هو الاسم من فضلك؟\nالمتحدث 1: كريم بن علي. خلصت par carte نهار الخميس وما زال ما وصلني والو.\nالمتحدث 2: مليح، la commande تاعك خرجت البارح، توصلك غدوة إن شاء الله.",
"model": "khasbha-stt",
"language": "ar",
"dialect": "algerian",
"durationSeconds": 18.06,
"billableSeconds": 30,
"cost": 1.5,
"currency": "DZD",
"remainingCredit": 4996.9
}{
"error": "INVALID_MEDIA",
"message": "We couldn't read any audio in this file."
}{
"error": "AUDIO_TOO_LONG",
"message": "This audio is longer than 30 minutes, the most one request takes. Split it into shorter files.",
"maxDurationSeconds": 1800,
"durationSeconds": 2714.3
}{
"error": "INSUFFICIENT_CREDIT",
"message": "Not enough API credit. Top up your balance in the developer workspace.",
"required": 1.6,
"balance": 0.85,
"currency": "DZD"
}{
"error": "FILE_TOO_LARGE",
"message": "The file is larger than 100 MB, the most one request takes.",
"maxFileMB": 100
}{
"error": "هذه الأداة متوقفة مؤقتًا. يرجى المحاولة لاحقًا.",
"code": "TOOL_DISABLED",
"tool": "stt_api",
"messages": {
"ar": "هذه الأداة متوقفة مؤقتًا. يرجى المحاولة لاحقًا.",
"en": "This tool is temporarily paused. Please try again later.",
"fr": "Cet outil est temporairement suspendu. Veuillez réessayer plus tard."
}
}Turns an audio or video file into text with KhasbhaSTT, in Algerian, Tunisian or Libyan darija, French or English. Upload the file as multipart/form-data, or send the address of a file that's already online as JSON:
{
"url": "https://cdn.example.com/calls/2026-11-20-1432.mp3",
"language": "ar",
"dialect": "algerian",
"speakers": true
}The transcript comes back in the response, with the seconds billed and what they cost. There's no endpoint to fetch a transcript again later, so keep the text you receive. A long file can take a few minutes to upload and transcribe: the SDKs in the examples wait up to 10 minutes for the answer. With another HTTP client, set a timeout of 10 minutes too; in Node.js, the built-in fetch stops waiting after 5. See KhasbhaSTT for a guide with examples of every option.
This endpoint transcribes recordings. For live audio, use KhasbhaSTT LIVE: create a session with Create a Live Token. Sending "model": "khasbha-stt-live" here gets 400 WRONG_MODEL.
Pricing
| Model | model | Per minute | Per hour | Billing |
|---|---|---|---|---|
| KhasbhaSTT | khasbha-stt | 3 DA | 180 DA | Per second, at least 30 seconds per file |
| KhasbhaSTT LIVE | khasbha-stt-live | 5 DA | 300 DA | Per second, at least 15 seconds per session |
- A file is billed for the length of its audio, silences included, per second, rounded up to the whole second, and at least 30 seconds: a 12-second voice note costs the same as a 30-second one.
- While the file is transcribed, its price is set aside from your API credit. It's charged when the transcription succeeds, and released when it fails: a failed transcription costs nothing. See Several files at once.
- A file with no speech is still billed, since its audio was processed, and its
textis empty. - A file over 30 minutes, or one without audio, is refused before anything is set aside or charged.
To know the price before you send a file, send its length to Estimate Transcription Cost. It's free. See API Pricing & Limits for worked examples.
Authorizations
Your API key as a Bearer token: Bearer sk_live_.... You can send it in an x-api-key header instead. See Authentication.
Body
multipart/form-dataThe recording: an audio or video file of up to 100 MB and 30 minutes of audio, such as MP3, WAV, M4A, AAC, OGG or Opus (WhatsApp voice notes), AMR, FLAC, WebM, MP4, MOV, MKV or AVI. A video's sound is transcribed. Keep the file name's extension, such as call.mp3: it helps Voice213 recognize the format. A larger file gets 413 FILE_TOO_LARGE, a longer one 400 AUDIO_TOO_LONG, and one without any audio Voice213 can read 400 INVALID_MEDIA. Send one file, in this field. Required, unless you send a url as JSON instead.
khasbha-sttThe model: khasbha-stt, KhasbhaSTT. Capitalization doesn't matter, and its name, KhasbhaSTT, works too. khasbha-stt-live streams over a socket instead and gets 400 WRONG_MODEL, and any other value 400 UNKNOWN_MODEL, which lists the models. See List STT Models.
arThe language of the recording: ar (Arabic, darija included), fr (French) or en (English), in any capitalization. Any other value gets 400 INVALID_LANGUAGE. See Languages and dialects.
algerianThe Arabic dialect the transcription is tuned for: algerian, tunisian or libyan, in any capitalization. It's used only with language ar: with fr or en it's ignored, and the response's dialect is null. Any other value, the numbers 1, 2 and 3 included, gets 400 INVALID_DIALECT.
How the people speaking are told apart. Not set: each change of speaker starts a new line beginning with - . true: each line starts with the speaker's number, «المتحدث 1:» in Arabic, Speaker 1: in English and Intervenant 1: in French, the same number for the same person throughout. false: one continuous text, without line breaks. A recording with a single voice comes without dashes or labels.
trueWith true, the transcript has simple punctuation where the speech pauses: commas, full stops and question marks. false leaves punctuation out.
falsetrue replaces swear words and slurs with ***, and leaves the rest of the sentence as it was said.
In a multipart form, every value is text: send true or false for speakers, punctuation and profanity. In a JSON body, booleans work too. Any other value gets 400 INVALID_OPTION, with the field's name in field. A field left empty takes its default.
Body: a file at a URL
application/jsonThe address of an audio or video file, instead of uploading it: a public http:// or https:// URL of the file itself, not of a page that plays it. Voice213 downloads it, following redirects, and it must be 100 MB or smaller and arrive within 60 seconds. An address that isn't a public http(s) URL, such as one on a private network or whose host doesn't exist, gets 400 INVALID_URL; a file that can't be downloaded in time, or whose server answers with an error, 400 FETCH_FAILED; a file over 100 MB, 413 FILE_TOO_LARGE. Send the other fields in the same JSON body, with the same rules: model, language, dialect, speakers, punctuation and profanity.
Response
application/jsontrue.
The transcript, word for word: darija in Arabic script without tashkeel, French and English words in Latin letters, and speakers laid out as speakers asked, with lines separated by \n. An empty string when the recording has no speech.
khasbha-stt.
The language the recording was transcribed as: ar, fr or en.
The dialect, such as algerian, or null when language isn't ar.
The length of the audio in seconds, to two decimals, as Voice213 measured it.
The seconds billed: durationSeconds rounded up to the whole second (a remainder of 0.05 s or less isn't counted), or 30 when that's lower.
What the transcription cost, in dinars: billableSeconds × the price per minute ÷ 60, rounded to four decimals.
DZD.
Your API credit after the transcription, in dinars.
What the transcript looks like
- Word for word. Hesitations and repeated words stay in. Nothing is rephrased, summarized, corrected or translated into Modern Standard Arabic.
- In the speaker's own words and script. Darija is in Arabic script, spelled as it's pronounced, without tashkeel. French and English words inside Arabic speech are in Latin letters, and Arabic words inside French or English speech in Arabic script.
- Only speech. Music, laughter and silence aren't described, so there are no notes such as
[musique]in the text.
See What the transcript looks like for examples.
Several files at once
Your account can have 20 requests running at the same time, transcriptions and voice-overs together, whichever of its keys sent them. A transcription runs from the moment Voice213 accepts it until its transcript is ready or it fails, even if your client stopped waiting. Once 20 are running, the next request gets 429 Rate limit exceeded: Concurrent request limit exceeded: retry when one of them has ended. See Rate Limits.
Each running transcription also sets its price aside from your API credit until it's charged (when it succeeds) or released (when it fails). A transcription that arrives while others run is refused with 402 INSUFFICIENT_CREDIT when what's left after them can't cover it. The balance in that 402 is your API credit less what the others have set aside. See Insufficient API credit.
Errors
| Status | Error | When |
|---|---|---|
400 | MISSING_FILE | The request has no file in the file field and no url, sent a file in another field or more than one file, or its form was cut short. |
400 | INVALID_MEDIA | Voice213 couldn't read any audio in the file: it has no audio track, it's damaged, or it isn't an audio or video file. |
400 | AUDIO_TOO_LONG | The audio is over 30 minutes. The body has maxDurationSeconds and the recording's durationSeconds. Nothing is charged. |
400 | UNKNOWN_MODEL | model isn't a speech-to-text model. The body lists the models. |
400 | WRONG_MODEL | model is khasbha-stt-live, which streams over a socket: create a session with POST /stt/live/token. |
400 | INVALID_LANGUAGE | language isn't ar, fr or en. The body lists the languages. |
400 | INVALID_DIALECT | dialect isn't algerian, tunisian or libyan. The body lists the dialects. |
400 | INVALID_OPTION | speakers, punctuation or profanity isn't true or false, or the form has too many fields or one too long. The body names the field. |
400 | INVALID_URL | url isn't a public http:// or https:// address: not a URL, a host that doesn't exist, or one on a private network. |
400 | FETCH_FAILED | The file at url couldn't be downloaded within 60 seconds, or its server answered with an error, whose HTTP status is in status. |
401 | Missing API key. Pass it as 'Authorization: Bearer sk_live_...' | The request has no key. |
401 | Invalid or inactive API key | The key is wrong, switched off or deleted. |
402 | INSUFFICIENT_CREDIT | Your API credit, less what your other running requests have set aside, can't cover the transcription. A balance below the price of the shortest file, 1.50 DA, is refused before the file is read. The body has required and balance. |
403 | Account deactivated | The account that owns the key is deactivated or suspended. |
403 | API_ACCESS_BLOCKED (in code) | API access is switched off for the account. |
413 | FILE_TOO_LARGE | The file is over 100 MB, uploaded or at url. The body has maxFileMB. |
429 | Rate limit exceeded: RPM limit exceeded or Rate limit exceeded: Daily limit exceeded | Your account's requests per minute or per day, all its keys together. |
429 | Rate limit exceeded: Concurrent request limit exceeded | Your account already has 20 requests running. Retry when one of them ends. |
500 | INTERNAL_ERROR | Something went wrong on our side after the transcription was charged. |
502 | TRANSCRIPTION_FAILED | The transcription failed. Retry. Nothing was charged. |
503 | TOOL_DISABLED (in code) | Speech to text through the API is paused (tool is stt_api), or every paid request of the API is (public_api). Retry later. |
503 | MAINTENANCE (in code) | The API is down for maintenance. Retry later. |
Errors from this endpoint carry a code in error and an English sentence in message, except the key errors (401, 403, 429) and the 503s, which keep the shapes every endpoint uses. See Errors for the full list.
Was this page helpful?