Endpoints
Speech to Text
Transcribe an audio file into text
POST
Try itcurl -X POST https://api.menavoice.ai/api/stt/transcribe \
-H "x-api-key: $MENAVOICE_API_KEY" \
-F "audio=@recording.mp3" \
-F "language=ar"import os
import requests
with open("recording.mp3", "rb") as f:
response = requests.post(
"https://api.menavoice.ai/api/stt/transcribe",
headers={"x-api-key": os.environ["MENAVOICE_API_KEY"]},
files={"audio": ("recording.mp3", f, "audio/mpeg")},
data={"language": "ar"},
timeout=300,
)
print(response.json())import { readFile } from "node:fs/promises";
const form = new FormData();
form.append("audio", new Blob([await readFile("recording.mp3")], { type: "audio/mpeg" }), "recording.mp3");
form.append("language", "ar");
const response = await fetch("https://api.menavoice.ai/api/stt/transcribe", {
method: "POST",
headers: { "x-api-key": process.env.MENAVOICE_API_KEY },
body: form,
});
console.log(await response.json());{
"text": "مرحباً بكم في مينا فويس",
"minutes": 0.1,
"mimeType": "audio/mpeg"
}{
"error": "Unsupported audio format. Use mp3, wav, webm, ogg, m4a, or flac."
}{
"error": "Insufficient API balance ($0.00). This request needs $0.0000 — top up in the Developer dashboard under API Billing."
}{
"error": "Audio file exceeds 25 MB size limit"
}Transcribes a recording into text. Upload the audio as multipart/form-data, or send it base64-encoded in a JSON body.
Each request costs $25 per million characters of transcript, taken from your API credit. It needs a positive balance to start.
Authorizations
x-api-keystringrequired
Your API key. See Authentication.
Body
multipart/form-dataJSON body
application/jsonResponse
application/jsontextstringrequired
The transcript. Empty if no speech was found.
minutesnumberrequired
The billable length of the audio in minutes, rounded to a tenth (at least 0.1). The web app uses it to count plan minutes; API requests are billed on transcript characters instead.
mimeTypestringrequired
The audio format the file was read as.
Errors
| Status | When |
|---|---|
400 | No audio was sent, the format isn't supported, or the base64 is invalid. |
401 | The API key is missing or invalid. |
402 | Your API balance is zero or below. |
413 | The file is over 25 MB, or the JSON body is over 10 MB. |
429 | More than 30 requests in a minute, or more requests at once than your concurrency allows. |
See Errors for the exact messages.
Was this page helpful?

