# caption.add

> Adds a caption item with timed words.

Source: https://alexgalhardo.github.io/vukem-video/pt-br/docs/reference/commands/caption.add

Adds a caption. Give either words (times relative to the caption, as lengths) or text with a duration: the text is split on whitespace and the words share the duration in proportion to their character counts. x and y are used when the caption style position of the track is custom.

## Arguments

| Argument | Type | Required | Description |
| --- | --- | --- | --- |
| `duration` | `string` | no | A length; with text only. |
| `id` | `string` | no |  |
| `linked_item` | `string` | no | The clip whose speech this transcribes; it need not exist. |
| `start` | `string` | yes | a time with a unit: "12.5s", "375f" or "00:00:12.500" |
| `text` | `string` | no | Text to split on whitespace; needs duration. |
| `track_id` | `string` | yes | A visual track. |
| `words` | array of `object` | no | Words with times relative to the caption, as lengths. |
| `x` | `number` | no |  |
| `y` | `number` | no |  |

## Example

As one operation of an `edit` batch (the `edit` tool of MCP, `vukem-video edit --ops`, or `POST /api/v1/projects/{id}/edit`):

```json
{
  "op": "caption.add",
  "args": {
    "duration": "48f",
    "id": "itm_s6t7v8w9x0",
    "linked_item": "itm_m1n2p3q4r5",
    "start": "12f",
    "text": "Meet the new editor.",
    "track_id": "trk_a1b2c3d4e5"
  }
}
```

## Errors

[`E_VALIDATION`](/docs/reference/error-codes#e_validation), [`E_INVALID_TIME`](/docs/reference/error-codes#e_invalid_time), [`E_NOT_FOUND`](/docs/reference/error-codes#e_not_found), [`E_TYPE_MISMATCH`](/docs/reference/error-codes#e_type_mismatch), [`E_INVALID_STATE`](/docs/reference/error-codes#e_invalid_state), [`E_ID_EXISTS`](/docs/reference/error-codes#e_id_exists), [`E_LIMIT`](/docs/reference/error-codes#e_limit), [`E_OVERLAP`](/docs/reference/error-codes#e_overlap)

## Scope and phase

Scope `edit`, phase `prototype`. Run `vukem-video command:help caption.add` for the same description from the binary.
