Overview
POST /v1/transcribe takes a recording and returns what was said, as text. People in the Sahel send voice notes far more than they type: transcription lets your app read them, search them, file them or reply to them.
- Model:
speech-recognition(beta) - Languages: Hausa
ha(default), Zarmadje, Frenchfr - Input: WAV, MP3, M4A/AAC, OGG/Opus, WebM or FLAC; up to 25 MB and 5 minutes
- Counts: the length of the audio you send
Quickstart
Send the file as a multipart field namedfile, with the language beside it:
Response
Sending the audio as the body
If your recording is already in memory, you can send the bytes as the whole request body and putlanguage in the query string. Useful from a phone, where building a multipart form is extra work:
Request
file
required
The recording. The API recognises the container from the file itself, so the file name and content type do not matter.
string
default:"ha"
The language spoken:
ha, dje or fr. The model does not detect it: send the language you expect.Supported audio
A file the API cannot read returns
415 unsupported_audio. More in audio formats.
Reading the result
textis in lower case, without punctuation. Add capital letters and full stops yourself if you show it to people.audio_secondsis the length of what you sent, which is what was counted.- An empty recording returns
400 empty_audio.
Best practices
Record close to the speaker
Record close to the speaker
Most errors come from distance and noise, not language. A phone held near the mouth, out of the wind, gives far better text than one on a table across the room.
Send the language people actually speak
Send the language people actually speak
If a user picked Zarma in your app, send
dje. For mixed Hausa and French speech, send the language most of it is in.Do not convert before sending
Do not convert before sending
Send the voice note as it is. Converting an OGG to WAV first makes the upload about ten times larger and does not improve the text.
Cut long recordings
Cut long recordings
Up to 5 minutes per request. For a longer meeting or programme, cut it at silences into pieces under 5 minutes and send them in order. See long recordings.
Check what matters
Check what matters
Transcripts can be wrong, especially for names, numbers and noisy audio. When the text drives a decision (a dose, an amount, an address), show it back to the person or have someone check it.
Limits
- 25 MB and 300 seconds per file (
413 payload_too_large,413 audio_too_long). - One language per request; no automatic language detection.
- No timestamps or speaker labels yet.
Related
Transcribe a voice note
Tutorial
Translation
Speech straight to French or Hausa
API reference
POST /v1/transcribe