Overview
Convert spoken audio or video into accurate, timestamped text with speaker labels. The pipeline is asynchronous: submit a job with a local file or a public URL, poll until it completes, then retrieve the segmented transcript.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
4
Set your API key to use in your code
Code
Transcribing a local file
Passmedia_file instead of media_url to upload a local file:
Subtitle Formatting
By default, the transcript is segmented by natural speech patterns rather than by subtitle-length rules. Passformatting_options to segment it into subtitle-ready cues instead:
max_segment_duration_in_seconds(default7.0): the longest a single segment may stay on screen.min_segment_duration_in_seconds(default1.0): the shortest a single segment may stay on screen.max_characters_in_segment(default42): the maximum number of characters allowed in one segment.
srt or vtt instead of the structured JSON 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 subtitles translated into languages other than the source? Use the Subtitles tutorial. It runs the same segmentation across one or more target languages.
Parameters
Required
Optional
Result shape
get_transcription_result returns a TranscriptionResult with a transcript array. Each segment contains:
When you pass
format_type and/or data_type, the call instead returns a TranscriptExportResult with a single transcript string, either the rendered srt/vtt/txt content or a presigned URL to it.
Languages
The Python and TypeScript SDKs expect theLanguages enum:
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 languages, see the Source 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. - File size: Uploaded files must be under 20 MB. For longer recordings, host the file and pass a
media_urlinstead, or split the recording into chunks. - 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 language: Specifying the correct source language significantly improves accuracy. For multilingual content, choose the predominant language.
Next Steps
Create Transcription API
Full API reference for the transcription endpoint.
Poll Transcription Result
Status polling endpoint reference.
Get Transcription Run Result
Retrieve the transcript segments and timing data.
Subtitles
Generate cue-ready subtitles translated into one or more target languages.
Dubbing
Translate a video into another language while preserving the original voice.