Skip to main content

Overview

Turn spoken media into cue-ready subtitles in the source language and any number of target languages, in a single job. The service transcribes the source, translates into each target language you request, and, when you ask for it, segments every language into cues sized for on-screen display. The pipeline is asynchronous: submit a job with a publicly accessible or signed media URL, poll until it completes, then retrieve the result for each language.

Prerequisites

1

Create an account

Sign up at CAMB.AI Studio if you haven’t already.
2

Get your API key

Go to Settings → API Keys in Studio and copy your key. See Authentication for details.
3

Install the SDK

Skip this step if you’re using the direct API.
4

Set your API key to use in your code


Code

In the Python SDK, subtitle results come back as a plain dict (result["transcript"]), not a typed model like transcription’s get_transcription_result. The isinstance check above handles that shape safely.

Generating multiple languages

List every locale you need in target_languages to translate and segment all of them from the same media URL:
Include the source language itself in target_languages if you also want same-language, subtitle-ready cues for the original speech. To fetch every language on the run in one call instead of one at a time, drop the language argument:
With a single target language, this returns the same shape as get_subtitle_result_for_language. With more than one, it returns a result keyed by language.

Subtitle Formatting

By default, target-language dialogue is translated but left unsegmented, the same speech-boundary segments you’d get from Translation, not subtitle-length cues. Pass formatting_options to segment every language into cues sized for on-screen display, and export directly as srt or vtt:
  • max_segment_duration_in_seconds (default 7.0): the longest a single cue may stay on screen.
  • min_segment_duration_in_seconds (default 1.0): the shortest a single cue may stay on screen.
  • max_characters_in_segment (default 42): the maximum number of characters allowed in one cue.
Once the task succeeds, request the export directly by passing format_type (and optionally data_type) to the result call. The response then carries a single transcript string instead of a segment array:
Need a plain transcript in a single language instead of translated, multi-language subtitles? Use the Transcription tutorial. It shares the same formatting_options field for subtitle-ready cues.

Parameters

Required

Optional

Result shape

get_subtitle_result_for_language and get_subtitle_result return a transcript array for each language, with the same segment shape as transcription: When a run has more than one language and you call get_subtitle_result without a language, the result is keyed by language instead of being a single transcript array. When you pass format_type and/or data_type, every returned language carries a single transcript string (the rendered srt/vtt/txt content or a presigned URL to it) instead of a segment array.

Languages

The Python and TypeScript SDKs expect the Languages enum for both source_language and target_languages: If you’re calling the API directly (not via the SDK), pass the locale tag. Numeric language IDs still work but are deprecated.
For the full list of supported source and target languages, see the Source Languages and Target Languages reference.

Tips

  • Supported formats: .mp3, .wav, .aac, .flac, .mp4, .mov, and .mxf (MXF is enterprise-only). For best quality use a lossless format like WAV or FLAC.
  • media_url is required: host the recording and pass a publicly accessible or signed URL. Local file upload is not supported on the subtitle endpoint.
  • target_languages is required and non-empty: always pass it as a list, even for a single language.
  • Polling timeout: for long media, cap your polling loop (e.g. 60 attempts x 5s = 5 minutes) and handle the timeout gracefully.
  • Pick the right source language: specifying the correct source language significantly improves both transcription and translation accuracy.

Next Steps

Create Subtitle API

Full API reference for the subtitle endpoint.

Poll Subtitle Result

Status polling endpoint reference.

Get Subtitle Run Result

Retrieve subtitle segments and timing data for every language on a run.

Transcription

Transcribe a single language, with the same subtitle-ready formatting options.
Last modified on July 27, 2026