Top.Mail.Ru
General icon
General
Галерея icon
Галерея
Unitool Labs icon
Unitool Labs
Блог icon
Блог
MCP icon
MCP
← All models

Seedance

seedance · Video · unitool

Seedance 1.5 Pro — это модель генерации аудио- и видеоконтента от ByteDance, которая создает видео кинематографического качества, синхронизированный звук и многоязычные диалоги с использованием кинематографических приемов ведения камеры.

Generations are async: create, wait or poll, the result by link for 7 days. Details: Media generations

Seedance 2.5

Mode seedance-2-5 · seedance:seedance-2-5

Price

Depends on the parameters: 200 tokens for the example below, base 440. Get the exact price of your request from POST /v1/quotes.

Price make-up (pricing from GET /v1/models/{id})
JSON
{
  "unit": "tokens",
  "kind": "by_parameters",
  "base": 440,
  "example_price": 200,
  "matrix": [
    {
      "when": {
        "resolution": "480p"
      },
      "when_set": [
        "video_url"
      ],
      "rate": 7,
      "per": "duration",
      "plus": [
        "video_url_duration_sec"
      ],
      "plus_mode": "sum"
    },
    {
      "when": {
        "resolution": "480p"
      },
      "when_unset": [
        "video_url"
      ],
      "rate": 11,
      "per": "duration"
    },
    {
      "when": {
        "resolution": "720p"
      },
      "when_set": [
        "video_url"
      ],
      "rate": 15,
      "per": "duration",
      "plus": [
        "video_url_duration_sec"
      ],
      "plus_mode": "sum"
    },
    {
      "when": {
        "resolution": "720p"
      },
      "when_unset": [
        "video_url"
      ],
      "rate": 25,
      "per": "duration"
    },
    {
      "when": {
        "resolution": "1080p"
      },
      "when_set": [
        "video_url"
      ],
      "rate": 26,
      "per": "duration",
      "plus": [
        "video_url_duration_sec"
      ],
      "plus_mode": "sum"
    },
    {
      "when": {
        "resolution": "1080p"
      },
      "when_unset": [
        "video_url"
      ],
      "rate": 44,
      "per": "duration"
    },
    {
      "when": {
        "resolution": "4k"
      },
      "when_set": [
        "video_url"
      ],
      "rate": 87,
      "per": "duration",
      "plus": [
        "video_url_duration_sec"
      ],
      "plus_mode": "sum"
    },
    {
      "when": {
        "resolution": "4k"
      },
      "when_unset": [
        "video_url"
      ],
      "rate": 141,
      "per": "duration"
    }
  ]
}

Parameters

ParameterTypeDescription
promptrequiredstring
aspect_ratioadaptive | 16:9 | 4:3 | 1:1 | 3:4 | 9:16 | 21:9Соотношение сторон. «Авто» подбирает кадр под задачу и входные файлы. При монтаже и продлении видео, а также при первом/последнем кадре модель принимает только «Авто».Default "adaptive"
resolution480p | 720p | 1080p | 4kКачество. 480p, 720p, 1080p или 4K. Чем выше качество, тем дороже секунда генерации. 4K кодируется в 10-битный H.265 — часть плееров и браузеров его не открывает.Default "720p"
durationnumber 4–30Длительность. 4–30 секунд. Длительность умножается на стоимость секунды; с референс-видео тарифицируются секунды входа и выхода вместе. При включённой «Длительности по видео» ползунок не действует.Default 8
duration_autobooleanДлительность по видео. Для монтажа и продления загруженного видео: длину и формат кадра модель берёт из исходного клипа. Ползунок длительности при этом не действует, кадр переключается на «Авто». Работает только вместе с референс-видео.
generate_audiobooleanДобавить звук. Модель озвучит ролик: речь, шумы и музыку по смыслу промпта. Реплики берите в кавычки. Выключено — видео без звука.Default true
first_frame_urlfileПервый кадр. Одно изображение: jpeg, png, webp, bmp, tiff, gif, heic, heif. Стороны 300–6000 px, соотношение 0.4–2.5, до 30 МБ. Нельзя использовать вместе с референсами. Реальные лица модель отклоняет. A file_ref (asset:… or attachment:…), an https URL or a data: URL.
last_frame_urlfileПоследний кадр. Одно изображение, требования как у первого кадра. Передаётся только вместе с первым кадром; при разных пропорциях кадрируется под него. A file_ref (asset:… or attachment:…), an https URL or a data: URL.
video_urlfileРеференс-видео. Одно видео mp4 или mov, 2–30 секунд, до 200 МБ, 24–60 FPS, стороны 300–6000 px. Реальные лица модель отклоняет. С референс-видео ставка за секунду ниже, но оплачиваются секунды входного клипа плюс секунды результата. A file_ref (asset:… or attachment:…), an https URL or a data: URL.
audio_urlfileРеференс-аудио. Одно аудио wav или mp3, 2–30 секунд, до 15 МБ. Seedance 2.5 принимает аудио и без изображения или видео. A file_ref (asset:… or attachment:…), an https URL or a data: URL.
reference_image_urlsarray of file (≤ 10)A file_ref (asset:… or attachment:…), an https URL or a data: URL.

