The online video editor renders multi-clip projects in the background. POST the project JSON plus each referenced media file as media_<assetId>; you get back a job id. Poll until status is completed, then download the rendered MP4.
import json, time, requests
API_BASE = "https://your-domain.com"
API_KEY = "YOUR_API_KEY"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}
project = {
"settings": {"width": 1280, "height": 720, "fps": 30, "duration": 4.0},
"assets": [{"id": "clip1", "src": "input.mp4", "kind": "video"}],
"videoClips": [{"id": "v1", "assetId": "clip1", "track": 0,
"timelineStart": 0, "sourceStart": 0, "sourceEnd": 4}],
"audioClips": [], "textClips": [],
}
# 1. Submit
with open("input.mp4", "rb") as fh:
res = requests.post(
f"{API_BASE}/api/tools/online-video-editor/export",
headers=HEADERS,
data={"project": json.dumps(project)},
files={"media_clip1": ("input.mp4", fh, "video/mp4")},
timeout=600,
)
res.raise_for_status()
job_id = res.json()["jobId"]
# 2. Poll
while True:
job = requests.get(
f"{API_BASE}/api/tools/online-video-editor/export/{job_id}",
headers=HEADERS, timeout=30,
).json()
print("status", job["status"], "progress", job.get("progress"))
if job["status"] in ("completed", "failed"):
break
time.sleep(2)
if job["status"] != "completed":
raise RuntimeError(job.get("error") or "render failed")
# 3. Download
out = requests.get(
f"{API_BASE}/api/tools/online-video-editor/export/{job_id}/download",
headers=HEADERS, timeout=600,
)
with open("output.mp4", "wb") as f:
f.write(out.content)