SeaLinkSeaLink
/
← Docs

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

ParameterTypeRequiredDescription
modelstringYeswan2.6-t2v, wan2.6-i2v, wan2.6-i2v-flash
promptstringYes*Video description; can be generated from an existing prompt template via template_id
template_idstringNoExisting prompt template ID, use with variables; unknown templates return 404
image / image_urlstringNoStarting frame as base64 or URL
nintegerNo1 - 4
sizestringNo1920x1080, 1280x720, 640x480, 1080x1920, 720x1280, 480x640
durationintegerNo1 - 60 seconds
fpsintegerNo1 - 60
negative_promptstringNoNegative prompt, max 1024 chars
seedintegerNoRandom seed for reproducible generation
webhook_urlstringNoCallback URL on completion (https only)
tagsarrayNoArray of tag strings
cURL
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
}'
Python
from openai import OpenAI
import requests
# For async video generation, use the raw HTTP client
res = 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

ParameterTypeRequiredDescription
modelstringYeshappyhorse-1.0-video-edit
videostringYesSource video as base64 or URL
promptstringYesEdit instruction description
resolutionstringNoSame as video size enum
durationintegerNo1 - 60 seconds
seedintegerNoRandom seed
cURL
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
}'
Python
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.

cURL
# Poll task status
curl https://test.sealink.io/v1/tasks/task_abc123 \
-H "Authorization: Bearer <your-sealink-key>"
cURL - Cancel
# Cancel a running async task when the route supports cancellation
curl -X DELETE https://test.sealink.io/v1/tasks/task_abc123 \
-H "Authorization: Bearer <your-sealink-key>"
Python — Poll Loop
# Poll until complete
import time
task_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"))
break
time.sleep(5)
Node.js — Poll Loop
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();