Example request

curl
curl https://api.unitool.ai/v1/generations \
  -H "Authorization: Bearer $UNITOOL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Prefer: wait=60" \
  -d '{
  "model": "seedance",
  "mode": "seedance-2-5",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "adaptive",
    "resolution": "720p",
    "duration": 8,
    "generate_audio": true
  }
}'
Python (requests)
import json, os, time, uuid, requests

API = "https://api.unitool.ai/v1"
headers = {"Authorization": f"Bearer {os.environ['UNITOOL_API_KEY']}"}
body = json.loads(r'''{
  "model": "seedance",
  "mode": "seedance-2-5",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "adaptive",
    "resolution": "720p",
    "duration": 8,
    "generate_audio": true
  }
}''')
gen = requests.post(f"{API}/generations", json=body,
                    headers={**headers, "Idempotency-Key": str(uuid.uuid4()), "Prefer": "wait=60"}).json()
while gen["status"] in ("queued", "running"):
    time.sleep(5)
    gen = requests.get(f"{API}/generations/{gen['id']}", headers=headers).json()
print(gen["status"], [o["url"] for o in gen["outputs"]])
JavaScript (fetch)
const API = "https://api.unitool.ai/v1";
const headers = { Authorization: `Bearer ${process.env.UNITOOL_API_KEY}`, "Content-Type": "application/json" };
const body = {
  "model": "seedance",
  "mode": "seedance-2-5",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "adaptive",
    "resolution": "720p",
    "duration": 8,
    "generate_audio": true
  }
};
let gen = await (await fetch(`${API}/generations`, {
  method: "POST", body: JSON.stringify(body),
  headers: { ...headers, "Idempotency-Key": crypto.randomUUID(), Prefer: "wait=60" },
})).json();
while (gen.status === "queued" || gen.status === "running") {
  await new Promise((resolve) => setTimeout(resolve, 5000));
  gen = await (await fetch(`${API}/generations/${gen.id}`, { headers })).json();
}
console.log(gen.status, gen.outputs.map((output) => output.url));

Seedance 2.0

Mode seedance-2-0 · seedance:seedance-2-0

Price

Depends on the parameters: 128 tokens for the example below, base 100. Get the exact price of your request from POST /v1/quotes.

Price make-up (pricing from GET /v1/models/{id})
JSON
{
  "unit": "tokens",
  "kind": "by_parameters",
  "base": 100,
  "example_price": 128,
  "matrix": [
    {
      "when": {
        "resolution": "480p"
      },
      "when_set": [
        "video_url"
      ],
      "rate": 4,
      "per": "duration",
      "plus": [
        "video_url_duration_sec"
      ],
      "plus_mode": "sum"
    },
    {
      "when": {
        "resolution": "480p"
      },
      "when_unset": [
        "video_url"
      ],
      "rate": 7,
      "per": "duration"
    },
    {
      "when": {
        "resolution": "720p"
      },
      "when_set": [
        "video_url"
      ],
      "rate": 10,
      "per": "duration",
      "plus": [
        "video_url_duration_sec"
      ],
      "plus_mode": "sum"
    },
    {
      "when": {
        "resolution": "720p"
      },
      "when_unset": [
        "video_url"
      ],
      "rate": 16,
      "per": "duration"
    },
    {
      "when": {
        "resolution": "1080p"
      },
      "when_set": [
        "video_url"
      ],
      "rate": 25,
      "per": "duration",
      "plus": [
        "video_url_duration_sec"
      ],
      "plus_mode": "sum"
    },
    {
      "when": {
        "resolution": "1080p"
      },
      "when_unset": [
        "video_url"
      ],
      "rate": 40,
      "per": "duration"
    },
    {
      "when": {
        "resolution": "4k"
      },
      "when_set": [
        "video_url"
      ],
      "rate": 50,
      "per": "duration",
      "plus": [
        "video_url_duration_sec"
      ],
      "plus_mode": "sum"
    },
    {
      "when": {
        "resolution": "4k"
      },
      "when_unset": [
        "video_url"
      ],
      "rate": 82,
      "per": "duration"
    }
  ]
}

