Mansa Platform Docs

Transcribe

Convert a recorded audio file into text.

POST/v1/transcribe

Request example

AUDIO_BASE64=$(base64 < recording.wav | tr -d '\n')

curl --fail-with-body "$MANSA_API_BASE_URL/v1/transcribe" \
  -H "Authorization: Bearer $MANSA_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"audioBase64\":\"$AUDIO_BASE64\",\"language\":\"Swahili\",\"mimeType\":\"audio/wav\",\"filename\":\"recording.wav\",\"durationSeconds\":12}"

Output

{
  "context": "ok",
  "data": {
    "transcript": "habari za asubuhi"
  }
}

Send a recording as Base64 audio and read the text from data.transcript. Use the exact language name, such as Swahili.

Request fields

FieldTypeDefaultDescription
audioBase64stringRequiredBase64-encoded audio bytes without a data URL prefix
languagestringRequiredAn exact supported language value, such as Swahili
mimeTypestringaudio/wavThe recording's actual MIME type
filenamestringaudio.wavA filename whose extension matches the audio format
durationSecondsnumber1The recording's positive duration in seconds, used for billing

Send the audio in audioBase64. Provide the real duration and matching format metadata.

Read the result from data.transcript.

Supported languages

Language values are case-sensitive. Send the exact value shown below.

LanguageValueLanguageValue
AfrikaansAfrikaansAmharicAmharic
Arabic (Algerian)Arabic (Algerian)Arabic (Egyptian)Arabic (Egyptian)
Arabic (Libyan)Arabic (Libyan)Arabic (Moroccan)Arabic (Moroccan)
Arabic (Standard)Arabic (Standard)Arabic (Sudanese)Arabic (Sudanese)
Arabic (Tunisian)Arabic (Tunisian)BambaraBambara
BembaBembaChichewaChichewa
EnglishEnglishEweEwe
HausaHausaIgboIgbo
KinyarwandaKinyarwandaKirundiKirundi
LingalaLingalaLugandaLuganda
MalagasyMalagasyMalagasy (Plateau)Malagasy (Plateau)
OromoOromoSepediSepedi
ShonaShonaSomaliSomali
SwahiliSwahiliTigrinyaTigrinya
TsongaTsongaTswanaTswana
TwiTwiXhosaXhosa
YorubaYorubaZuluZulu

Language coverage differs between Transcribe, Translate, Chat, and TTS. Use the supported values documented for each endpoint.

Errors and billing

Invalid audio data or unsupported languages return invalid_request. Transcription is billed using durationSeconds.