# editor.clip.key

Source: https://docs.lightair.app/developers/remote-api/editor.clip.key

> Sets a keyframe on a clip's property at a moment, with its value and ease, or removes one.

JSON-RPC 2.0 method of Lightair's Remote API (ws://localhost:4455/rpc). Group: Editor. Script plugins need the `project.write` permission.

Properties include `speed`, `x`, `y`, `scale`, `rotation`, `opacity`, `volume`, `tilt.x`, `tilt.y`, `grade.<lift|gamma|gain>.<r|g|b|master>`, `key.*` and `mask.<id>.*`. A `speed` key goes on the clip's linked clips too.

Eases: `smooth`, `linear`, `hold`, `ease in`, `ease out`, `ease in and out` (with spaces, `-` or `_`), or `curve` with `curve: [x1, y1, x2, y2]`.

## Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `clip` | `string` | yes | The clip's id, from editor.timeline.get. |
| `property` | `string` | yes | The property. |
| `at_ms` | `number` | no | A moment on the canvas, over the clip. Default: the playhead. |
| `value` | `number` | no | Its value there. |
| `ease` | `string` | no | How it moves on from there. |
| `curve` | `[number, number, number, number]` | no | With `ease: curve`. |
| `remove` | `boolean` | no | Remove the key there instead. |
| `canvas` | `string` | no | A canvas's id or name, shown first. Default: the canvas shown. |

## Result

| Name | Type | Required | Description |
|---|---|---|---|
| `(the clip)` | `{ id: string, name: string, track: number, start_ms: number, end_ms: number, in_ms: number, out_ms: number, speed: number, volume: number, muted: boolean, media: string | null, text: string | null }` | no | The clip as editor.timeline.get lists it. |

## Errors

Invalid params (-32602) when the moment isn't over the clip, or for an unknown ease. A state error (-32005) when no Editor project is open, or the open one is read-only because a newer Lightair made it. Invalid params (-32602) for a clip id that can't be read; not found (-32004) for a clip that isn't on the canvas.

## Events

- `editor.changed`

## From an AI agent

The MCP server's `editor_clip (action: key)` reaches this method.

## Example

```json
{ "jsonrpc": "2.0", "id": 1, "method": "editor.clip.key", "params": { "clip": "019ad3f6-5e6f-7071-8283-9e0f1a2b3c4d", "property": "scale", "at_ms": 2000, "value": 1.4, "ease": "ease in and out" } }
```

Result:

```json
{ "id": "019ad3f6-5e6f-7071-8283-9e0f1a2b3c4d", "name": "intro", "track": 0, "start_ms": 0, "end_ms": 12000, "in_ms": 0, "out_ms": 12000, "speed": 1, "volume": 1, "muted": false, "media": "019ad3f6-6f70-7182-9394-0f1a2b3c4d5e", "text": null }
```

## Related

- [editor.clip.set](https://docs.lightair.app/developers/remote-api/editor.clip.set.md)
