Transcribe audio to text in Arabic, French, English, and more.
Speech-to-Text (STT) converts audio into transcribed text. OpenDunes supports Arabic transcription natively — including Algerian Darija — alongside French and English.
OpenDunes takes the audio inline as base64 JSON (not a multipart file upload), so call the endpoint directly with httpx rather than the OpenAI SDK's audio.transcriptions helper.
import os
import base64
import httpx
headers = {"Authorization": f"Bearer {os.environ['OPENDUNES_API_KEY']}"}
with open("recording.mp3", "rb") as f:
data = base64.b64encode(f.read()).decode()
resp = httpx.post(
"https://opendunes.com/v1/audio/transcriptions",
headers=headers,
json={
"model": "example-provider/stt-model",
"input_audio": {"data": data, "format": "mp3"},
"language": "ar", # optional — improves accuracy
},
)
print(resp.json()["text"])| Parameter | Description |
|---|---|
model | STT model slug (?modality=transcription). |
input_audio.data | Base64-encoded audio bytes. |
input_audio.format | One of wav, mp3, flac, m4a, ogg, webm, aac. |
language | BCP-47 language hint, e.g. "ar", "fr", "en". Optional. |
temperature | 0–1. Lower values produce more deterministic output. Optional. |
Transcription is billed per second of audio in DA, rounded up. See the STT API reference.