Skip to main content

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), Zarma dje, French fr
  • 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 named file, 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 put language 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

  • text is in lower case, without punctuation. Add capital letters and full stops yourself if you show it to people.
  • audio_seconds is the length of what you sent, which is what was counted.
  • An empty recording returns 400 empty_audio.

Best practices

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.
If a user picked Zarma in your app, send dje. For mixed Hausa and French speech, send the language most of it is in.
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.
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.
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.

Transcribe a voice note

Tutorial

Translation

Speech straight to French or Hausa

API reference

POST /v1/transcribe