Skip to content
KrevayadocsGet help Open Krevaya

Automate editable video templates and MP4 export

Find a video template, make a brand-owned editable copy, change clips and titles, preview frames, propose captions and cuts, and export an MP4 or GIF via MCP.

Updated

Start with an editable template

Use the MCP video tools to copy a template into an editable creation, inspect its layers, make specific changes, and export an MP4. Copying and exporting a creation does not publish it. Scripts (write_video_script) and proposed edits such as captions and Auto cut (propose_video_edit) are optional, and Cast generation is not offered to ordinary accounts. None of them is a prerequisite for editing a video template.

  • list_video_templates with an optional query returns template slugs, editable parts, duration, and preview_url.
  • use_video_template takes slug, optional brand_id, and an optional destination supported by that template.
  • get_layers returns the creation's layout_version, visual layers, and timeline summary. Layers come in pages: layer_offset and layer_limit (default 60) choose the page, and next_layer_offset is the offset of the next page, or null after the last.
  • edit_layers changes the copy, colors, timing, stacking, or owned image/video assets.
  • preview_design returns still pages or at-rest timeline views. Video clips show their poster frames; motion is not rendered.
  • export_video starts an asynchronous render; job_status reports the outcome. Its optional resolution is canvas (the default) or 480p, 720p, 1080p or 4k on Ultra and higher.

To add captions, cuts, reframing, voice cleanup, or b-roll to a creation's source video, use the proposal tools described under Propose, review, and apply video edits.

Choose a destination the template supports

The destination vocabulary includes instagram_reel, instagram_story, facebook_story, tiktok_reel, youtube_reel, pinterest_reel, threads_video, bluesky_video, and landscape_video. A particular template supports a subset; inspect its catalog entry. A creation destination controls format and layout and does not promise that the account can publish to that platform.

Pass brand_id to keep ownership explicit. use_video_template copies the template into the user's creation and substitutes the brand's handle. Preserve its separate title, caption, footage, and music objects so the recipient can keep editing them.

Edit stable clips with a current layout version

json
{
  "post_id": "YOUR_DESIGN_ID",
  "layout_version": 4,
  "ops": [
    {"op": "set", "clip_id": "CLIP_ID_FROM_GET_LAYERS", "fields": {"text": "A clearer repair estimate starts here"}}
  ]
}

Use the returned clip_id and version instead of the sample values. edit_layers supports up to 40 operations applied in order, all or nothing. set changes selected fields; add supplies a whole new layer; delete removes one; move changes stacking. You cannot change a layer's kind, cid, or clip_id with set.

For continuous video creations, visual layers use global time and track membership. Adding a layer requires valid timing and a track_id from get_layers. There is one shared visual layer list of up to 2,000 layers, with at most 160 on screen at once; get_layers pages through it with layer_offset. Do not copy a clip into every scene just to keep it visible across scene boundaries.

Inspect before rendering the entire video

json
{
  "post_id": "YOUR_DESIGN_ID",
  "times": [0, 2.5, 5]
}

Pass these arguments to preview_design for a continuous video timeline, choosing times within its duration. It accepts up to eight times and defaults to six evenly spaced views. Each view shows the layers and caption line active at that time, at rest; footage uses its poster frame and motion is not drawn. Inspect text wrapping, placement, and poster crop here. Page-based video returns one image per page without a per-second preview. Review the exported MP4 to check actual footage, animation, transitions, the ending, and audio before posting.

Propose, review, and apply video edits

propose_video_edit prepares changes to a creation's source video without touching the creation: automatic speech captions (captions), short cuts (autocut), face-guided reframing that falls back to a centered crop (reframe), steady voice-noise reduction (cleanup), or b-roll from your own library (broll). It requires generate. Auto cut also needs Pro or higher.

json
{
  "post_id": "YOUR_DESIGN_ID",
  "request_id": "YOUR_NEW_UUID",
  "layout_version": 4,
  "operations": ["captions", "autocut"],
  "clip_id": "CLIP_ID_FROM_GET_LAYERS",
  "target_seconds": 30,
  "count": 3,
  "caption_style": "clean"
}
  • Call get_layers for the current layout_version and the source clip_id. clip_id can be omitted only when the creation has one eligible source clip.
  • Call propose_video_edit with a new request_id UUID and one to five distinct operations. Optional fields: target_seconds (15, 30, 60, or 90; default 30) and count (1–5 candidates, Auto cut only), caption_style (pop, the default, or clean when captions are requested), instruction (up to 1,000 characters), and asset_ids (up to eight distinct owned library images or videos, b-roll only). Without asset_ids, b-roll is searched in the creation's brand library using the instruction.
  • Poll job_status with the returned job_id. When it is done, show the proposals to the user.
  • apply_video_edit takes post_id, job_id, the current layout_version, and the chosen zero-based variant, and writes that proposal as native Studio layers. undo_video_edit restores the creation as it was. save_video_edit instead saves the chosen variant as its own editable creation and leaves the source unchanged; saving the same candidate again returns the existing copy.

None of these tools schedules or publishes. The creation must be a Studio creation, draft, or rejected post with a continuous video timeline, and not a post linked to a shared creation. A changed layout_version is refused, so a later edit in Studio is never overwritten; read get_layers again and request a new proposal. After a timeout, repeat propose_video_edit with the same request_id and identical arguments to get the original job_id instead of starting the work twice; the same request_id with different arguments is refused.

One proposal can run at a time for an account. A request covers at most one hour of source video, and cleanup at most five minutes. Video processing has a daily limit per account, and Auto cut has its own allowance.

Export and wait for the MP4

export_video requires generate and takes post_id plus an optional format: mp4 (the default) or gif, and an optional resolution: canvas (the default), 480p, 720p, 1080p or 4k. The creation must contain layout.timeline and must not be scheduled or published. Only one video export can run at a time for an account. Poll job_status using read, inspect progress when provided, and wait for status: done. For MP4, the completed result carries the video URL and the creation's media becomes the MP4.

A GIF is a silent, looping file saved to your media library for download. It needs one joined video of 30 seconds or less, exports at up to 640 pixels and 25 MB, and leaves the creation's publishing media unchanged.

Short bounded video exports and long-form exports have different plan limits. Exports over 180 seconds, non-native output resolutions, and larger source workflows can require Ultra or higher. export_video's resolution parameter is gated exactly like the Studio's export: any value other than canvas needs long-form video (Ultra or higher) and draws on the plan's monthly encode budget. It has no duration override. Every export also draws on the plan's monthly export allowance (60 minutes on Essentials and Plus, 150 minutes on Pro, 10 hours on Ultra, 30 hours on Ultimate), counting at least one minute, and on a daily number of exports; a refused export is HTTP 429 with code export_minutes_exhausted or export_daily_cap. Exporting uses no AI credits.

After export, review the video and create or schedule a post through the supported post workflow. An exported MP4, an accepted draft, and a published social post are three different states; retain the identifiers for each step you use.

Frequently asked questions

Does export_video publish the video?

No. It renders the timed creation to an MP4 and updates the creation's media, or to a GIF in your media library. Scheduling and publishing are separate operations.

Can I call an AI faceless-video generator from a normal customer key?

No. render_faceless_video and the Cast tools are not offered to ordinary accounts. write_video_script (Plus and up) writes a timed script and can open it as a Studio video creation, and propose_video_edit can propose captions or Auto cut (Pro and up) for a creation's source video. The editable video template and export workflow is separate.