Skip to main content
POST
cURL
Użyj tego endpointu, aby utworzyć zadanie Wan text-to-video. API natychmiast zwraca ID zadania, więc zapisz zwrócone id i odpytuj zadanie, aż osiągnie status końcowy. POST /v1/videos używa multipart/form-data; przekaż kontrolki skalarne jako pola formularza.

Wybierz model

Ustaw czas trwania i rozmiar

Ustaw size na jedną z poniższych wartości WxH dla docelowego modelu.

Wartości size dla Wan 2.7

Wartości size dla Wan 2.6

Przepływ zadania

1

Utwórz zadanie

Wyślij żądanie formularza multipart i zapisz zwrócone id.
2

Odpytuj zadanie

Wywołuj Pobierz wideo Wan, aż status będzie równy completed, failed lub error.
3

Pobierz wynik

Gdy zadanie ma status completed, wywołaj Pobierz zawartość wideo Wan, aby pobrać plik MP4.

Autoryzacje

Authorization
string
header
wymagane

Bearer authentication. Use your CometAPI API key.

Treść

multipart/form-data
model
enum<string>
wymagane

Wan model ID for this endpoint.

Dostępne opcje:
wan2.6,
wan2.7
Przykład:

"wan2.6"

prompt
string
wymagane

Text prompt that describes the video to generate.

Przykład:

"A small robot walks through a bright greenhouse with smooth camera movement."

seconds
string

Requested clip duration in seconds. For wan2.6, use 5, 10, or 15. For wan2.7, use an integer from 2 through 15. Default is 5.

Przykład:

"5"

size
string

Supported WxH size values. For wan2.6: 1280x720, 720x1280, 1088x832, 832x1088, 1920x1080, 1080x1920, 1440x1440, 1632x1248, 1248x1632. For wan2.7: 1280x720, 720x1280, 1920x1080, 1080x1920, 1440x1440. Default is 1920x1080.

Przykład:

"1280x720"

Odpowiedź

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

id
string
wymagane

Task ID. Use this value with retrieve and content endpoints.

Przykład:

"task_example"

object
string
wymagane

Object type. Video tasks return video.

Przykład:

"video"

model
string
wymagane

Model ID used for the task.

Przykład:

"wan2.6"

status
enum<string>
wymagane

Task lifecycle status. Poll until the value is completed, failed, or error.

Dostępne opcje:
queued,
in_progress,
completed,
failed,
error
Przykład:

"queued"

progress
integer
wymagane

Task progress as a coarse percentage.

Wymagany zakres: 0 <= x <= 100
Przykład:

0

created_at
integer
wymagane

Task creation time as a Unix timestamp in seconds.

Przykład:

1779938152

task_id
string

Compatibility alias for id when present.

Przykład:

"task_example"

completed_at
integer

Task completion time as a Unix timestamp in seconds. This field appears on completed tasks.

Przykład:

1779938219

video_url
string

Temporary video delivery URL. This field appears on completed tasks.

Przykład:

"<temporary-video-url>"

error
object

Failure details. This field appears when the task fails.