Audio transcription API
Turn speech into text with the Pendra API. Upload a WAV, MP3 or FLAC file and get back text or SRT and WebVTT subtitles.
Upload an audio file as a multipart form. The endpoint also answers at
/v1/audio/transcriptions.
- Files can be up to 25 MB. A bigger one gets a
413. -
Send
wav,mp3orflac. The format is read from the file itself, not its name, and any other format gets a400.
file
file
Required
wav, mp3 or flac.
model
string
Required
whisper-large-v3-turbo.
language
string
en or
cy. Setting it improves accuracy.
prompt
string
temperature
number
default: 0
0 for the most accurate transcript. Raise it only
if a transcript gets stuck repeating itself. Above 0,
beam_size has no effect. At 0.5 or above,
prompt is ignored.
beam_size
integer
default: 5
1 to 8. Higher is more accurate but
slower. 1 is the fastest.
response_format
string
default: json
timestamp_granularities
string[]
["segment"], ["word"] or both. Only with
verbose_json.
Response
The shape depends on response_format:
| Format | Returns |
|---|---|
json | The default. { "text": "..." } |
text | The transcript as plain text. |
srt | Subtitles in SRT format. |
vtt | Subtitles in WebVTT format. |
verbose_json | The text plus language, duration and timed segments. |
A verbose_json reply looks like this:
{
"task": "transcribe",
"language": "en",
"duration": 12.48,
"text": "We're starting the meeting now. First item on the agenda is the Q3 forecast.",
"segments": [
{ "id": 0, "start": 0.0, "end": 4.2, "text": "We're starting the meeting now.", "avg_logprob": -0.21, "no_speech_prob": 0.01 },
{ "id": 1, "start": 4.2, "end": 12.48, "text": "First item on the agenda is the Q3 forecast.", "avg_logprob": -0.18, "no_speech_prob": 0.02 }
]
}
The JSON formats also have a pendra field naming the worker
that ran the request. Every format sends it in the
X-Worker-Id and X-Worker-Name headers. See
Which worker served a request.
Subtitles
Set response_format to srt or vtt
and the reply is the subtitle file itself:
1
00:00:00,000 --> 00:00:04,200
We're starting the meeting now.
2
00:00:04,200 --> 00:00:12,480
First item on the agenda is the Q3 forecast.
curl https://api.pendra.ai/api/v1/audio/transcriptions \
-H "Authorization: Bearer pdr_sk_..." \
-F file=@meeting.mp3 \
-F model=whisper-large-v3-turbo \
-F response_format=srt
Models
Every worker can run transcription. whisper-large-v3-turbo
is fast and a good default. whisper-large-v3 is the most
accurate. To see every transcription model, call
/models?type=transcription.