Create timestamped chapters for a video with the Mux Robots API, and steer the chapter style, granularity, and audience. Use chapters when viewers must jump to sections of long content, such as lectures or podcasts.
Generate timestamped chapters from a video's caption track. This is useful for creating a table of contents for long-form video content, improving navigation, and making video content easier to scan. See the Generate Chapters API referenceAPI for the full endpoint specification. See Mux Robots pricing for unit costs.
Check the shared workflow prerequisites before creating a job.
Chapter generation uses caption tracks on the asset to understand the video content. Make sure your asset has captions, either auto-generated or manually added, before creating a chapter generation job.
generate-chapters jobcurl https://api.mux.com/robots/v1/jobs/generate-chapters \
-H "Content-Type: application/json" \
-X POST \
-d '{
"parameters": {
"asset_id": "YOUR_ASSET_ID"
}
}' \
-u ${MUX_TOKEN_ID}:${MUX_TOKEN_SECRET}This request is asynchronous. The POST returns immediately with the job in pending status and does not include results. We strongly recommend listening for the robots.v1.job.generate_chapters.completed webhook — the payload contains the full completed job, so no follow-up API call is needed. If webhooks aren't an option, you can poll GET /robots/v1/jobs/generate-chapters/{JOB_ID} with the id from the response until the status is completed.
| Parameter | Type | Description |
|---|---|---|
asset_id | string | Required. The Mux asset ID of the video to generate chapters for. |
language_code | string | BCP 47 language code of the caption source. An explicit language must match a ready source exactly, including case; for example, en does not match en-US. Translation target exclusion and track replacement instead compare base languages case-insensitively. When omitted, automatic selection applies. Uses the first ready subtitle in asset track order without English preference. Audio-only assets with one ready text track lacking subtitle metadata can use that legacy transcript. |
output_language_code | string | BCP 47 language code for the output chapter titles. Auto-detected from the transcript if omitted. |
output_steering | object | Curated output_steering controls for chapter style, granularity, audience, and brand terminology. These controls guide model behavior but do not guarantee exact output. |
update_asset_chapters | boolean | When true, the generated chapters are written back to the Mux asset as a chapters text track once the job completes, making them deliverable with the asset. Overwrites existing chapters: an asset holds a single chapters track, so any chapters track already on the asset is deleted and replaced — including one in a different language, and one you created yourself. Best-effort — a failed write does not fail the job — so check asset_updates.chapters in the job outputs for the outcome. |
output_steering
| Field | Type | Description |
|---|---|---|
chapter_style | string | Best-effort style guidance for generated chapter titles. Possible values: descriptive, punchy, educational, seo, platform_neutral. |
chapter_granularity | string | Best-effort guidance for how coarse or fine chapter boundaries should be. Possible values: coarse, balanced, fine. |
audience | string | Intended audience used as best-effort model guidance. Does not change the output schema. Up to 160 characters. |
brand_terms | array of string | Preferred brand or domain terms to use when supported by the source content. The combined length of all terms must be 240 characters or fewer. Up to 10 items. Each item: up to 40 characters. |
Use output_steering when you want best-effort control over how chapters are generated. These fields guide the workflow but do not guarantee exact output. All output_steering fields are optional; include only the fields you need.
{
"parameters": {
"asset_id": "YOUR_ASSET_ID",
"output_steering": {
"chapter_style": "educational",
"chapter_granularity": "fine",
"audience": "home cooks following along step by step",
"brand_terms": ["Dutch oven", "mirepoix"]
}
}
}The outputs object is included in the job once its status is completed. You'll receive it on the robots.v1.job.generate_chapters.completed webhook (recommended), or you can fetch it with GET /robots/v1/jobs/generate-chapters/{JOB_ID}. It contains:
| Field | Type | Description |
|---|---|---|
chapters | array of object | Required. Generated chapters, ordered by start time. |
asset_updates | object | Recorded best-effort chapters track update outcome. A failed update does not fail the analysis job. Omitted when no outcome was recorded. |
chapters[]
| Field | Type | Description |
|---|---|---|
start_time | number | Required. Chapter start time in seconds. The first chapter always starts at 0. |
title | string | Required. Concise chapter title. |
asset_updates
| Field | Type | Description |
|---|---|---|
chapters | object | What happened when the generated chapters were written back to the Mux asset. Present only when update_asset_chapters was true. When status is failed and replaced_track_ids is nonempty, deletion succeeded but replacement creation failed, leaving the asset without a chapters track. |
asset_updates.chapters
| Field | Type | Description |
|---|---|---|
status | string | Required. Outcome of the chapters track write. created means the asset now carries these chapters. failed means the write was attempted and errored; the chapters in this response are still valid and can be applied manually. |
track_id | string | Mux text track ID of the chapters track created on the asset. Present when status is created. |
replaced_track_ids | array of string | IDs of tracks deleted during replacement. Omitted when no deletions were recorded; historical jobs may lack this information. |
This example uses a five-minute asset, consuming 550 units. It is the job delivered in the robots.v1.job.generate_chapters.completed webhook's data field and returned by GET /robots/v1/jobs/generate-chapters/{JOB_ID}:
{
"data": {
"id": "rjob_ghi789",
"workflow": "generate-chapters",
"status": "completed",
"units_consumed": 550,
"created_at": 1746403200,
"updated_at": 1746403260,
"parameters": {
"asset_id": "YOUR_ASSET_ID",
"output_steering": {
"chapter_style": "educational",
"chapter_granularity": "fine",
"audience": "home cooks following along step by step",
"brand_terms": ["Dutch oven", "mirepoix"]
}
},
"outputs": {
"chapters": [
{ "start_time": 0, "title": "Gather your ingredients" },
{ "start_time": 18.5, "title": "Preheat the oven to 375°F" },
{ "start_time": 42.1, "title": "Dice the onions and garlic" },
{ "start_time": 95.3, "title": "Sear the chicken thighs" },
{ "start_time": 158.7, "title": "Deglaze with white wine" },
{ "start_time": 203.4, "title": "Simmer the sauce" },
{ "start_time": 278.9, "title": "Plate and garnish" }
]
}
}
}Set update_asset_chapters to true to have Mux write the generated chapters to the asset as a chapters text track, so they're delivered with the asset.
An asset holds a single chapters track, so any chapters track already on the asset is deleted and replaced. That includes one in a different language, or one you added yourself. The new track uses the language of the chapter titles.
The write is best-effort: if it fails, the job still completes with the generated chapters. Check outputs.asset_updates.chapters for the outcome; its fields are listed in the Output table.
{
"asset_updates": {
"chapters": {
"status": "created",
"track_id": "track_chapters_abc123",
"replaced_track_ids": ["track_chapters_old456"]
}
}
}