apyhub
Back
▣ AUDIO PROCESSING

Convert Speech to Text & Subtitles API

What it does

Speech to Text Subtitles turns an audio or video file into a transcript or subtitle file. Send a public url or a base64-encoded file in audio, then choose the output format as json, srt, vtt, or txt.

Use max_chars and max_seconds to control subtitle cue length, which is useful when you need readable captions for players, editors, or downstream workflows. If you choose json, you can also request word_timestamps to include each word with its start time, end time, and confidence.

The response gives you the full text, total duration in seconds, segments with start and end times, confidence as an average token score, and billed_minutes for usage tracking. That makes it straightforward to power media search, caption generation, meeting notes, or transcript storage without post-processing the raw output yourself.

POST
Transcribe audio or video
https://api.eu.apyhub.com/callable-labs/convert-speech-to-text-subtitles/v1/transcribe

QUICKSTART

GUIDE

Quickstart

Transcribe an audio file from a public URL and return subtitles/transcript in the default JSON format.

curl -X POST "https://api.eu.apyhub.com/callable-labs/convert-speech-to-text-subtitles/v1/transcribe" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "audio": {
      "url": "https://assets.apyhub.com/samples/sample-speech.mp3"
    }
  }'

What you'll get back

Returns a JSON object with text (the full transcript), duration (audio length in seconds), segments (the timed transcript segments), confidence (average token confidence from 0 to 1), and billed_minutes (minutes charged, rounded up).

{
  "text": "Hello and welcome to the show.",
  "duration": 61.2,
  "segments": [
    {
      "start": 0.32,
      "end": 2.4,
      "text": "Hello and welcome to the show."
    }
  ],
  "confidence": 0.97,
  "billed_minutes": 2
}
TRY ITLIVE · 25 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.
TranscribeRequest*
Choose how to send the file: a public URL or the file encoded as base64.
Public URL*
Public http(s) URL of the audio or video file
`json` (transcript, segments, timings), `srt`, `vtt` or `txt`
Longest segment or subtitle cue, in characters
Longest segment or subtitle cue, in seconds

About this endpoint

What it does

Transcribes an audio or video file and returns a structured transcript. You can provide the source either as a public URL or as base64/data URI content, and choose an output format for the transcription.

Request Body

ParameterTypeMandatoryDescription
audioObjectYesSource file for transcription. Provide one of audio.url or audio.base64.
audio.urlStringNoPublic http(s) URL of the audio or video file. Max length: 2048 characters.
audio.base64StringNoThe file as base64 or a data: URI.
formatENUMNoOutput format. Allowed values: json (transcript, segments, timings), srt, vtt, txt. Default: json.
max_charsIntegerNoLongest segment or subtitle cue, in characters. Default: 84. Minimum: 20. Maximum: 200.
max_secondsNumberNoLongest segment or subtitle cue, in seconds. Default: 7. Minimum: 1. Maximum: 30.
word_timestampsBooleanNoInclude every word with its start, end and confidence in json output. Default: false.

Response

Returns a JSON object with text as a string, duration as a number, segments as an array of objects, confidence as a number, and billed_minutes as an integer. The response is the transcription result, including the full transcript text, total audio duration, per-segment timing data, confidence, and billed minutes.

ParameterTypeMandatoryDescription
textStringYesThe whole transcript, punctuated and capitalised.
durationNumberYesAudio duration in seconds.
segmentsObject ArrayYesTranscript segments. Each segment includes start, end, and text; words is present when word_timestamps is enabled.
confidenceNumberYesAverage token confidence, 0–1.
billed_minutesIntegerYesAudio minutes this request counts against the plan, rounded up and at least 1.
▣ 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.