Parameters

ParameterTypeDescription
promptrequiredstring
aspect_ratioadaptive | 16:9 | 4:3 | 1:1 | 3:4 | 9:16 | 21:9Соотношение сторон. «Авто» подбирает кадр под задачу и входные файлы.Default "adaptive"
resolution480p | 720p | 1080p | 4kКачество. 480p, 720p, 1080p или 4K. 4K кодируется в 10-битный H.265 — часть плееров и браузеров его не открывает.Default "720p"
durationnumber 4–15Длительность. 4–15 секунд. Длительность напрямую умножается на стоимость.Default 8
generate_audiobooleanДобавить звук. Модель озвучит ролик: речь, шумы и музыку по смыслу промпта. Реплики берите в кавычки. Выключено — видео без звука.Default true
first_frame_urlfileПервый кадр. Одно изображение: jpeg, png, webp, bmp, tiff, gif, heic, heif. Стороны 300–6000 px, соотношение 0.4–2.5, до 30 МБ. Нельзя использовать вместе с референсами. Реальные лица модель отклоняет. A file_ref (asset:… or attachment:…), an https URL or a data: URL.
last_frame_urlfileПоследний кадр. Одно изображение, требования как у первого кадра. Передаётся только вместе с первым кадром; при разных пропорциях кадрируется под него. A file_ref (asset:… or attachment:…), an https URL or a data: URL.
video_urlfileРеференс-видео. Одно видео mp4 или mov, 2–15 секунд, до 200 МБ, 24–60 FPS, стороны 300–6000 px. Через шлюз уходит один клип, хотя API модели принимает до 3 общей длиной до 15 секунд. A file_ref (asset:… or attachment:…), an https URL or a data: URL.
audio_urlfileРеференс-аудио. Одно аудио wav или mp3, 2–15 секунд, до 15 МБ. Без изображения или видео Seedance 2.0 аудио не принимает — добавьте хотя бы один визуальный референс. A file_ref (asset:… or attachment:…), an https URL or a data: URL.
reference_image_urlsarray of file (≤ 9)A file_ref (asset:… or attachment:…), an https URL or a data: URL.

Example request

curl
curl https://api.unitool.ai/v1/generations \
  -H "Authorization: Bearer $UNITOOL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Prefer: wait=60" \
  -d '{
  "model": "seedance",
  "mode": "seedance-2-0",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "adaptive",
    "resolution": "720p",
    "duration": 8,
    "generate_audio": true
  }
}'
Python (requests)
import json, os, time, uuid, requests

API = "https://api.unitool.ai/v1"
headers = {"Authorization": f"Bearer {os.environ['UNITOOL_API_KEY']}"}
body = json.loads(r'''{
  "model": "seedance",
  "mode": "seedance-2-0",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "adaptive",
    "resolution": "720p",
    "duration": 8,
    "generate_audio": true
  }
}''')
gen = requests.post(f"{API}/generations", json=body,
                    headers={**headers, "Idempotency-Key": str(uuid.uuid4()), "Prefer": "wait=60"}).json()
while gen["status"] in ("queued", "running"):
    time.sleep(5)
    gen = requests.get(f"{API}/generations/{gen['id']}", headers=headers).json()
print(gen["status"], [o["url"] for o in gen["outputs"]])
JavaScript (fetch)
const API = "https://api.unitool.ai/v1";
const headers = { Authorization: `Bearer ${process.env.UNITOOL_API_KEY}`, "Content-Type": "application/json" };
const body = {
  "model": "seedance",
  "mode": "seedance-2-0",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "adaptive",
    "resolution": "720p",
    "duration": 8,
    "generate_audio": true
  }
};
let gen = await (await fetch(`${API}/generations`, {
  method: "POST", body: JSON.stringify(body),
  headers: { ...headers, "Idempotency-Key": crypto.randomUUID(), Prefer: "wait=60" },
})).json();
while (gen.status === "queued" || gen.status === "running") {
  await new Promise((resolve) => setTimeout(resolve, 5000));
  gen = await (await fetch(`${API}/generations/${gen.id}`, { headers })).json();
}
console.log(gen.status, gen.outputs.map((output) => output.url));

