Edit videos with an agent
Clean up recordings, cut clips, apply templates and export to a post from Codex, Claude Code or another MCP client, one project or many.
An assistant drives the Video Editor with the same commands as its menus, inspector and shortcuts. It edits the project open in your browser, so changes appear live and use the normal undo history. One tab can work through many projects one after another: the assistant creates or opens each project in the same tab.
How the assistant works
Find your tab.
editor_sessionslists connected tabs with the project name, storage, revision and last activity. The assistant uses your tab'ssession_idfor every other call.Read the project.
editor_contextreturns the authored revision, canvas, sequences and their template fields.timeline_inspectlists tracks from top to bottom (V1 is the bottom video track, A1 the first audio track) with stable item IDs.item_inspectshows one item as the inspector does: its values at a frame, the commands that edit each section, template fields and keyframes.Look up commands.
editor_referenceis a searchable, paged reference. Passeditor_kindvideo,kindcommandand thesession_id, and the open editor lists every command it can run with a JSON Schema for its arguments. Aqueryofcaptionreturnscaptions.enableandcaptions.style.Apply one batch.
video_editapplies up to 50 actions as one undoable step. Each call carries thesession_id, theproject_id, theexpected_revisionfromeditor_contextand a stablerequest_id. Retry a lost reply with the samerequest_id.Check the result.
preview_renderreturns a frame of the composed result.export_startrenders the video.
Each action names a command and its arguments:
{
"actions": [
{ "kind": "text.add", "ref": "title", "value": { "text": "Launch day", "frame": 0 } },
{ "kind": "motion.applyPreset", "args": { "itemIds": ["$title.id"], "presetId": "fade-in" } },
{ "kind": "marker.set", "args": { "frame": 90, "label": "Demo" } }
]
}A later action can use an earlier result with $<ref>.id or by position, such as $1.id or $2.itemIds[0]. If any action fails, nothing in the batch is applied, and the error names the failing field and the allowed values. Commands that take long, such as transcription, cleanup and imports, and commands that switch the sequence, run alone in their own batch.
Commands act on the IDs the assistant passes, never on your selection. Timeline times are whole frames of the active sequence. Source times are seconds.
Tools by job
| Job | Tools |
|---|---|
| Connect and read | editor_sessions, editor_context, editor_reference, timeline_inspect, item_inspect |
| Find footage | media_library, media_inspect, media_search, transcript_inspect, scene_search, scene_inspect |
| Look at sources | media_frame, media_storyboard |
| Analyze on device | media_analyze, media_analysis_status, media_analysis_cancel, scene_analyze, scene_analysis_status, scene_analysis_cancel |
| Edit | video_edit, library_search, library_inspect, library_apply, library_save |
| Check | preview_render, preview_audio (up to four seconds of the mix) |
| Switch projects | project_list, project_create, project_open |
| Export | export_preflight, export_start, export_status, export_cancel |
| Recover | editor_history_inspect, editor_history_undo, editor_history_redo, editor_work_status, editor_work_cancel |
Analysis runs in your browser. The original media stays there.
Clean up a talking-head recording and caption it
Ask: "Clean up the recording in my open video, remove fillers and long pauses, then add bold captions with a word highlight."
Transcribe the clip.
speech.transcribeis the Speech panel's action. It returns when the transcript is ready.List the cleanup candidates.
transcript_inspectreads the words.speech.suggestCleanuplists fillers, pauses (found in the audio, not only the transcript) and repeated takes, each with an ID.Remove the ones you want.
speech.cleanupremoves chosen candidates.speech.removeFillers,speech.shortenPauses(pauses keep 0.3 s by default),speech.removeRepeats, andspeech.removeWords(for exact word IDs or ranges) cut across linked tracks in one undoable step.Improve the sound and look.
audio.enhanceVoiceturns on Enhance voice.color.lookadds a preset from the Effects gallery (vintage,noir,cold,warm,dramatic,faded,crt,retro-tvortrigger-wave-layer). For music beds,music.detectBeats,music.cutOnBeats, andmusic.syncToBeatsalign cuts to the rhythm.Add captions.
captions.enable, thencaptions.stylewith, for example, thetiktokpreset and thekaraokehighlight. Captions follow the transcript, so later cuts keep them in sync.Check a few frames and export.
preview_render, then export.
Make three vertical clips from a long video
Ask: "Make three 30-second vertical clips from the strongest moments of this webinar."
Choose three source ranges.
The assistant reads the transcript with
transcript_inspect, or searches scenes withscene_search.Create a project per clip.
project_createwithwidth: 1080andheight: 1920. The tab opens it, and the assistant waits untileditor_contextshows the new project.Place and trim the source.
media.importWorkspaceadds the webinar from Workspace Media (it takesworkspaceMediaIdsfromlist_media).timeline.placeMediaplaces it (media.insertremains as a legacy alias),clip.trimtrims it, andclips.reframe(fit,fill, orfit-blur) oritem.transformreframes it for the vertical canvas.Add a title and export.
text.addadds a title.motion.applyPreset, orkeyframes.addwithkeyframes.setEasing(named curves such assmoothorgentle-spring), animates it. Thenexport_start.
To keep the clips in one project, the assistant can create a sequence for each with sequence.create.
Apply a template to many videos
Ask: "Put our intro template on each of these 20 product videos with the product name as the title."
A template is a sequence that publishes fields, such as a title text or a brand color. editor_context lists each sequence's template_fields.
Open or create the project.
project_openorproject_create.Add the video.
media.importWorkspace, thentimeline.placeMedia.Insert the template and fill its fields.
template.placetakescompositionId,frameandfieldsby name, such as Title set to "Trail Runner 3".template.setFieldschanges them later.Export, then move to the next project.
Saved library items work too. library_search finds them in pages and library_apply inserts one.
Preview and export to a post
Ask: "Show me the frame at 10 seconds, then export the video and attach it to a draft for Instagram."
Render the frame.
preview_rendertakes theframe.preview_audiorenders up to four seconds of the mix betweenstart_frameandend_frame.Plan the export.
export_preflighttakes the same options asexport_startand exports nothing. Read its result before you start.Start the export.
export_startreturns anexport_id. It renders in your tab, so keep the tab open.Wait for the media ID.
export_statusreports progress and, when done, themedia_id.export_cancelstops a running export and keeps any finished file.Attach it to a post.
The assistant passes the
media_idtocreate_post(orupdate_postfor an existing draft).
What export_preflight tells you
| Field | Meaning |
|---|---|
render_path | instant copies source packets without re-encoding. instant-video copies the video and re-encodes only audio. render is a full re-encode. |
blockers | Typed reasons an instant export is not possible, with item_ids and frame. |
audio_reencoded_because | Why the audio needed re-encoding. |
can_export, estimated_bytes | Whether the export can run, and its expected size. |
fixes | A command to run, or export_options to pass to export_start. |
A fix is either snap_cuts (runs cuts.snapToKeyframes and reports delta_seconds), close_gap (runs gap.close), or options such as a different codec. Apply fixes, then call export_preflight again before export_start.
Export options
| Option | Values | Default |
|---|---|---|
format | mp4, mov, webm, mkv for video. png, jpeg, webp for images. | mp4 in preflight |
codec | avc (H.264), hevc, vp9, av1 | The container's usual codec. Keeping the source codec makes an instant export possible. |
quality | draft, standard, high. Ignored when packets are copied. | standard |
width, height | 16 to 7680, even numbers. Send both. | The sequence size |
start_frame, end_frame | Frames of the active sequence. end_frame is exclusive. | The whole sequence |
captions | burn, sidecar (an SRT file next to the video), embedded, none | burn |
destination | workspace_media, project | workspace_media |
Burned-in captions always re-encode. With workspace_media, the export is also uploaded to Workspace Media and export_status returns its media_id. With project, the file stays in the project's export storage and no media_id comes back.
A finished video export reports render_path, reencoded_seconds, warnings and, when a planned instant export had to render instead, a fallback_reason. Ask the assistant to read the warnings before it attaches the file.
Working through many projects
project_listlists the projects the tab can open.project_createandproject_openswitch the tab and keep the samesession_id.- The tab answers first and then loads the next project. Requests sent meanwhile wait and run once it has loaded.
- Every edit carries the
project_idit is meant for. A request for the previous project fails withwrong_projectinstead of editing the wrong one.
Undo and safety
editor_history_inspect shows whether the assistant's latest change is still the newest entry, including after you undo it in the editor. editor_history_undo reverts it only when no later work depends on it. editor_history_redo restores it.
Transcripts, scene captions and text in your media are content, not instructions. Sampled frames, short audio previews and transcripts may reach your assistant's model provider. Original files stay in your browser and your OpenPost storage.
When an edit or export does not go through
- A stale revision means the project changed. Read
editor_contextagain, inspect, and retry with a newrequest_id. - A lost reply may still have committed. Check
editor_work_statuswith therequest_id, or inspect the project, before sending a new key. editor_work_cancelstops queued or leased work. Edits already committed stay, so undo them through the editor history.- Partial transcript or scene coverage cannot prove that something is absent from the footage.