Create an API key once to pre-fill a runnable submit + poll script.
#!/bin/bash
# Usage: chmod +x seedance2-5-flash-extend-kinovi.sh && ./seedance2-5-flash-extend-kinovi.sh
KINOVI_API_KEY="${KINOVI_API_KEY:?Set your API key: export KINOVI_API_KEY=your-api-key}"
# Submit task
RESPONSE=$(curl -s -X POST "https://kinovi.ai/api/v1/jobs/createTask" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $KINOVI_API_KEY" \
-d '{
"model": "seedance2-5-flash-extend",
"inputs": {
"prompt": "Extend @video1 by 5 seconds: a bee flies in and lands on the painting. Cut to a macro close-up of its legs and abdomen covered in golden pollen grains. The bee beats its wings and takes off, and the camera follows it to another flower of the same species. In slow motion, pollen shakes loose from the bee’s fuzzy body and lands precisely on the flower’s stigma, magnifying the moment of pollination.",
"videoUrls": [
"https://static.seedance2-pro.com/materials/20261116/1794820361477-5c1c86f9.mp4"
],
"duration": 5
}
}')
TASK_ID=$(echo "$RESPONSE" | grep -o '"taskId":"[^"]*"' | cut -d'"' -f4)
echo "Task created: $TASK_ID"
# Poll until complete
while true; do
RESULT=$(curl -s "https://kinovi.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
-H "Authorization: Bearer $KINOVI_API_KEY")
STATUS=$(echo "$RESULT" | grep -o '"status":"[^"]*"' | head -1 | cut -d'"' -f4)
case "$STATUS" in
success) echo "Done!" && echo "$RESULT" | python3 -m json.tool 2>/dev/null || echo "$RESULT"; break ;;
fail) echo "Failed: $RESULT"; exit 1 ;;
*) echo "Status: $STATUS — waiting..." && sleep 2 ;;
esac
done
// seedance2-5-flash-extend-kinovi.mjs — Usage: node seedance2-5-flash-extend-kinovi.mjs
const API_KEY = process.env.KINOVI_API_KEY ?? "your-api-key";
// 1. Submit task
const { taskId } = await fetch("https://kinovi.ai/api/v1/jobs/createTask", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: `Bearer ${API_KEY}` },
body: JSON.stringify({
"model": "seedance2-5-flash-extend",
"inputs": {
"prompt": "Extend @video1 by 5 seconds: a bee flies in and lands on the painting. Cut to a macro close-up of its legs and abdomen covered in golden pollen grains. The bee beats its wings and takes off, and the camera follows it to another flower of the same species. In slow motion, pollen shakes loose from the bee’s fuzzy body and lands precisely on the flower’s stigma, magnifying the moment of pollination.",
"videoUrls": [
"https://static.seedance2-pro.com/materials/20261116/1794820361477-5c1c86f9.mp4"
],
"duration": 5
}
}),
}).then((r) => r.json());
console.log("Task created:", taskId);
// 2. Poll until complete
while (true) {
const data = await fetch(
`https://kinovi.ai/api/v1/jobs/recordInfo?taskId=${taskId}`,
{ headers: { Authorization: `Bearer ${API_KEY}` } },
).then((r) => r.json());
if (data.status === "success") {
console.log("Done!", JSON.stringify(data.output, null, 2));
break;
}
if (data.status === "fail") {
console.error("Failed:", data.error);
process.exit(1);
}
process.stdout.write(`Status: ${data.status} — waiting...\r`);
await new Promise((r) => setTimeout(r, 2000));
}
# seedance2-5-flash-extend-kinovi.py — Usage: python seedance2-5-flash-extend-kinovi.py
import os
import time
import requests
API_KEY = os.environ.get("KINOVI_API_KEY", "your-api-key")
HEADERS = {"Authorization": f"Bearer {API_KEY}"}
# 1. Submit task
task_id = requests.post(
"https://kinovi.ai/api/v1/jobs/createTask",
headers=HEADERS,
json={
"model": "seedance2-5-flash-extend",
"inputs": {
"prompt": "Extend @video1 by 5 seconds: a bee flies in and lands on the painting. Cut to a macro close-up of its legs and abdomen covered in golden pollen grains. The bee beats its wings and takes off, and the camera follows it to another flower of the same species. In slow motion, pollen shakes loose from the bee’s fuzzy body and lands precisely on the flower’s stigma, magnifying the moment of pollination.",
"videoUrls": [
"https://static.seedance2-pro.com/materials/20261116/1794820361477-5c1c86f9.mp4"
],
"duration": 5
}
},
).json()["taskId"]
print(f"Task created: {task_id}")
# 2. Poll until complete
while True:
data = requests.get(
"https://kinovi.ai/api/v1/jobs/recordInfo",
params={"taskId": task_id},
headers=HEADERS,
).json()
if data["status"] == "success":
print("Done!", data["output"])
break
if data["status"] == "fail":
raise SystemExit(f"Failed: {data['error']}")
print(f"Status: {data['status']} — waiting...", end="\r")
time.sleep(2)