Seedance 2 Fast

Mode seedance-2-fast · seedance:seedance-2-fast

Price

Depends on the parameters: 128 tokens for the example below, base 128. Get the exact price of your request from POST /v1/quotes.

Price make-up (pricing from GET /v1/models/{id})
JSON
{
  "unit": "tokens",
  "kind": "by_parameters",
  "base": 128,
  "example_price": 128,
  "matrix": [
    {
      "when": {
        "resolution": "480p"
      },
      "when_set": [
        "video_url"
      ],
      "rate": 4,
      "per": "duration",
      "plus": [
        "video_url_duration_sec"
      ],
      "plus_mode": "sum"
    },
    {
      "when": {
        "resolution": "480p"
      },
      "when_unset": [
        "video_url"
      ],
      "rate": 8,
      "per": "duration"
    },
    {
      "when": {
        "resolution": "720p"
      },
      "when_set": [
        "video_url"
      ],
      "rate": 10,
      "per": "duration",
      "plus": [
        "video_url_duration_sec"
      ],
      "plus_mode": "sum"
    },
    {
      "when": {
        "resolution": "720p"
      },
      "when_unset": [
        "video_url"
      ],
      "rate": 16,
      "per": "duration"
    }
  ]
}

Parameters

ParameterTypeDescription
promptrequiredstring
aspect_ratioadaptive | 16:9 | 4:3 | 1:1 | 3:4 | 9:16 | 21:9Соотношение сторонDefault "adaptive"
resolution480p | 720pКачествоDefault "720p"
durationnumber 4–15ДлительностьDefault 8
generate_audiobooleanДобавить звукDefault true
first_frame_urlfileПервый кадр. Используйте отдельно от референсов. A file_ref (asset:… or attachment:…), an https URL or a data: URL.
last_frame_urlfileПоследний кадр. Добавьте вместе с первым кадром. A file_ref (asset:… or attachment:…), an https URL or a data: URL.
video_urlfileРеференс-видео. Одно видео mp4 или mov, 2–15 секунд. С референс-видео ставка за секунду ниже, но оплачиваются секунды входного клипа плюс секунды результата. A file_ref (asset:… or attachment:…), an https URL or a data: URL.
audio_urlfileРеференс-аудио. Одно аудио wav или mp3, 2–15 секунд. Также добавьте фото или видео. A file_ref (asset:… or attachment:…), an https URL or a data: URL.
reference_image_urlsarray of file (≤ 9)A file_ref (asset:… or attachment:…), an https URL or a data: URL.

Example request

curl
curl https://api.unitool.ai/v1/generations \
  -H "Authorization: Bearer $UNITOOL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Prefer: wait=60" \
  -d '{
  "model": "seedance",
  "mode": "seedance-2-fast",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "adaptive",
    "resolution": "720p",
    "duration": 8,
    "generate_audio": true
  }
}'
Python (requests)
import json, os, time, uuid, requests

API = "https://api.unitool.ai/v1"
headers = {"Authorization": f"Bearer {os.environ['UNITOOL_API_KEY']}"}
body = json.loads(r'''{
  "model": "seedance",
  "mode": "seedance-2-fast",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "adaptive",
    "resolution": "720p",
    "duration": 8,
    "generate_audio": true
  }
}''')
gen = requests.post(f"{API}/generations", json=body,
                    headers={**headers, "Idempotency-Key": str(uuid.uuid4()), "Prefer": "wait=60"}).json()
while gen["status"] in ("queued", "running"):
    time.sleep(5)
    gen = requests.get(f"{API}/generations/{gen['id']}", headers=headers).json()
print(gen["status"], [o["url"] for o in gen["outputs"]])
JavaScript (fetch)
const API = "https://api.unitool.ai/v1";
const headers = { Authorization: `Bearer ${process.env.UNITOOL_API_KEY}`, "Content-Type": "application/json" };
const body = {
  "model": "seedance",
  "mode": "seedance-2-fast",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "adaptive",
    "resolution": "720p",
    "duration": 8,
    "generate_audio": true
  }
};
let gen = await (await fetch(`${API}/generations`, {
  method: "POST", body: JSON.stringify(body),
  headers: { ...headers, "Idempotency-Key": crypto.randomUUID(), Prefer: "wait=60" },
})).json();
while (gen.status === "queued" || gen.status === "running") {
  await new Promise((resolve) => setTimeout(resolve, 5000));
  gen = await (await fetch(`${API}/generations/${gen.id}`, { headers })).json();
}
console.log(gen.status, gen.outputs.map((output) => output.url));

