APIリファレンス · Media

Video · edit (Replace)

Edit a clip you bring: swap a character, an outfit, the place or the style — the motion, timing and camera stay.

POST/v1/videos/edits8 credits / second (eroq-replace) · 74 credits / second (eroq-replace-pro, 2 s minimum)

eroq Replace edits YOUR clip. mode: "swap" changes one thing and keeps the rest of the shot (a character, an outfit, a product, the location, the weather, the style); mode: "recast" keeps the performance, the timing and the camera movement and rebuilds the subjects, the set and the look from your words. The result keeps the source's length and framing, lands in your library, and is polled like any render (GET /v1/videos/generations/{id}).

source is a media key you own: upload:<id> (a file in POST /v1/uploads) or creation:<id> (a clip in your library). It must be an MP4 or MOV; its length is measured on our side and billed per second: eroq-replace takes 1–15 s and returns up to 720p; eroq-replace-pro (Creator plan and up) takes 2–30 s, returns up to 1080p and accepts up to 5 keyframes — pictures the result should match at their timestamps. Trim and convert longer clips first (the studio does it in the browser).

@mentions of your characters and elements in prompt (their ids in elements) ride as their names and looks. To put your own character into the shot on Replace Pro, make a keyframe: paint them into the clip's first frame with POST /v1/images/generations (the frame as a reference, the character in elements), then pass that picture as keyframes: [{ "image": "creation:<id>", "seconds": 0 }]. Moderated upstream by the provider; a declined edit is refunded.

リクエストボディ

sourcestring必須

The clip to edit: upload:<id> or creation:<id> — MP4/MOV, 1–15 s (Replace) or 2–30 s (Replace Pro).

promptstring必須

What changes — "Replace the man with @Mina", "Make it snow". Up to 2000 characters.

modelstring

eroq-replace (default) or eroq-replace-pro.

modestring

swap (default) or recast.

elementsarray

Ids of the characters (char:<id>) and elements you @mention.

keyframesarray

Replace Pro: up to 5 { image: "upload:<id>" | "creation:<id>", seconds } pictures to match.

seedinteger

Replace Pro: reproducibility seed.

storeboolean

Persist the result at a permanent public URL (charged at the Store's rate).

folder_idstring

Library folder the edited clip lands in — one of yours (GET /v1/folders). Omitted = the Library root; an unknown id answers 404 folder_not_found before anything is billed.

curl https://eroq.ai/v1/videos/edits \
  -H "Authorization: Bearer $EROQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "eroq-replace",
  "source": "upload:9f2c41ab77d0e1c3",
  "prompt": "Make it snow heavily, snow settling on everything",
  "mode": "swap"
}'
/v1/videos/edits
→ POST /v1/videos/edits
「例を実行」を押すと、ドキュメント自身のデータから実際のやり取りを再生します。キーもリクエストも不要で、料金もかかりません。

レスポンス

200 · application/json
{
  "id": "c41e9a07-…",
  "object": "video.edit",
  "created": 1759068000,
  "status": "processing",
  "model": "eroq-replace",
  "duration": "4s",
  "poll": "/v1/videos/generations/c41e9a07-…",
  "usage": { "credits_spent": 32, "credits_remaining": 530 }
}