# keyframe.set_easing

> Changes the easing of the segment that starts at a keyframe.

Source: https://stuarty.com/docs/mcp/tools/edit/keyframe.set_easing/

Gives the keyframe at the absolute position a named easing (easing), a custom cubic Bezier curve (bezier: x1, y1, x2, y2; x1 and x2 from 0 to 1, y1 and y2 from -2 to 3) or a named Bezier preset (preset: in, out, in_out, back, overshoot, stored as its four numbers). Exactly one of the three. The value and the time of the keyframe do not change. Works for every animatable property, crop and mask included.

## Arguments

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `at` | `string` | yes | Position of an existing keyframe on the project timeline. |
| `bezier` | array of `number` | no | X1, y1, x2, y2 of a cubic Bezier curve: x1 and x2 from 0 to 1, y1 and y2 from -2 to 3.; at least 4 items; at most 4 items |
| `easing` | `linear`, `ease_in`, `ease_out`, `ease_in_out`, `hold` | no | A named easing. Exactly one of easing, bezier and preset. |
| `item_id` | `string` | yes | pattern `^itm_[0123456789abcdefghjkmnpqrstvwxyz]{10}$` |
| `preset` | `in`, `out`, `in_out`, `back`, `overshoot` | no | A named Bezier curve, stored as its four numbers. |
| `property` | `string`, one of 21 values | yes |  |

## 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)

## Scope

Scope `edit`. The scope is the one an API key needs in network mode. Run `stuarty command:help keyframe.set_easing` for the same description from the binary, or call the [`command_help`](/docs/mcp/tools/command_help) tool.

## Next steps

- [The edit tool](/docs/mcp/tools/edit)
- [Batches, revisions and idempotency](/docs/agents/batches)

**As an MCP call**

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "edit",
    "arguments": {
      "project_id": "prj_7k2m9x4q1b",
      "base_revision": 12,
      "operations": [
        {
          "op": "keyframe.set_easing",
          "args": {
            "at": "1s",
            "item_id": "itm_s6t7v8w9x0",
            "preset": "overshoot",
            "property": "scale"
          }
        }
      ]
    }
  }
}
```

**As a batch file for the CLI**

```json
[
  {
    "op": "keyframe.set_easing",
    "args": {
      "at": "1s",
      "item_id": "itm_s6t7v8w9x0",
      "preset": "overshoot",
      "property": "scale"
    }
  }
]
```

```bash
stuarty edit --project prj_7k2m9x4q1b --ops batch.json --json
```

**Over HTTP**

```bash
curl -X POST "http://127.0.0.1:7878/api/v1/projects/prj_7k2m9x4q1b/edit" \
  -H "Authorization: Bearer $STUARTY_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "base_revision": 12,
  "operations": [
    {
      "op": "keyframe.set_easing",
      "args": {
        "at": "1s",
        "item_id": "itm_s6t7v8w9x0",
        "preset": "overshoot",
        "property": "scale"
      }
    }
  ]
}'
```

The ids in the example are illustrative: read the real ones with `project_get`.
