Przejdź do głównej treści
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
}
Użyj tego endpointu, aby uruchomić zadanie wideo ByteDance Seedance. Wszystkie warianty modeli Seedance współdzielą ten sam kształt żądania; model wybierasz, ustawiając pole model. Wywołanie natychmiast zwraca id zadania, a renderowanie jest kontynuowane w tle.

Wybierz model

Model idWariantUwagi
doubao-seedance-2-02.0Najwyższa jakość wyjścia w rodzinie 2.0.
doubao-seedance-2-0-fast2.0Szybszy wariant 2.0 do szybkich iteracji i podglądów.
doubao-seedance-1-5-pro1.5 ProObsługuje 1080p. Tylko text-to-video.
doubao-seedance-1-0-pro1.0 ProObsługuje 1080p i krótsze klipy od 2 sekund. Tylko text-to-video.
Zobacz stronę Models, aby sprawdzić bieżącą dostępność.

Zakresy parametrów

FieldTypeRequiredDefaultAllowed values
promptstringtakdowolny tekst
modelstringtakdoubao-seedance-2-0, doubao-seedance-2-0-fast, doubao-seedance-1-5-pro, doubao-seedance-1-0-pro
secondsintegernie5zależy od modelu (patrz poniżej)
sizestringnie16:921:9, 16:9, 4:3, 1:1, 3:4, 9:16
resolutionstringnie720p480p, 720p dla modeli 2.0; 480p, 720p, 1080p dla 1.5 Pro i 1.0 Pro
input_referencefilenieJPEG, PNG lub WebP. Akceptowane tylko przez modele 2.0.

Zakres czasu trwania według modelu

ModelZakres seconds
doubao-seedance-2-0, doubao-seedance-2-0-fastod 4 do 15
doubao-seedance-1-5-prood 4 do 12
doubao-seedance-1-0-prood 2 do 10
Wysłanie wartości spoza zakresu modelu zwraca HTTP 400 z code: "InvalidParameter" oraz komunikatem dotyczącym duration.

Obsługa image-to-video

Tylko modele 2.0 akceptują plik input_reference. Wysłanie input_reference z doubao-seedance-1-5-pro lub doubao-seedance-1-0-pro zwraca HTTP 400 z komunikatem w formie the specified task_type r2v does not support model seedance-1-5-pro. Używaj tych modeli wyłącznie do text-to-video.

Prześlij obraz referencyjny

Treść żądania to multipart/form-data. Aby uruchomić image-to-video na modelu 2.0, dołącz obraz jako część input_reference w tym samym żądaniu:
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'
Zastąp /path/to/reference.jpg ścieżką bezwzględną lub względną do obrazu, którego chcesz użyć jako zakotwiczenia pierwszej klatki. Obsługiwane formaty to JPEG, PNG i WebP.

Przepływ zadania

1

Prześlij zadanie

Wyślij żądanie POST zawierające co najmniej prompt i model. Zachowaj zwrócone id do następnego kroku.
2

Odpytuj zadanie

Wywołuj Retrieve a Seedance video co 10 do 20 sekund.
3

Pobierz wynik

Gdy status zmieni się na SUCCESS, pobierz plik spod video_url i opublikuj go ponownie we własnym hostingu, jeśli potrzebujesz długoterminowego dostępu. URL jest podpisany i wygasa po ograniczonym czasie.

Odpowiedzi błędów

Endpoint zwraca HTTP 400, gdy brakuje wymaganego pola, wartość wykracza poza akceptowany zakres lub input_reference zostanie wysłane do modelu, który nie obsługuje image-to-video. Zwraca HTTP 401, gdy token bearer jest brakujący lub nieprawidłowy. Treść błędu używa jednego z dwóch formatów; zobacz przykłady 400 i 401 w playgroundzie, aby poznać dokładne pola.

Autoryzacje

Authorization
string
header
wymagane

Bearer token authentication. Use your CometAPI key.

Treść

multipart/form-data
prompt
string
wymagane

Text prompt that describes the video. Required.

Przykład:

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

model
enum<string>
wymagane

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.

Dostępne opcje:
doubao-seedance-2-0,
doubao-seedance-2-0-fast,
doubao-seedance-1-5-pro,
doubao-seedance-1-0-pro
Przykład:

"doubao-seedance-2-0-fast"

seconds
integer
domyślnie: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.

Wymagany zakres: 2 <= x <= 15
Przykład:

5

size
enum<string>
domyślnie:16:9

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

Dostępne opcje:
21:9,
16:9,
4:3,
1:1,
3:4,
9:16
Przykład:

"16:9"

resolution
enum<string>
domyślnie: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.

Dostępne opcje:
480p,
720p,
1080p
Przykład:

"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.

Odpowiedź

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

id
string
wymagane

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

object
string
wymagane

Object type, always video.

model
string
wymagane

Echo of the requested model id.

status
enum<string>
wymagane

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

Dostępne opcje:
SUBMITTED,
IN_PROGRESS,
SUCCESS,
FAILED,
ERROR
progress
integer
wymagane

Completion percentage. 0 at creation.

Wymagany zakres: 0 <= x <= 100
created_at
integer
wymagane

Task creation time as a Unix timestamp in seconds.

task_id
string

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