API 参考 · Media
Video · assemble a template
Put the rendered shots of a several-shot template back into its clip — one clip, over the clip's own sound.
Free — the shots were billed. Render each shot of the template first (POST /v1/videos/edits with source: "template:<id>:<n>"), then send their job ids here in shot order, right away: the cut waits for shots still rendering. A shot you left out or that failed (refunded) plays as filmed; when every shot failed it answers 400 pieces_failed. The shots are held for the cut and never land on their own (their job answers assembled_into once the cut is made); a shot never sent here is given back after 6 hours (refunded, never a clip of its own), and so are the shots of a cut that fails.
Returns a job to poll like any render (GET /v1/videos/generations/{id}); the finished clip lands in your library. voice: "female" lays it over the clip's female-voice version (the template's voices.female) — for a woman cast in the man's part.
Answers 404 template_not_found for a template without shots, 400 pieces_mismatch when there are more pieces than shots (fewer: the missing last ones play as filmed — a template only ever adds shots at the end of its list), 404 piece_not_found for a job that is not a video edit of your workspace, 400 private_piece for a private render (never stored), 503 assembly_unavailable when cutting is down.
请求体
The template's id (GET /v1/videos/templates), one with shots.
The shots' edit job ids, in shot order — null for a shot you did not render.
female: the clip's female-voice version under the cut.
The clip's title in your library — the template's name by default.
curl https://eroq.ai/v1/videos/edits/assemble \
-H "Authorization: Bearer $EROQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"template": "gta-goodbye",
"pieces": [
"8f3c2a10-…",
"0b7e91d4-…",
"c41f6a77-…",
"e92b5d03-…"
],
"voice": "female",
"title": "Goodbye GTA with Mara"
}'响应
{
"id": "5d1e7b3a-…",
"object": "video.edit",
"created": 1794600000,
"status": "processing",
"model": "eroq-replace-pro",
"duration": "22s",
"poll": "/v1/videos/generations/5d1e7b3a-…",
"usage": { "credits_spent": 0, "credits_remaining": 1840 }
}