---
title: "Create a 'generate-chapters' job"
method: POST
path: "/robots/v0/jobs/generate-chapters"
tags: ["Generate Chapters"]
---

# Create a 'generate-chapters' job

`POST /robots/v0/jobs/generate-chapters`

Creates a new job that uses AI to generate chapters for a Mux Video asset.

## Request body

- CreateGenerateChaptersJobRequest
  - `passthrough` string — Arbitrary string stored with the job and returned in responses. Useful for correlating jobs with your own systems.
  - `parameters` GenerateChaptersJobParameters, required
    - `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 track to analyze (e.g. "en", "fr"). When omitted, the SDK prefers English if available.
    - `output_language_code` string — BCP 47 language code for the output chapter titles. Auto-detected from the transcript if omitted.
    - `prompt_overrides` object — Override specific sections of the chapter generation prompt.
      - `task` string — Override the core task instruction for chapter generation.
      - `output_format` string — Override the JSON output format instructions.
      - `chapter_guidelines` string — Override the chapter density and timing constraints.
      - `title_guidelines` string — Override the chapter title style requirements.

## Response `202`

Chapters job queued

- GenerateChaptersJobResponse
  - `data` GenerateChaptersJob, required
    - `id` string, required — Unique job identifier.
    - `passthrough` string — Arbitrary string supplied at creation, returned as-is.
    - `units_consumed` integer, required — Number of Mux AI units consumed by this job.
    - `created_at` integer, required — Unix timestamp (seconds) when the job was created.
    - `updated_at` integer, required — Unix timestamp (seconds) when the job was last updated.
    - `workflow` 'generate-chapters', required
    - `parameters` GenerateChaptersJobParameters, required
      - `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 track to analyze (e.g. "en", "fr"). When omitted, the SDK prefers English if available.
      - `output_language_code` string — BCP 47 language code for the output chapter titles. Auto-detected from the transcript if omitted.
      - `prompt_overrides` object — Override specific sections of the chapter generation prompt.
        - `task` string — Override the core task instruction for chapter generation.
        - `output_format` string — Override the JSON output format instructions.
        - `chapter_guidelines` string — Override the chapter density and timing constraints.
        - `title_guidelines` string — Override the chapter title style requirements.
    - `status` 'pending' | 'processing' | 'completed' | 'errored' | 'cancelled', required — Current job status.
    - `outputs` GenerateChaptersJobOutputs — Workflow results. Present when status is 'completed'.
      - `chapters` object[], required — Generated chapters, ordered by start time.
        - `start_time` number, required — Chapter start time in seconds. The first chapter always starts at 0.
        - `title` string, required — Concise chapter title.
    - `errors` JobError[] — Error details. Present when status is 'errored'.
      - `type` string, required — Stable public error category identifier.
      - `message` string, required — Human-readable public error message.
      - `retryable` boolean — Whether retrying this job may resolve the error.
    - `resources` Resources — Related Mux resources linked to this job.
      - `assets` SlimlineAsset[], required — Mux assets associated with this job.
        - `id` string, required — Mux asset ID.
        - `meta` object — Mux asset metadata, if available.
          - `title` string — Asset title from Mux metadata.
          - `creator_id` string — Creator identifier from Mux metadata.
          - `external_id` string — External identifier from Mux metadata.
        - `passthrough` string — Passthrough string from the Mux asset.
        - `_links` object, required — Hypermedia links for the asset.
          - `self` object, required
            - `href` string, required — URL to the Mux asset resource.

## Other responses

- `401` — Missing Mux credentials
- `403` — Robots is not enabled for this environment. Accept the Robots beta terms in the Mux Dashboard to enable access.
- `422` — Asset not found, missing playback ID, or no transcript
- `500` — Server error

---

[API](https://skmtc.net/muxinc/apis/mux-api.md) · [All operations](https://skmtc.net/muxinc/apis/mux-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/muxinc/mux-api/revisions/34a65dce0f31/schema)
