Video
Video models usually run as asynchronous tasks and may bill by seconds, resolution, or clip. Start with short tasks to verify model choice, parameters, and callback handling.
POST /v1/video/generations
Async video generation. Submit a prompt to receive a task ID, then poll task status for the final video. Use the model detail page to choose text-to-video, image-to-video, reference-image, or editing parameters.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | wan2.6-t2v, wan2.6-i2v, wan2.6-i2v-flash |
| prompt | string | Yes* | Video description; can be generated from an existing prompt template via template_id |
| template_id | string | No | Existing prompt template ID, use with variables; unknown templates return 404 |
| image / image_url | string | No | Starting frame as base64 or URL |
| n | integer | No | 1 - 4 |
| size | string | No | 1920x1080, 1280x720, 640x480, 1080x1920, 720x1280, 480x640 |
| duration | integer | No | 1 - 60 seconds |
| fps | integer | No | 1 - 60 |
| negative_prompt | string | No | Negative prompt, max 1024 chars |
| seed | integer | No | Random seed for reproducible generation |
| webhook_url | string | No | Callback URL on completion (https only) |
| tags | array | No | Array of tag strings |
curl https://test.sealink.io/v1/video/generations \-H "Authorization: Bearer <your-sealink-key>" \-H "Content-Type: application/json" \-d '{"model": "wan2.6-t2v","prompt": "A serene lake at sunset, camera slowly panning across the water","size": "1280x720","duration": 5,"n": 1}'
from openai import OpenAIimport requests# For async video generation, use the raw HTTP clientres = requests.post("https://test.sealink.io/v1/video/generations",headers={"Authorization": "Bearer <your-sealink-key>"},json={"model": "wan2.6-t2v","prompt": "A serene lake at sunset, camera slowly panning across the water","size": "1280x720","duration": 5,"n": 1,},)task = res.json()print(f"Task ID: {task['id']}")
POST /v1/video/edits
Video editing. Edit existing videos using prompts — replace backgrounds, apply style transfers, and more.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | happyhorse-1.0-video-edit |
| video | string | Yes | Source video as base64 or URL |
| prompt | string | Yes | Edit instruction description |
| resolution | string | No | Same as video size enum |
| duration | integer | No | 1 - 60 seconds |
| seed | integer | No | Random seed |
curl https://test.sealink.io/v1/video/edits \-H "Authorization: Bearer <your-sealink-key>" \-H "Content-Type: application/json" \-d '{"model": "happyhorse-1.0-video-edit","video": "https://example.com/input-video.mp4","prompt": "Change the background to a beach sunset","resolution": "1280x720","duration": 5}'
res = requests.post("https://test.sealink.io/v1/video/edits",headers={"Authorization": "Bearer <your-sealink-key>"},json={"model": "happyhorse-1.0-video-edit","video": "https://example.com/input-video.mp4","prompt": "Change the background to a beach sunset","resolution": "1280x720","duration": 5,},)task = res.json()print(f"Task ID: {task['id']}")
GET /v1/tasks/{task_id}
Poll async task status. Completed video tasks return data or upstream_response and settle usage at terminal state.
Status values: pending | running | completed | failed. Ali/DashScope video and cancel-capable Mule native video tasks can use DELETE /v1/tasks/{task_id} to release the pre-authorization; tasks without upstream cancellation return 501. Do not keep the submit request open while the video renders.
# Poll task statuscurl https://test.sealink.io/v1/tasks/task_abc123 \-H "Authorization: Bearer <your-sealink-key>"
# Cancel a running async task when the route supports cancellationcurl -X DELETE https://test.sealink.io/v1/tasks/task_abc123 \-H "Authorization: Bearer <your-sealink-key>"
# Poll until completeimport timetask_id = "task_abc123"while True:res = requests.get("https://test.sealink.io/v1/tasks/" + task_id,headers={"Authorization": "Bearer <your-sealink-key>"},)task = res.json()if task["status"] in ("completed", "failed"):print(task["status"], task.get("data") or task.get("upstream_response"))breaktime.sleep(5)
const taskId = "task_abc123";async function poll() {while (true) {const res = await fetch(`https://test.sealink.io/v1/tasks/${taskId}`,{ headers: { Authorization: `Bearer ${process.env.SEALINK_API_KEY}` } });const task = await res.json();if (task.status === "completed" || task.status === "failed") {console.log(task.status, task.data ?? task.upstream_response);break;}await new Promise(r => setTimeout(r, 5000));}}poll();