Przejdź do głównej treści
POST
Użyj tego endpointu, aby utworzyć zadanie wideo Vidu. Modele Vidu Q3 tworzą zadania text-to-video i image-to-video. viduq4-preview tworzy zadania image-to-video i reference-to-video. API natychmiast zwraca identyfikator zadania, dlatego zapisz zwrócony id i odpytyj zadanie, aż osiągnie status końcowy. POST /v1/videos używa multipart/form-data. Kontrolki skalarne wysyłaj jako pola formularza, a obrazy referencyjne jako pola input_reference.

Wybierz tryb wejściowy

viduq4-preview wybiera tryb na podstawie żądania. Jeden obraz referencyjny bez dźwięku referencyjnego tworzy zadanie image-to-video. Dwa lub więcej obrazów referencyjnych albo jeden obraz referencyjny z reference_audios tworzą zadanie reference-to-video. Aby potwierdzić, że viduq3 lub viduq3-turbo jest dostępny dla Twojego klucza API, użyj Wyświetl dostępne modele.

Użyj obrazów referencyjnych

W przypadku Q3 image-to-video prześlij jeden obraz referencyjny za pomocą pola multipart input_reference. Plik może mieć rozmiar do 20 MB. Obraz określa kompozycję i wygląd wygenerowanego wideo. Użyj Prompt, aby opisać ruch, zachowanie kamery i szczegóły, które wideo powinno zachować. W przypadku viduq4-preview image-to-video wyślij jeden obraz jako przesłany plik lub publicznie dostępny adres URL HTTPS w input_reference. Wideo rozpoczyna się od tego obrazu i zachowuje jego współczynnik proporcji. W przypadku viduq4-preview reference-to-video wyślij 2–12 publicznie dostępnych adresów URL obrazów HTTPS. Powtórz input_reference raz dla każdego obrazu i wyślij każdy adres URL w osobnym polu. Użyj obrazów PNG, JPEG lub WEBP. W Prompt odwołuj się do obrazów referencyjnych według ich kolejności w żądaniu: @1 to pierwszy obraz input_reference, @2 to drugi itd. Na przykład: The pink car from @1 drives across the snowy hill from @2.

Dodaj dźwięk referencyjny

W przypadku viduq4-preview reference-to-video element reference_audios dodaje odniesienia głosowe. Wyślij maksymalnie 3 publicznie dostępne adresy URL HTTPS klipów MP3, każdy o długości 3–12 sekund, i powtórz reference_audios raz dla każdego klipu. W tym samym żądaniu wyślij co najmniej jeden obraz input_reference.

Ustaw czas trwania i rozmiar

W przypadku modeli Q3 ustaw size na jedną z poniższych wartości WxH. W przypadku viduq4-preview ustaw size na jedną z poniższych wartości WxH. W przypadku reference-to-video parametr size określa kształt klatki. W przypadku image-to-video dane wyjściowe zachowują współczynnik proporcji obrazu wejściowego. viduq4-preview filmy zawierają wygenerowaną ścieżkę audio.

Przepływ zadania

1

Utwórz zadanie

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

Sprawdzaj status zadania

Wywołaj Pobierz film Vidu aż status będzie mieć wartość completed, failed lub error.
3

Pobierz wynik

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

Autoryzacje

Authorization
string
header
wymagane

Bearer authentication. Use your CometAPI API key.

Treść

multipart/form-data
model
string
wymagane

Vidu model ID for this route: viduq3 or viduq3-turbo for text-to-video and image-to-video, or viduq4-preview for image-to-video and reference-to-video. Choose an available model from the Models page.

Przykład:

"viduq3-turbo"

prompt
string
wymagane

Text prompt that describes the video to generate. For image-to-video, describe the motion and camera behavior that should animate the reference image. For viduq4-preview reference-to-video, refer to reference images as @1, @2, and so on, in the order of the input_reference fields. Up to 5000 characters for viduq4-preview.

Przykład:

"An astronaut walks through soft blue fog with a slow cinematic camera move."

seconds
string

Requested clip duration in seconds, sent as an integer string. Use 1 through 16 for viduq3 and viduq3-turbo, or 3 through 16 for viduq4-preview. Default is 5.

Przykład:

"1"

size
string

Output size as WxH. Supported WxH size values for viduq3 and viduq3-turbo: 960x528, 1280x720, 1920x1080. Supported WxH size values for viduq4-preview: 1280x720, 720x1280, 960x960, 1104x816, 816x1104. Default is 1280x720. For viduq4-preview reference-to-video, size sets the frame shape. For viduq4-preview image-to-video, the output keeps the aspect ratio of the input image.

input_reference

Reference images. For Q3 image-to-video, upload one image file up to 20 MB. For viduq4-preview image-to-video, send one image file or one publicly accessible HTTPS image URL. For viduq4-preview reference-to-video, send 2-12 publicly accessible HTTPS image URLs by repeating input_reference once per image. Use PNG, JPEG, or WEBP images. Omit this field for text-to-video.

reference_audios

Voice references for viduq4-preview reference-to-video. Send up to 3 publicly accessible HTTPS URLs of MP3 clips, each 3-12 seconds long, by repeating reference_audios once per clip. Send at least one input_reference image in the same request.

Pattern: ^https://

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, such as viduq3-turbo or viduq4-preview.

Przykład:

"viduq3-turbo"

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.

Ostatnia modyfikacja 27 października 2026