Skip to content

DocsGuides

Transcripts and captions

What is said in a video or a recording, in English or Polish, as JSON with times, SubRip and WebVTT.

POST /v1/transcribe reads the first audio stream of a file and writes what is said in it. In POST /v1/jobs it is an output of type transcript, next to any other outputs of the same input. It runs whisper.cpp with a voice activity model that skips what is not speech.

The request#

bash
curl "$VIDEXO_API_URL/v1/transcribe" \
  -H "Authorization: Bearer $VIDEXO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": "https://example.com/talk.mp4",
  "language": "en",
  "filename": "talk.json"
}'

talk.json, talk.srt and talk.vtt: each segment of speech with its start and end on the clock of the input.

language is required: en or pl. It is never detected, and other languages are refused.

The files#

One output writes three files, each with the output's name: talk.json, talk.srt and talk.vtt.

JSON
{
  "language": "en",
  "model": "small",
  "start": 0,
  "end": 11,
  "text": "And so my fellow Americans, ask not what your country can do for you.",
  "segments": [
    { "start": 0.3, "end": 7.5, "text": "And so my fellow Americans, ask not what your country" },
    { "start": 7.5, "end": 11, "text": "can do for you." }
  ]
}

Times are in seconds on the input's clock. Segments are phrases, not single words. model says which model made the file. A recording with no speech is a result, not a failure: segments is empty, the WebVTT file holds only its header, and the job is billed as usual.

A part of a file#

trim reads only that part; the times stay on the input's clock.

bash
curl "$VIDEXO_API_URL/v1/transcribe" \
  -H "Authorization: Bearer $VIDEXO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": "https://example.com/talk.mp4",
  "language": "pl",
  "trim": {
    "start": 60,
    "duration": 300
  }
}'

Captions on the video#

The .srt file is an input for subtitles in a second job, which burns it in. One job does not do both yet.

When it fails#

  • A file with no audio stream fails with processing_failed (no_audio), and costs only the data fetched.
  • A trim with none of the sound in it fails with processing_failed (time_past_end), at the same cost.
  • Media longer than your plan's longest job fails with limit_exceeded (job_duration). See Limits.

What it costs#

5 credits a minute of the media transcribed, prorated per second, for the three files together, plus data. See Limits. Silence inside the media counts: the bill follows the media's length, not the speech in it. A gap in a stream's timestamps holds no sound, so it is not billed, and the times after it stay right.