Seedance 2 Mini

Mode seedance-2-mini · seedance:seedance-2-mini

Price

Depends on the parameters: 112 tokens for the example below, base 112. Get the exact price of your request from POST /v1/quotes.

Price make-up (pricing from GET /v1/models/{id})
JSON
{
  "unit": "tokens",
  "kind": "by_parameters",
  "base": 112,
  "example_price": 112,
  "matrix": [
    {
      "when": {
        "resolution": "480p"
      },
      "when_set": [
        "video_url"
      ],
      "rate": 4,
      "per": "duration",
      "plus": [
        "video_url_duration_sec"
      ],
      "plus_mode": "sum"
    },
    {
      "when": {
        "resolution": "480p"
      },
      "when_unset": [
        "video_url"
      ],
      "rate": 6,
      "per": "duration"
    },
    {
      "when": {
        "resolution": "720p"
      },
      "when_set": [
        "video_url"
      ],
      "rate": 9,
      "per": "duration",
      "plus": [
        "video_url_duration_sec"
      ],
      "plus_mode": "sum"
    },
    {
      "when": {
        "resolution": "720p"
      },
      "when_unset": [
        "video_url"
      ],
      "rate": 14,
      "per": "duration"
    }
  ]
}

Parameters

ParameterTypeDescription
promptrequiredstring
aspect_ratioadaptive | 16:9 | 4:3 | 1:1 | 3:4 | 9:16 | 21:9Соотношение сторонDefault "adaptive"
resolution480p | 720pКачествоDefault "720p"
durationnumber 4–15ДлительностьDefault 8
generate_audiobooleanДобавить звукDefault true
first_frame_urlfileПервый кадр. Используйте отдельно от референсов. A file_ref (asset:… or attachment:…), an https URL or a data: URL.
last_frame_urlfileПоследний кадр. Добавьте вместе с первым кадром. A file_ref (asset:… or attachment:…), an https URL or a data: URL.
video_urlfileРеференс-видео. Одно видео mp4 или mov, 2–15 секунд. С референс-видео ставка за секунду ниже, но оплачиваются секунды входного клипа плюс секунды результата. A file_ref (asset:… or attachment:…), an https URL or a data: URL.
audio_urlfileРеференс-аудио. Одно аудио wav или mp3, 2–15 секунд. Также добавьте фото или видео. A file_ref (asset:… or attachment:…), an https URL or a data: URL.
reference_image_urlsarray of file (≤ 9)A file_ref (asset:… or attachment:…), an https URL or a data: URL.

Example request

curl
curl https://api.unitool.ai/v1/generations \
  -H "Authorization: Bearer $UNITOOL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Prefer: wait=60" \
  -d '{
  "model": "seedance",
  "mode": "seedance-2-mini",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "adaptive",
    "resolution": "720p",
    "duration": 8,
    "generate_audio": true
  }
}'
Python (requests)
import json, os, time, uuid, requests

API = "https://api.unitool.ai/v1"
headers = {"Authorization": f"Bearer {os.environ['UNITOOL_API_KEY']}"}
body = json.loads(r'''{
  "model": "seedance",
  "mode": "seedance-2-mini",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "adaptive",
    "resolution": "720p",
    "duration": 8,
    "generate_audio": true
  }
}''')
gen = requests.post(f"{API}/generations", json=body,
                    headers={**headers, "Idempotency-Key": str(uuid.uuid4()), "Prefer": "wait=60"}).json()
while gen["status"] in ("queued", "running"):
    time.sleep(5)
    gen = requests.get(f"{API}/generations/{gen['id']}", headers=headers).json()
