Convert speech audio recordings into text across 38 African languages and English. Audio is transcribed using the OmniASR acoustic model with automated silence-aware chunking and intelligent text prettification (punctuation and capitalization).
Authentication
All requests require Bearer token authentication in the HTTP header:
Authorization: Bearer <YOUR_API_KEY>Endpoint Overview
POST /v1/transcribe
Supports three input ingestion methods:
- Base64 Audio in JSON (
audioBase64): Send raw base64-encoded audio directly in anapplication/jsonpayload. - Remote URL in JSON (
audioUrl): Provide a publicly accessible HTTPS link to an audio file in anapplication/jsonpayload. - Direct Binary Upload (
multipart/form-data): Upload a binary audio file directly.
Input Ingestion Methods
Method 1: Base64 Audio (application/json)
Submit base64-encoded audio strings directly in your JSON body. The server accepts raw base64 strings as well as strings prefixed with data URLs (e.g. data:audio/wav;base64,...).
curl -X POST https://api.mansa.ai/v1/transcribe \
-H "Authorization: Bearer mansa_live_..." \
-H "Content-Type: application/json" \
-d '{
"audioBase64": "UklGRiQAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQAAAAA...",
"language": "swahili",
"prettify": true
}'Method 2: Remote Audio URL (application/json)
Submit the URL of an audio file hosted on cloud storage (e.g. AWS S3, Google Cloud Storage, Cloudflare R2).
curl -X POST https://api.mansa.ai/v1/transcribe \
-H "Authorization: Bearer mansa_live_..." \
-H "Content-Type: application/json" \
-d '{
"audioUrl": "https://storage.example.com/audio/interview.mp3",
"language": "yoruba",
"prettify": true
}'JSON Request Fields (application/json)
Method 3: Direct File Upload (multipart/form-data)
Upload an audio file directly from a client application or mobile device (up to 100 MB).
curl -X POST https://api.mansa.ai/v1/transcribe \
-H "Authorization: Bearer mansa_live_..." \
-F "audio=@recording.wav" \
-F "language=swahili" \
-F "prettify=true"Multipart Form Fields
Supported Audio Encodings & Limits
- Supported Formats: WAV, MP3, WebM, OGG, M4A, FLAC, AAC.
- Maximum File / Payload Size: 100 MB (both for direct file uploads and JSON payloads).
- Automatic Chunking: Long audio recordings are dynamically divided into chunks with silence-aware boundary detection to ensure continuous transcript accuracy.
Response Structure
Successful responses are wrapped in the standard Mansa API envelope (data):
{
"context": "OK",
"data": {
"transcript": "Habari za asubuhi, karibu kwenye mkutano wetu wa leo.",
"rawTranscript": "habari za asubuhi karibu kwenye mkutano wetu wa leo",
"prettified": true,
"text": "Habari za asubuhi, karibu kwenye mkutano wetu wa leo.",
"durationSeconds": 45.2,
"chunksUsed": 2,
"billing": {
"cost": 8,
"balanceBefore": 250,
"balanceAfter": 242,
"pricing": {
"rate": "per_second"
}
}
},
"meta": {
"cost": 8,
"balanceBefore": 250,
"balanceAfter": 242,
"pricing": {
"rate": "per_second"
}
}
}data.transcript: The finalized transcript. Ifprettifyis enabled, this contains punctuation and capitalization.data.rawTranscript: The raw, unformatted acoustic model output.data.prettified: Boolean indicating whether formatting was applied.data.durationSeconds: Exact audio duration detected by server-side FFmpeg analysis.data.chunksUsed: Number of audio segments processed.data.billing: Mansa Credits consumed and remaining account balance.
Supported Languages (38 Languages)
Language inputs are case-insensitive. You can pass full language names, common aliases, or standard ISO 639 codes:
[!TIP] Regional Arabic dialects (e.g.
Arabic (Egyptian),Arabic (Algerian),Arabic (Moroccan)) and Malagasy dialects (e.g.Malagasy (Plateau)) are automatically normalized to their respective model targets.
Errors & HTTP Status Codes
Errors use the standard RFC-7807 error format (HttpErrorDto):
{
"type": "about:blank",
"title": "BAD_REQUEST",
"isError": true,
"detail": "Either audioUrl or audioBase64 must be provided in the JSON payload.",
"invalidParams": [],
"context": ""
}Billing & Credits
- Automatic Server Duration Calculation: Billed duration is detected by server-side FFmpeg analysis of the audio stream.
- Pricing Rate: Transcription is billed on a per-second basis, equivalent to $10 per hour of audio (~$0.17 per minute).
- Solvency Check: A preflight check verifies your wallet has sufficient balance for the estimated recording length before inference starts.
- Text Prettification: Included at no additional charge when
prettify: trueis enabled.
For account balance management and bulk packages, see Pricing.