# caption.set_words

> Replaces the words of a caption.

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

Replaces all words (1 to 60, times relative to the caption, as lengths). The caption lasts until the end of the last word unless duration is given. Line breaks are cleared; keyframes are cut when the caption gets shorter.

## Arguments

| Argument | Type | Required | Description |
| --- | --- | --- | --- |
| `duration` | `string` | no | A length, at least the end of the last word. Default: that end. |
| `item_id` | `string` | yes | A caption. |
| `words` | array of `object` | yes | 1 to 60 words with times relative to the caption, as lengths. |

## 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.set_words",
  "args": {
    "item_id": "itm_s6t7v8w9x0",
    "words": [
      {
        "duration": "12f",
        "start": "0f",
        "text": "Hello"
      },
      {
        "duration": "12f",
        "start": "12f",
        "text": "world"
      }
    ]
  }
}
```

## 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_LIMIT`](/docs/reference/error-codes#e_limit), [`E_OVERLAP`](/docs/reference/error-codes#e_overlap)

## Scope and phase

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