print(gen["status"], [o["url"] for o in gen["outputs"]])
JavaScript (fetch)
const API = "https://api.unitool.ai/v1";
const headers = { Authorization: `Bearer ${process.env.UNITOOL_API_KEY}`, "Content-Type": "application/json" };
const body = {
  "model": "seedance",
  "mode": "seedance-2-mini",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "adaptive",
    "resolution": "720p",
    "duration": 8,
    "generate_audio": true
  }
};
let gen = await (await fetch(`${API}/generations`, {
  method: "POST", body: JSON.stringify(body),
  headers: { ...headers, "Idempotency-Key": crypto.randomUUID(), Prefer: "wait=60" },
})).json();
while (gen.status === "queued" || gen.status === "running") {
  await new Promise((resolve) => setTimeout(resolve, 5000));
  gen = await (await fetch(`${API}/generations/${gen.id}`, { headers })).json();
}
console.log(gen.status, gen.outputs.map((output) => output.url));

seedance-1.5-pro

Mode seedance-1.5-pro · seedance:seedance-1.5-pro

Price

Depends on the parameters: 9 tokens for the example below, base 25. Get the exact price of your request from POST /v1/quotes.

Price make-up (pricing from GET /v1/models/{id})
JSON
{
  "unit": "tokens",
  "kind": "by_parameters",
  "base": 25,
  "example_price": 9,
  "matrix": [
    {
      "when": {
        "resolution": "480p"
      },
      "rate": 1.1,
      "per": "duration"
    },
    {
      "when": {
        "resolution": "720p"
      },
      "rate": 2.4,
      "per": "duration"
    },
    {
      "when": {
        "resolution": "1080p"
      },
      "rate": 5.1,
      "per": "duration"
    }
  ],
  "addons": [
    {
      "when": {
        "generate_audio": "true"
      },
      "multiply": 2
    }
  ]
}

Parameters

ParameterTypeDescription
promptrequiredstring
aspect_ratio1:1 | 21:9 | 4:3 | 3:4 | 16:9 | 9:16Соотношение сторон. Соотношение сторон генерируемого видеоDefault "16:9"
duration4 | 8 | 12ДлительностьDefault "8"
fixed_lensbooleanФиксированная камера. Включите, чтобы изображение с камеры оставалось неподвижным и стабильным. Отключите для динамичного перемещения камеры.Default false
generate_audiobooleanЗвукDefault false
resolution480p | 720p | 1080pКачество. Качество генерируемого видеоDefault "480p"
image_urlsarray of file (≤ 2)A file_ref (asset:… or attachment:…), an https URL or a data: URL.

Example request

curl
curl https://api.unitool.ai/v1/generations \
  -H "Authorization: Bearer $UNITOOL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Prefer: wait=60" \
  -d '{
  "model": "seedance",
  "mode": "seedance-1.5-pro",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "16:9",
    "duration": "8",
    "generate_audio": false,
    "resolution": "480p"
  }
}'
Python (requests)
import json, os, time, uuid, requests

API = "https://api.unitool.ai/v1"
headers = {"Authorization": f"Bearer {os.environ['UNITOOL_API_KEY']}"}
body = json.loads(r'''{
  "model": "seedance",
  "mode": "seedance-1.5-pro",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "16:9",
    "duration": "8",
    "generate_audio": false,
    "resolution": "480p"
  }
}''')
gen = requests.post(f"{API}/generations", json=body,
                    headers={**headers, "Idempotency-Key": str(uuid.uuid4()), "Prefer": "wait=60"}).json()
while gen["status"] in ("queued", "running"):
    time.sleep(5)
    gen = requests.get(f"{API}/generations/{gen['id']}", headers=headers).json()
print(gen["status"], [o["url"] for o in gen["outputs"]])
JavaScript (fetch)
const API = "https://api.unitool.ai/v1";
const headers = { Authorization: `Bearer ${process.env.UNITOOL_API_KEY}`, "Content-Type": "application/json" };
const body = {
  "model": "seedance",
  "mode": "seedance-1.5-pro",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "16:9",
    "duration": "8",
    "generate_audio": false,
    "resolution": "480p"
  }
};
let gen = await (await fetch(`${API}/generations`, {
  method: "POST", body: JSON.stringify(body),
  headers: { ...headers, "Idempotency-Key": crypto.randomUUID(), Prefer: "wait=60" },
})).json();
while (gen.status === "queued" || gen.status === "running") {
  await new Promise((resolve) => setTimeout(resolve, 5000));
  gen = await (await fetch(`${API}/generations/${gen.id}`, { headers })).json();
}
console.log(gen.status, gen.outputs.map((output) => output.url));

We use cookies

By continuing to use the site you agree to our Privacy Policy.