# Subtitles and chapters API

Tracks made after a video is ready: subtitles from speech, and chapters from an LLM.

Source: https://clipmux.com/docs/reference/api/subtitles-and-chapters

A new track replaces the old one only once it is ready.

## Make subtitles or chapters [#make-subtitles-or-chapters]

`POST /v1/assets/{id}/tracks`

Makes a new subtitles or chapters track. The old one keeps playing until the new one is ready. Chapters need ready subtitles and a connected LLM.

**Authentication:** An API key with `assets:write`.

### Parameters [#parameters]

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Asset ID (ast_…). |
| `Idempotency-Key` | header | string | no | A retry with the same key and request returns the first response; a different request is 422 idempotency_key_reused. |

### Request body [#request-body]

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `kind` | "subtitles", "chapters" | yes |  |
| `supersede` | boolean | no |  |

```json
{
  "kind": "subtitles"
}
```

### Response 202 [#response-202]

Queued

```json
{
  "track": {
    "id": "trk_01j0qtsj1vyp4dyn7fsdkb9t8q",
    "kind": "subtitles",
    "source": "generated",
    "status": "preparing"
  },
  "job": {
    "id": "job_01jq68ea3qk8sxe3rv83fez7sf",
    "kind": "transcribe",
    "status": "queued"
  }
}
```

### Errors [#errors]

| Status | Code |
| --- | --- |
| 400 | [`invalid_request`](/docs/reference/errors#invalid_request) |
| 401 | [`unauthorized`](/docs/reference/errors#unauthorized) |
| 403 | [`insufficient_scope`](/docs/reference/errors#insufficient_scope) |
| 404 | [`not_found`](/docs/reference/errors#not_found) |
| 409 | [`asset_not_ready`](/docs/reference/errors#asset_not_ready) |
| 409 | [`no_audio`](/docs/reference/errors#no_audio) |
| 409 | [`subtitles_not_ready`](/docs/reference/errors#subtitles_not_ready) |
| 409 | [`chapters_not_connected`](/docs/reference/errors#chapters_not_connected) |
| 409 | [`job_active`](/docs/reference/errors#job_active) |
| 409 | [`asset_deleted`](/docs/reference/errors#asset_deleted) |
| 409 | [`idempotency_in_progress`](/docs/reference/errors#idempotency_in_progress) |
| 422 | [`idempotency_key_reused`](/docs/reference/errors#idempotency_key_reused) |
| 429 | [`rate_limited`](/docs/reference/errors#rate_limited) |

## Get a track [#get-a-track]

`GET /v1/assets/{id}/tracks/{track_id}`

A track, with its chapters once a chapters track is ready.

**Authentication:** An API key with `assets:read`.

### Parameters [#parameters-1]

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Asset ID (ast_…). |
| `track_id` | path | string | yes |  |

### Response 200 [#response-200]

The track; chapters once a chapters track is ready

```json
{
  "id": "trk_01jbz1ke29rzfnpwz5grhd401k",
  "kind": "chapters",
  "source": "generated",
  "status": "ready",
  "duration_ms": 1830400,
  "chapters": [
    {
      "start_ms": 0,
      "end_ms": 412000,
      "title": "Why sorting matters"
    },
    {
      "start_ms": 412000,
      "end_ms": 1830400,
      "title": "Merge sort"
    }
  ]
}
```

### Errors [#errors-1]

| Status | Code |
| --- | --- |
| 400 | [`invalid_request`](/docs/reference/errors#invalid_request) |
| 401 | [`unauthorized`](/docs/reference/errors#unauthorized) |
| 403 | [`insufficient_scope`](/docs/reference/errors#insufficient_scope) |
| 404 | [`not_found`](/docs/reference/errors#not_found) |
| 429 | [`rate_limited`](/docs/reference/errors#rate_limited) |

## Delete a track [#delete-a-track]

`DELETE /v1/assets/{id}/tracks/{track_id}`

Removes a track: its file and transcript go at once. `200` once no playlist lists it, `202` while it is unpublished.

**Authentication:** An API key with `assets:write`.

### Parameters [#parameters-2]

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Asset ID (ast_…). |
| `track_id` | path | string | yes |  |

### Response 200 [#response-200-1]

No route lists it

```json
{
  "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
  "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
  "status": "ready",
  "version": 6,
  "passthrough": "lesson_42",
  "title": "Lesson 42: Sorting",
  "base_url": "https://media.example.com",
  "playback_ids": [
    {
      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
      "policy": "signed",
      "playable": true,
      "status": "active"
    }
  ],
  "duration_seconds": 1830.4,
  "tracks": [
    {
      "id": "trk_01jbz1ke29rzfnpwz5grhd401k",
      "kind": "chapters",
      "source": "generated",
      "status": "ready"
    }
  ],
  "created_at": "2026-11-18T09:30:00Z",
  "updated_at": "2026-11-18T09:34:12Z"
}
```

### Response 202 [#response-202-1]

Being unpublished

```json
{
  "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
  "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
  "status": "ready",
  "version": 5,
  "passthrough": "lesson_42",
  "title": "Lesson 42: Sorting",
  "base_url": "https://media.example.com",
  "playback_ids": [
    {
      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
      "policy": "signed",
      "playable": true,
      "status": "active"
    }
  ],
  "duration_seconds": 1830.4,
  "tracks": [
    {
      "id": "trk_01jbz1ke29rzfnpwz5grhd401k",
      "kind": "chapters",
      "source": "generated",
      "status": "ready"
    }
  ],
  "created_at": "2026-11-18T09:30:00Z",
  "updated_at": "2026-11-18T09:34:12Z"
}
```

### Errors [#errors-2]

| Status | Code |
| --- | --- |
| 400 | [`invalid_request`](/docs/reference/errors#invalid_request) |
| 401 | [`unauthorized`](/docs/reference/errors#unauthorized) |
| 403 | [`insufficient_scope`](/docs/reference/errors#insufficient_scope) |
| 404 | [`not_found`](/docs/reference/errors#not_found) |
| 429 | [`rate_limited`](/docs/reference/errors#rate_limited) |

## Get a subtitles track's transcript [#get-a-subtitles-tracks-transcript]

`GET /v1/assets/{id}/tracks/{track_id}/transcript`

A subtitles track's transcript, from the moment the track reads `ready`; `409 track_not_ready` before. Add `words=true` for word timings.

**Authentication:** An API key with `assets:read`.

### Parameters [#parameters-3]

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Asset ID (ast_…). |
| `track_id` | path | string | yes |  |
| `words` | query | boolean | no | Include word timings. |

### Response 200 [#response-200-2]

The transcript

```json
{
  "track_id": "trk_01j0qtsj1vyp4dyn7fsdkb9t8q",
  "language": "en",
  "duration_ms": 1830400,
  "text": "Today we look at three ways to sort a list.",
  "segments": [
    {
      "id": "s0",
      "start_ms": 0,
      "end_ms": 4200,
      "text": "Today we look at three ways to sort a list."
    }
  ]
}
```

### Errors [#errors-3]

| Status | Code |
| --- | --- |
| 400 | [`invalid_request`](/docs/reference/errors#invalid_request) |
| 401 | [`unauthorized`](/docs/reference/errors#unauthorized) |
| 403 | [`insufficient_scope`](/docs/reference/errors#insufficient_scope) |
| 404 | [`not_found`](/docs/reference/errors#not_found) |
| 409 | [`track_not_ready`](/docs/reference/errors#track_not_ready) |
| 429 | [`rate_limited`](/docs/reference/errors#rate_limited) |
