Перейти к основному содержанию
POST
/
v1
/
videos
curl https://api.cometapi.com/v1/videos \
  -H "Authorization: Bearer <COMETAPI_KEY>" \
  -F 'prompt="A slow cinematic camera push across a coastal landscape at sunrise"' \
  -F 'model="doubao-seedance-2-0-fast"' \
  -F 'seconds="5"' \
  -F 'size="16:9"' \
  -F 'resolution="720p"'
{
  "id": "task_abc123",
  "task_id": "task_abc123",
  "object": "video",
  "model": "doubao-seedance-2-0-fast",
  "status": "SUBMITTED",
  "progress": 0,
  "created_at": 1776681149
}
Используйте этот endpoint, чтобы запустить задачу видео ByteDance Seedance. Все уровни моделей Seedance используют одинаковую структуру запроса; модель выбирается через поле model. Вызов сразу возвращает id задачи, а рендеринг продолжается в фоновом режиме.

Выбор модели

Model idTierNotes
doubao-seedance-2-02.0Выход наивысшего качества в семействе 2.0.
doubao-seedance-2-0-fast2.0Более быстрый вариант 2.0 для быстрых итераций и предпросмотра.
doubao-seedance-1-5-pro1.5 ProПоддерживает 1080p. Только text-to-video.
doubao-seedance-1-0-pro1.0 ProПоддерживает 1080p и более короткие клипы от 2 секунд. Только text-to-video.
Актуальную доступность смотрите на странице Models.

Диапазоны параметров

FieldTypeRequiredDefaultAllowed values
promptstringyesлюбой текст
modelstringyesdoubao-seedance-2-0, doubao-seedance-2-0-fast, doubao-seedance-1-5-pro, doubao-seedance-1-0-pro
secondsintegerno5зависит от модели (см. ниже)
sizestringno16:921:9, 16:9, 4:3, 1:1, 3:4, 9:16
resolutionstringno720p480p, 720p для моделей 2.0; 480p, 720p, 1080p для 1.5 Pro и 1.0 Pro
input_referencefilenoJPEG, PNG или WebP. Принимается только моделями 2.0.

Диапазон длительности по моделям

Modelseconds range
doubao-seedance-2-0, doubao-seedance-2-0-fastот 4 до 15
doubao-seedance-1-5-proот 4 до 12
doubao-seedance-1-0-proот 2 до 10
Если отправить значение вне диапазона модели, будет возвращён HTTP 400 с code: "InvalidParameter" и сообщением о duration.

Поддержка image-to-video

Только модели 2.0 принимают файл input_reference. Отправка input_reference с doubao-seedance-1-5-pro или doubao-seedance-1-0-pro возвращает HTTP 400 с сообщением вида the specified task_type r2v does not support model seedance-1-5-pro. Используйте эти модели только для text-to-video.

Загрузка референсного изображения

Тело запроса — multipart/form-data. Чтобы запустить image-to-video на модели 2.0, прикрепите изображение как часть input_reference в том же запросе:
curl https://api.cometapi.com/v1/videos \
  -H "Authorization: Bearer <COMETAPI_KEY>" \
  -F 'prompt="A slow cinematic camera push across a coastal landscape at sunrise."' \
  -F 'model="doubao-seedance-2-0"' \
  -F 'seconds="5"' \
  -F 'size="16:9"' \
  -F 'resolution="720p"' \
  -F 'input_reference=@/path/to/reference.jpg'
Замените /path/to/reference.jpg на абсолютный или относительный путь к изображению, которое вы хотите использовать как опорный первый кадр. Поддерживаемые форматы: JPEG, PNG и WebP.

Поток задачи

1

Отправка задачи

Отправьте POST-запрос как минимум с prompt и model. Сохраните возвращённый id для следующего шага.
2

Опрос задачи

Вызывайте Retrieve a Seedance video каждые 10–20 секунд.
3

Скачивание результата

Когда status станет SUCCESS, скачайте файл по адресу video_url и разместите его у себя, если нужен долгосрочный доступ. URL подписан и истекает через ограниченное время.

Ответы с ошибками

Endpoint возвращает HTTP 400, если отсутствует обязательное поле, значение выходит за допустимый диапазон или input_reference отправлен в модель, которая не поддерживает image-to-video. Он возвращает HTTP 401, если bearer token отсутствует или недействителен. Тело ошибки использует одну из двух структур; точные поля смотрите в примерах 400 и 401 в playground.

Авторизации

Authorization
string
header
обязательно

Bearer token authentication. Use your CometAPI key.

Тело

multipart/form-data
prompt
string
обязательно

Text prompt that describes the video. Required.

Пример:

"A slow cinematic camera push across a coastal landscape at sunrise."

model
enum<string>
обязательно

Seedance model id. Choose doubao-seedance-2-0 for the highest quality 2.0 output, doubao-seedance-2-0-fast for quick iteration on 2.0, doubao-seedance-1-5-pro for the 1.5 Pro tier, or doubao-seedance-1-0-pro for the 1.0 Pro tier. Only the two 2.0 models accept input_reference.

Доступные опции:
doubao-seedance-2-0,
doubao-seedance-2-0-fast,
doubao-seedance-1-5-pro,
doubao-seedance-1-0-pro
Пример:

"doubao-seedance-2-0-fast"

seconds
integer
по умолчанию:5

Video duration in seconds. The accepted range depends on the model: doubao-seedance-2-0 and doubao-seedance-2-0-fast accept 4 to 15, doubao-seedance-1-5-pro accepts 4 to 12, and doubao-seedance-1-0-pro accepts 2 to 10. The default is 5 for every model.

Требуемый диапазон: 2 <= x <= 15
Пример:

5

size
enum<string>
по умолчанию:16:9

Output aspect ratio. All Seedance models accept the same set of values.

Доступные опции:
21:9,
16:9,
4:3,
1:1,
3:4,
9:16
Пример:

"16:9"

resolution
enum<string>
по умолчанию:720p

Output resolution. 480p and 720p are accepted by every model; 1080p is supported only by doubao-seedance-1-5-pro and doubao-seedance-1-0-pro.

Доступные опции:
480p,
720p,
1080p
Пример:

"720p"

input_reference
file

Optional reference image. When included, the job runs in image-to-video mode and uses the image as the visual anchor. Only doubao-seedance-2-0 and doubao-seedance-2-0-fast accept this field; sending it with a 1.0 Pro or 1.5 Pro model returns HTTP 400.

Ответ

Task created. Save the returned id and poll GET /v1/videos/{id}.

id
string
обязательно

Task id. Use it as the path parameter for GET /v1/videos/{id}.

object
string
обязательно

Object type, always video.

model
string
обязательно

Echo of the requested model id.

status
enum<string>
обязательно

Initial task status. A newly created task is returned as SUBMITTED.

Доступные опции:
SUBMITTED,
IN_PROGRESS,
SUCCESS,
FAILED,
ERROR
progress
integer
обязательно

Completion percentage. 0 at creation.

Требуемый диапазон: 0 <= x <= 100
created_at
integer
обязательно

Task creation time as a Unix timestamp in seconds.

task_id
string

Alias of id returned for compatibility. The value matches id.