Tools /
Merge subtitles
Merge two or more subtitle files into one. "sequential" appends each file after the previous one (split episodes, multi-part videos). "bilingual" stacks two languages into one track. Timeline alignment modes need the Basic plan: "keep-timing" overlays files with their original timestamps, "custom" places each file at its own offsetMs, and "collision-resolved" overlays files and nudges overlapping cues apart.
merge_subtitles
- Plan
- All plans
- Usage
- 1 upload per input file
- Effect
- Returns a new file
Parameters
| Parameter | Type | Description |
|---|---|---|
filesrequired | object[] | Files to merge, in order.2–50 items |
contentrequired | string | Full subtitle file contents as text (SRT, WebVTT, ASS/SSA, or the JSON produced by convert_subtitles). |
filenameoptional | string | Original file name. The extension helps detect the format. |
formatoptional | enum | Input format. Detected from the file name or contents when omitted."srt" · "vtt" · "ass" · "ssa" · "json" |
offsetMsoptional | integer | "custom" mode: milliseconds to shift this file by before merging.-86,400,000 to 86,400,000 |
modeoptional | enum | How to combine the files. keep-timing, custom and collision-resolved need the Basic plan."sequential" · "bilingual" · "keep-timing" · "custom" · "collision-resolved" · default "sequential" |
gapMsoptional | integer | Sequential mode: gap in milliseconds between the end of one file and the start of the next.0 to 600,000 |
bilingualPlacementoptional | enum | Bilingual mode: how the second language is shown."top-bottom" · "bracketed" · "color-coded" |
outputFormatoptional | enum | Output format. Defaults to the format of the (first) input."srt" · "vtt" · "ass" · "json" |
Example
You ask your assistant:
“Merge part1.srt and part2.srt into one file.”
It calls merge_subtitles with:
arguments
{
"files": [
{
"filename": "part1.srt",
"content": "1\n00:00:01,000 --> 00:00:03,500\nHello there.\n"
},
{
"filename": "part2.srt",
"content": "…"
}
],
"mode": "sequential"
}and gets back:
result
Merged 2 files (412 cues, 1h 32m 10s) in sequential mode as SRT.
1
00:00:01,000 --> …