apyhub
Back
▣ INGESTION KIT · OUTPUT KIT

Transcribe Audio & Video to Text API

What it does

The audio transcription API turns speech in an audio or video file into text. Send the file as file_base64 with its file_name, and get back the transcript, the duration_seconds and the billed minutes.

Set format to txt for plain text, or to srt for subtitles with a start and end time for each line. Plain text is the default. Each SRT cue has a number, a time range such as 00:00:00,100 --> 00:00:02,009 and the spoken line, ready to load into a video player.

Supported files are MP3, WAV, M4A, OGG, FLAC, AAC, OPUS, MP4, WEBM, MOV and MKV, up to 20 MB. Media with no speech returns an error instead of an empty transcript.

Teams use the audio transcription API to transcribe meetings, customer calls and interviews, add subtitles to videos and make recordings searchable.

To translate the transcript, use the Text Translation API. To remove names and phone numbers from call transcripts, use the Text Anonymization API.

POST
Transcribe Audio or Video to Text
https://api.eu.apyhub.com/skavio/transcribe-audio-video-to-text

QUICKSTART

GUIDE

Quickstart

Transcribe a short MP3 call recording.

curl -X POST "https://api.eu.apyhub.com/skavio/transcribe-audio-video-to-text" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "file_name": "call.mp3",
    "file_base64": "SUQzBAAAAAAA...",
    "format": "txt"
  }'

What you'll get back

A real response for a 5-second clip:

{
  "transcript": "Hello, this is a test call. Please send the invoice by Friday.",
  "format": "txt",
  "duration_seconds": 5.472,
  "minutes": 2,
  "status": "completed",
  "usage": { "atoms": 1320, "units": 2, "unit": "minute" },
  "request_id": "1971d219-d1f1-4334-91f2-50fa349d3f77-79623c32"
}

With "format": "srt" the transcript looks like this:

1 00:00:00,100 --> 00:00:02,009 Hello, this is a test call. 2 00:00:02,625 --> 00:00:04,894 Please send the invoice by Friday.
TRY ITLIVE · 1980 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
File name with extension (mp3, wav, m4a, ogg, flac, aac, opus, mp4, webm, mov, mkv).
Base64-encoded file (max 20 MB decoded).

About this endpoint

What it does

Transcribes speech in an audio or video file. Returns plain text or SRT subtitles with timings.

Limits

  • Maximum file size is 20 MB.
  • Supported files: MP3, WAV, M4A, OGG, FLAC, AAC, OPUS, MP4, WEBM, MOV, MKV.
  • Media with no speech returns 422 with processing_failed.

Request Body

ParameterTypeMandatoryDescription
file_base64StringYesThe file, base64-encoded. Maximum decoded size is 20 MB.
file_nameStringYesFile name with extension, e.g. call.mp3. The extension tells the API how to read the file.
formatStringNotxt for plain text or srt for subtitles. Default: txt.

Response

ParameterTypeDescription
transcriptStringThe transcript. With srt, numbered cues with time ranges, e.g. 00:00:00,100 --> 00:00:02,009.
formatStringtxt or srt.
duration_secondsNumberLength of the media in seconds.
minutesIntegerMinutes billed for the request.
statusStringcompleted on success.
usageObjectunits and unit (minute) counted for the request, plus atoms.
request_idStringID for support requests.

Errors

StatusCodeWhen
400missing_filefile_base64 is empty or missing.
400invalid_base64file_base64 is not valid base64.
413file_too_largeThe decoded file is over 20 MB.
415unsupported_file_typeThe file_name extension is not a supported media type.
422unprocessable_fileThe file cannot be read, e.g. a corrupt PDF or a file whose content does not match its extension.
422processing_failedThe file was read but could not be processed.
429busyToo many requests are in progress. Retry after a short wait.
400invalid_formatformat is not txt or srt.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.