> ## Documentation Index
> Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Wan video

> Create a Wan video from text, reference media, or first and last frames through CometAPI, then poll the task and download the MP4 file.

Create a Wan video from text, reference media, or first and last frames. Store the returned `id` to poll the task and download the completed video.

`POST /v1/videos` uses `multipart/form-data`. Send an explicit integer `seconds` value and a `size` in `WxH` form.

## Choose an input mode

Every mode requires `model` and `prompt`. The available media inputs depend on the model:

| Goal                               | Model IDs                                    | Media fields                                   |
| ---------------------------------- | -------------------------------------------- | ---------------------------------------------- |
| Text-to-video                      | `wan2.6`, `wan2.7`, `wan3.0`, `wan3.0-prime` | Omit media fields                              |
| Image-to-video                     | `wan2.7`, `wan3.0`, `wan3.0-prime`           | `input_reference` URLs or uploaded image files |
| Reference video                    | `wan2.6`                                     | `reference_videos` only                        |
| Image and video references         | `wan2.7`, `wan3.0`, `wan3.0-prime`           | `input_reference` with `reference_videos`      |
| Image, video, and audio references | `wan3.0`, `wan3.0-prime`                     | Image/video references with `reference_audios` |
| First and last frames              | `wan2.7`, `wan3.0`, `wan3.0-prime`           | `first_frame`, optionally `last_frame`         |

To find a Wan model ID that is available to your API key, use [List available models](/guides/how-to-list-available-models).

## Use reference images

For `wan2.7`, `wan3.0`, and `wan3.0-prime`, send reference images through `input_reference` as publicly accessible HTTPS URLs or uploaded files.
For multiple images, repeat the field in image order, with one URL or file per field.

Use all URLs or all files within `input_reference`. Send each URL separately rather than combining URLs into a comma-separated value.
Use PNG or JPEG images up to 20 MB each.

A single `input_reference` URL or file uses the image-to-video workflow. The image guides composition and appearance; use the prompt to describe motion and camera behavior.

For `wan3.0` and `wan3.0-prime`, send at most 10 reference images through `input_reference`, whether you use URLs or uploaded files.

## Use reference videos and audio

Send videos through `reference_videos` and audio clips through `reference_audios`, repeating each field once per input.
Each input can be a publicly accessible HTTPS URL or an uploaded file.

Use MP4 files with H.264-encoded video for video references. Use separate MP3 files for audio references.

Different fields can use different input types, such as an image URL with uploaded videos. Within `reference_videos` or `reference_audios`, use either all URLs or all files.

You can upload up to five video files, each at most 50 MiB (50 × 1024 × 1024 bytes).
You can upload up to five audio files, each at most 15 MiB (15 × 1024 × 1024 bytes).

### Wan 2.6 video references

Send one to three `reference_videos`, each 2–30 seconds, up to 30 MB, and at least 16 fps.
These limits apply to both URLs and uploaded videos. In the prompt, refer to subjects as `@Video1`, `@Video2`, and `@Video3` in input order.

For this mode, omit `input_reference`, `reference_audios`, `first_frame`, and `last_frame`. Set `seconds` to `5` or `10`.

These examples create a five-second video from two video references. Replace the media URLs or filenames with your inputs:

<CodeGroup>
  ```bash Wan 2.6 reference video URLs theme={null}
  curl https://api.cometapi.com/v1/videos \
    -H "Authorization: Bearer $COMETAPI_KEY" \
    -F 'model=wan2.6' \
    --form-string 'prompt=Keep @Video1 and @Video2 recognizable as they walk.' \
    -F 'seconds=5' \
    -F 'size=1280x720' \
    -F 'reference_videos=https://your-media-host/reference-1.mp4' \
    -F 'reference_videos=https://your-media-host/reference-2.mp4'
  ```

  ```bash Wan 2.6 uploaded reference videos theme={null}
  curl https://api.cometapi.com/v1/videos \
    -H "Authorization: Bearer $COMETAPI_KEY" \
    -F 'model=wan2.6' \
    --form-string 'prompt=Keep @Video1 and @Video2 recognizable as they walk.' \
    -F 'seconds=5' \
    -F 'size=1280x720' \
    -F 'reference_videos=@reference-1.mp4;type=video/mp4' \
    -F 'reference_videos=@reference-2.mp4;type=video/mp4'
  ```
</CodeGroup>

### Wan 2.7 image and video references

Combine image and video references to guide subject appearance and motion. Set `seconds` to an integer from `2` through `10`. Omit `reference_audios`.

Use two image URLs or two uploaded images with a video reference:

<CodeGroup>
  ```bash Wan 2.7 image and video URLs theme={null}
  curl \
    https://api.cometapi.com/v1/videos \
    -H "Authorization: Bearer $COMETAPI_KEY" \
    -F 'model=wan2.7' \
    -F 'prompt=Preserve the image subjects and follow the video motion.' \
    -F 'seconds=5' \
    -F 'size=1280x720' \
    -F 'input_reference=https://your-image-host/reference-1.png' \
    -F 'input_reference=https://your-image-host/reference-2.jpg' \
    -F 'reference_videos=https://your-media-host/reference.mp4'
  ```

  ```bash Wan 2.7 uploaded images and video theme={null}
  curl https://api.cometapi.com/v1/videos \
    -H "Authorization: Bearer $COMETAPI_KEY" \
    -F 'model=wan2.7' \
    -F 'prompt=Preserve the image subjects and follow the video motion.' \
    -F 'seconds=5' \
    -F 'size=1280x720' \
    -F 'input_reference=@reference-1.png;type=image/png' \
    -F 'input_reference=@reference-2.jpg;type=image/jpeg' \
    -F 'reference_videos=@reference.mp4;type=video/mp4'
  ```
</CodeGroup>

### Wan 3.0 image, video, and audio references

For `wan3.0` and `wan3.0-prime`, combine image and video references with audio references to guide appearance, motion, and rhythm.

Send at most five video references with a combined duration of at most 15 seconds. Each video must be at least 16 fps.
Send at most five audio references with a combined duration of at most 15 seconds. Count video and audio duration separately.

Set output `seconds` to an integer from `2` through `30`.

Use two image URLs or two uploaded images with one video and two audio clips:

<CodeGroup>
  ```bash Wan 3.0 image, video, and audio URLs theme={null}
  curl \
    https://api.cometapi.com/v1/videos \
    -H "Authorization: Bearer $COMETAPI_KEY" \
    -F 'model=wan3.0' \
    -F 'prompt=Preserve image subjects, video motion, and audio rhythm.' \
    -F 'seconds=5' \
    -F 'size=1280x720' \
    -F 'input_reference=https://your-image-host/reference-1.png' \
    -F 'input_reference=https://your-image-host/reference-2.jpg' \
    -F 'reference_videos=https://your-media-host/reference.mp4' \
    -F 'reference_audios=https://your-media-host/reference-1.mp3' \
    -F 'reference_audios=https://your-media-host/reference-2.mp3'
  ```

  ```bash Wan 3.0 uploaded images, video, and audio theme={null}
  curl https://api.cometapi.com/v1/videos \
    -H "Authorization: Bearer $COMETAPI_KEY" \
    -F 'model=wan3.0' \
    -F 'prompt=Preserve image subjects, video motion, and audio rhythm.' \
    -F 'seconds=5' \
    -F 'size=1280x720' \
    -F 'input_reference=@reference-1.png;type=image/png' \
    -F 'input_reference=@reference-2.jpg;type=image/jpeg' \
    -F 'reference_videos=@reference.mp4;type=video/mp4' \
    -F 'reference_audios=@reference-1.mp3;type=audio/mpeg' \
    -F 'reference_audios=@reference-2.mp3;type=audio/mpeg'
  ```
</CodeGroup>

## Use first and last frames

For `wan2.7`, `wan3.0`, and `wan3.0-prime`, send `first_frame` for the opening image and optionally `last_frame` for the ending image.
Each field accepts one publicly accessible HTTPS PNG or JPEG URL or one uploaded PNG or JPEG file.

For Wan 2.7 frame inputs, the opening image determines the aspect ratio, while `size` selects the output resolution tier.

Submit frame inputs in a separate request from `input_reference`, `reference_videos`, and `reference_audios`.

These Wan 2.7 examples create a transition between opening and ending frames:

<CodeGroup>
  ```bash Wan 2.7 first and last frame URLs theme={null}
  curl https://api.cometapi.com/v1/videos \
    -H "Authorization: Bearer $COMETAPI_KEY" \
    -F 'model=wan2.7' \
    -F 'prompt=Move smoothly from the opening frame to the ending frame.' \
    -F 'seconds=5' \
    -F 'size=1280x720' \
    -F 'first_frame=https://your-image-host/first-frame.png' \
    -F 'last_frame=https://your-image-host/last-frame.jpg'
  ```

  ```bash Wan 2.7 uploaded first and last frames theme={null}
  curl https://api.cometapi.com/v1/videos \
    -H "Authorization: Bearer $COMETAPI_KEY" \
    -F 'model=wan2.7' \
    -F 'prompt=Move smoothly from the opening frame to the ending frame.' \
    -F 'seconds=5' \
    -F 'size=1280x720' \
    -F 'first_frame=@first-frame.png;type=image/png' \
    -F 'last_frame=@last-frame.jpg;type=image/jpeg'
  ```
</CodeGroup>

These Wan 3.0 examples create a transition between opening and ending frames:

<CodeGroup>
  ```bash Wan 3.0 first and last frame URLs theme={null}
  curl https://api.cometapi.com/v1/videos \
    -H "Authorization: Bearer $COMETAPI_KEY" \
    -F 'model=wan3.0' \
    -F 'prompt=Move smoothly from the opening frame to the ending frame.' \
    -F 'seconds=5' \
    -F 'size=1280x720' \
    -F 'first_frame=https://your-image-host/first-frame.png' \
    -F 'last_frame=https://your-image-host/last-frame.jpg'
  ```

  ```bash Wan 3.0 uploaded first and last frames theme={null}
  curl https://api.cometapi.com/v1/videos \
    -H "Authorization: Bearer $COMETAPI_KEY" \
    -F 'model=wan3.0' \
    -F 'prompt=Move smoothly from the opening frame to the ending frame.' \
    -F 'seconds=5' \
    -F 'size=1280x720' \
    -F 'first_frame=@first-frame.png;type=image/png' \
    -F 'last_frame=@last-frame.jpg;type=image/jpeg'
  ```
</CodeGroup>

## Set duration and size

Send `seconds` as a whole number within the range for your model and input mode.

| Model ID                 | Input mode                  | `seconds`        | Default                                                           |
| ------------------------ | --------------------------- | ---------------- | ----------------------------------------------------------------- |
| `wan3.0`, `wan3.0-prime` | Text, references, or frames | integer `2`–`30` | `5` seconds, `1920x1080`                                          |
| `wan2.7`                 | Text                        | integer `2`–`15` | `5` seconds, `1920x1080`                                          |
| `wan2.7`                 | Frames                      | integer `2`–`15` | `5` seconds, `1080p` tier; aspect ratio follows the opening image |
| `wan2.7`                 | Image/video references      | integer `2`–`10` | `5` seconds, `1920x1080`                                          |
| `wan2.6`                 | Text                        | `5`, `10`, `15`  | `5` seconds, `1920x1080`                                          |
| `wan2.6`                 | Video references            | `5`, `10`        | `5` seconds, `1920x1080`                                          |

Set `size` to one of the WxH values below for the target model.

The Wan 3.0 size values also apply to `wan3.0-prime`.

### Wan 3.0 size values

| Resolution tier | Aspect ratio | `size` (`WxH`) |
| --------------- | ------------ | -------------- |
| `480p`          | `16:9`       | `832x480`      |
|                 | `9:16`       | `480x832`      |
|                 | `1:1`        | `624x624`      |
| `720p`          | `16:9`       | `1280x720`     |
|                 | `9:16`       | `720x1280`     |
|                 | `1:1`        | `960x960`      |
|                 | `4:3`        | `1088x832`     |
|                 | `3:4`        | `832x1088`     |
| `1080p`         | `16:9`       | `1920x1080`    |
|                 | `9:16`       | `1080x1920`    |
|                 | `1:1`        | `1440x1440`    |
|                 | `4:3`        | `1632x1248`    |
|                 | `3:4`        | `1248x1632`    |

### Wan 2.7 size values

| Resolution tier | Aspect ratio | `size` (`WxH`) |
| --------------- | ------------ | -------------- |
| `720p`          | `16:9`       | `1280x720`     |
|                 | `9:16`       | `720x1280`     |
| `1080p`         | `16:9`       | `1920x1080`    |
|                 | `9:16`       | `1080x1920`    |
|                 | `1:1`        | `1440x1440`    |

### Wan 2.6 size values

| Resolution tier | Aspect ratio | `size` (`WxH`) |
| --------------- | ------------ | -------------- |
| `720p`          | `16:9`       | `1280x720`     |
|                 | `9:16`       | `720x1280`     |
|                 | `4:3`        | `1088x832`     |
|                 | `3:4`        | `832x1088`     |
| `1080p`         | `16:9`       | `1920x1080`    |
|                 | `9:16`       | `1080x1920`    |
|                 | `1:1`        | `1440x1440`    |
|                 | `4:3`        | `1632x1248`    |
|                 | `3:4`        | `1248x1632`    |

## Task flow

<Steps>
  <Step title="Create the task">
    Send the multipart form request and store the returned `id`.
  </Step>

  <Step title="Poll the task">
    Call [Retrieve a Wan video](./retrieve) until `status` is `completed`, `failed`, or `error`.
  </Step>

  <Step title="Download the result">
    When the task is `completed`, call [Retrieve Wan video content](./retrieve-content) to download the MP4 file.
  </Step>
</Steps>


## OpenAPI

````yaml api/openapi/video/wan/post-create.openapi.json POST /v1/videos
openapi: 3.1.0
info:
  title: Wan Video Create API
  version: 1.0.0
  description: >-
    Create an asynchronous Wan video task from text, reference media, or first
    and last frames through CometAPI. Save the returned id, poll GET
    /v1/videos/{task_id}, and download the completed MP4 file.
servers:
  - url: https://api.cometapi.com
security:
  - bearerAuth: []
paths:
  /v1/videos:
    post:
      summary: Create a Wan video task
      description: >-
        Create a Wan video task from text, reference media, or first and last
        frames. Send fields as multipart/form-data. Repeat input_reference with
        one publicly accessible HTTPS image URL or uploaded image file per
        field. Use all URLs or all files within input_reference. Send reference
        video or audio URLs or files through reference_videos or
        reference_audios. Submit frame inputs separately from reference media.
      operationId: wan_create_video
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/WanCreateRequest'
            encoding:
              input_reference:
                style: form
                explode: true
                contentType: text/plain, image/png, image/jpeg
              reference_videos:
                style: form
                explode: true
              reference_audios:
                style: form
                explode: true
              first_frame:
                style: form
              last_frame:
                style: form
            examples:
              text_to_video:
                summary: Text-to-video
                value:
                  model: wan3.0
                  prompt: >-
                    A small robot walks through a bright greenhouse with smooth
                    camera movement.
                  seconds: 5
                  size: 1920x1080
              image_to_video:
                summary: Image-to-video with an uploaded reference image
                value:
                  model: wan3.0
                  prompt: Animate the uploaded image.
                  seconds: 5
                  size: 1920x1080
                  input_reference:
                    - '@reference.png'
              wan26_reference_video_urls:
                summary: Wan 2.6 reference video URLs
                value:
                  model: wan2.6
                  prompt: Keep @Video1 and @Video2 recognizable as they walk.
                  seconds: 5
                  size: 1280x720
                  reference_videos:
                    - https://your-media-host/reference-1.mp4
                    - https://your-media-host/reference-2.mp4
              wan26_reference_video_files:
                summary: Wan 2.6 uploaded reference videos
                value:
                  model: wan2.6
                  prompt: Keep @Video1 and @Video2 recognizable as they walk.
                  seconds: 5
                  size: 1280x720
                  reference_videos:
                    - '@reference-1.mp4'
                    - '@reference-2.mp4'
              wan27_image_video_urls:
                summary: Wan 2.7 image and video URLs
                value:
                  model: wan2.7
                  prompt: Preserve the image subjects and follow the video motion.
                  seconds: 5
                  size: 1280x720
                  reference_videos:
                    - https://your-media-host/reference.mp4
                  input_reference:
                    - https://your-image-host/reference-1.png
                    - https://your-image-host/reference-2.jpg
              wan27_image_video_files:
                summary: Wan 2.7 uploaded images and video
                value:
                  model: wan2.7
                  prompt: Preserve the image subjects and follow the video motion.
                  seconds: 5
                  size: 1280x720
                  input_reference:
                    - '@reference-1.png'
                    - '@reference-2.jpg'
                  reference_videos:
                    - '@reference.mp4'
              wan30_image_video_audio_urls:
                summary: Wan 3.0 image, video, and audio URLs
                value:
                  model: wan3.0
                  prompt: Preserve image subjects, video motion, and audio rhythm.
                  seconds: 5
                  size: 1280x720
                  reference_videos:
                    - https://your-media-host/reference.mp4
                  reference_audios:
                    - https://your-media-host/reference-1.mp3
                    - https://your-media-host/reference-2.mp3
                  input_reference:
                    - https://your-image-host/reference-1.png
                    - https://your-image-host/reference-2.jpg
              wan30_image_video_audio_files:
                summary: Wan 3.0 uploaded images, video, and audio
                value:
                  model: wan3.0
                  prompt: Preserve image subjects, video motion, and audio rhythm.
                  seconds: 5
                  size: 1280x720
                  input_reference:
                    - '@reference-1.png'
                    - '@reference-2.jpg'
                  reference_videos:
                    - '@reference.mp4'
                  reference_audios:
                    - '@reference-1.mp3'
                    - '@reference-2.mp3'
              wan27_first_last_frame_urls:
                summary: Wan 2.7 first and last frame URLs
                value:
                  model: wan2.7
                  prompt: Move smoothly from the opening frame to the ending frame.
                  seconds: 5
                  size: 1280x720
                  first_frame: https://your-image-host/first-frame.png
                  last_frame: https://your-image-host/last-frame.jpg
              wan27_first_last_frame_files:
                summary: Wan 2.7 uploaded first and last frames
                value:
                  model: wan2.7
                  prompt: Move smoothly from the opening frame to the ending frame.
                  seconds: 5
                  size: 1280x720
                  first_frame: '@first-frame.png'
                  last_frame: '@last-frame.jpg'
              wan30_first_last_frame_urls:
                summary: Wan 3.0 first and last frame URLs
                value:
                  model: wan3.0
                  prompt: Move smoothly from the opening frame to the ending frame.
                  seconds: 5
                  size: 1280x720
                  first_frame: https://your-image-host/first-frame.png
                  last_frame: https://your-image-host/last-frame.jpg
              wan30_first_last_frame_files:
                summary: Wan 3.0 uploaded first and last frames
                value:
                  model: wan3.0
                  prompt: Move smoothly from the opening frame to the ending frame.
                  seconds: 5
                  size: 1280x720
                  first_frame: '@first-frame.png'
                  last_frame: '@last-frame.jpg'
      responses:
        '200':
          description: >-
            Task created. Store the returned id and poll GET
            /v1/videos/{task_id}.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WanVideoTask'
              example:
                id: task_example
                task_id: task_example
                object: video
                model: wan3.0
                status: queued
                progress: 0
                created_at: 1779938152
        '400':
          description: >-
            The request is missing a required field or contains a value that the
            selected model cannot use.
        '401':
          description: The API key is missing or invalid.
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: Shell
          label: Text-to-video
          source: |-
            curl https://api.cometapi.com/v1/videos \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -F model=wan3.0 \
              -F 'prompt=A small robot walks through a bright greenhouse with smooth camera movement.' \
              -F seconds=5 \
              -F size=1920x1080
        - lang: Python
          label: Text-to-video
          source: |
            import os
            import requests

            fields = [
                ("model", (None, "wan3.0")),
                ("prompt", (None, "A small robot walks through a bright greenhouse with smooth camera movement.")),
                ("seconds", (None, "5")),
                ("size", (None, "1920x1080")),
            ]

            response = requests.post(
                "https://api.cometapi.com/v1/videos",
                headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
                files=fields,
                timeout=120,
            )

            response.raise_for_status()
            print(response.json())
        - lang: JavaScript
          label: Text-to-video
          source: >
            const form = new FormData();

            form.append("model", "wan3.0");

            form.append("prompt", "A small robot walks through a bright
            greenhouse with smooth camera movement.");

            form.append("seconds", "5");

            form.append("size", "1920x1080");


            const response = await fetch("https://api.cometapi.com/v1/videos", {
              method: "POST",
              headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },
              body: form,
            });


            const result = await response.json();

            console.log(result);
        - lang: Shell
          label: Image-to-video
          source: |-
            curl https://api.cometapi.com/v1/videos \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -F 'model=wan3.0' \
              -F 'prompt=Animate the uploaded image.' \
              -F 'seconds=5' \
              -F 'size=1920x1080' \
              -F 'input_reference=@reference.png;type=image/png'
        - lang: Python
          label: Image-to-video
          source: |
            import os

            import requests

            with open("reference.png", "rb") as reference:
                response = requests.post(
                    "https://api.cometapi.com/v1/videos",
                    headers={
                        "Authorization": "Bearer "
                        + os.environ["COMETAPI_KEY"]
                    },
                    data={
                        "model": "wan3.0",
                        "prompt": "Animate the uploaded image.",
                        "seconds": "5",
                        "size": "1920x1080",
                    },
                    files={
                        "input_reference": (
                            "reference.png",
                            reference,
                            "image/png",
                        )
                    },
                    timeout=120,
                )

            response.raise_for_status()
            print(response.json())
        - lang: JavaScript
          label: Image-to-video
          source: |
            import { readFile } from "node:fs/promises";

            const reference = await readFile("reference.png");
            const form = new FormData();
            form.append("model", "wan3.0");
            form.append("prompt", "Animate the uploaded image.");
            form.append("seconds", "5");
            form.append("size", "1920x1080");
            form.append(
              "input_reference",
              new Blob([reference], { type: "image/png" }),
              "reference.png",
            );

            const response = await fetch("https://api.cometapi.com/v1/videos", {
              method: "POST",
              headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },
              body: form,
            });

            const result = await response.json();
            console.log(result);
        - lang: Shell
          label: Wan 2.6 reference video URLs
          source: |-
            curl https://api.cometapi.com/v1/videos \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -F 'model=wan2.6' \
              --form-string 'prompt=Keep @Video1 and @Video2 recognizable as they walk.' \
              -F 'seconds=5' \
              -F 'size=1280x720' \
              -F 'reference_videos=https://your-media-host/reference-1.mp4' \
              -F 'reference_videos=https://your-media-host/reference-2.mp4'
        - lang: Python
          label: Wan 2.6 reference video URLs
          source: |
            import os

            import requests

            fields = [
                ("model", (None, "wan2.6")),
                (
                    "prompt",
                    (None, "Keep @Video1 and @Video2 recognizable as they walk."),
                ),
                ("seconds", (None, "5")),
                ("size", (None, "1280x720")),
                ("reference_videos", (None, "https://your-media-host/reference-1.mp4")),
                ("reference_videos", (None, "https://your-media-host/reference-2.mp4")),
            ]

            response = requests.post(
                "https://api.cometapi.com/v1/videos",
                headers={
                    "Authorization": "Bearer " + os.environ["COMETAPI_KEY"]
                },
                files=fields,
                timeout=120,
            )

            response.raise_for_status()
            print(response.json())
        - lang: JavaScript
          label: Wan 2.6 reference video URLs
          source: >
            const form = new FormData();

            form.append("model", "wan2.6");

            form.append(
              "prompt",
              "Keep @Video1 and @Video2 recognizable as they walk.",
            );

            form.append("seconds", "5");

            form.append("size", "1280x720");

            form.append("reference_videos",
            "https://your-media-host/reference-1.mp4");

            form.append("reference_videos",
            "https://your-media-host/reference-2.mp4");


            const response = await fetch("https://api.cometapi.com/v1/videos", {
              method: "POST",
              headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },
              body: form,
            });


            if (!response.ok) {
              throw new Error(await response.text());
            }


            console.log(await response.json());
        - lang: Shell
          label: Wan 2.6 uploaded reference videos
          source: |-
            curl https://api.cometapi.com/v1/videos \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -F 'model=wan2.6' \
              --form-string 'prompt=Keep @Video1 and @Video2 recognizable as they walk.' \
              -F 'seconds=5' \
              -F 'size=1280x720' \
              -F 'reference_videos=@reference-1.mp4;type=video/mp4' \
              -F 'reference_videos=@reference-2.mp4;type=video/mp4'
        - lang: Python
          label: Wan 2.6 uploaded reference videos
          source: |
            import os
            from contextlib import ExitStack

            import requests

            with ExitStack() as stack:
                fields = [
                    ("model", (None, "wan2.6")),
                    (
                        "prompt",
                        (None, "Keep @Video1 and @Video2 recognizable as they walk."),
                    ),
                    ("seconds", (None, "5")),
                    ("size", (None, "1280x720")),
                    (
                        "reference_videos",
                        (
                            "reference-1.mp4",
                            stack.enter_context(open("reference-1.mp4", "rb")),
                            "video/mp4",
                        ),
                    ),
                    (
                        "reference_videos",
                        (
                            "reference-2.mp4",
                            stack.enter_context(open("reference-2.mp4", "rb")),
                            "video/mp4",
                        ),
                    ),
                ]

                response = requests.post(
                    "https://api.cometapi.com/v1/videos",
                    headers={
                        "Authorization": "Bearer " + os.environ["COMETAPI_KEY"]
                    },
                    files=fields,
                    timeout=120,
                )

            response.raise_for_status()
            print(response.json())
        - lang: JavaScript
          label: Wan 2.6 uploaded reference videos
          source: |
            import { readFile } from "node:fs/promises";

            const form = new FormData();
            form.append("model", "wan2.6");
            form.append(
              "prompt",
              "Keep @Video1 and @Video2 recognizable as they walk.",
            );
            form.append("seconds", "5");
            form.append("size", "1280x720");
            form.append(
              "reference_videos",
              new Blob([await readFile("reference-1.mp4")], {
                type: "video/mp4",
              }),
              "reference-1.mp4",
            );
            form.append(
              "reference_videos",
              new Blob([await readFile("reference-2.mp4")], {
                type: "video/mp4",
              }),
              "reference-2.mp4",
            );

            const response = await fetch("https://api.cometapi.com/v1/videos", {
              method: "POST",
              headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },
              body: form,
            });

            if (!response.ok) {
              throw new Error(await response.text());
            }

            console.log(await response.json());
        - lang: Shell
          label: Wan 2.7 image and video URLs
          source: |
            curl \
              https://api.cometapi.com/v1/videos \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              --form-string model=wan2.7 \
              --form-string 'prompt=Preserve the image subjects and follow the video motion.' \
              --form-string seconds=5 \
              --form-string size=1280x720 \
              --form-string reference_videos=https://your-media-host/reference.mp4 \
              --form-string input_reference=https://your-image-host/reference-1.png \
              --form-string input_reference=https://your-image-host/reference-2.jpg
        - lang: Python
          label: Wan 2.7 image and video URLs
          source: |
            import os

            import requests

            fields = [
                ("model", (None, "wan2.7")),
                (
                    "prompt",
                    (
                        None,
                        "Preserve the image subjects and follow the video motion."
                    ),
                ),
                ("seconds", (None, "5")),
                ("size", (None, "1280x720")),
                ("reference_videos", (None, "https://your-media-host/reference.mp4")),
                ("input_reference", (None, "https://your-image-host/reference-1.png")),
                ("input_reference", (None, "https://your-image-host/reference-2.jpg")),
            ]

            response = requests.post(
                "https://api.cometapi.com/v1/videos",
                headers={
                    "Authorization": "Bearer " + os.environ["COMETAPI_KEY"]
                },
                files=fields,
                timeout=120,
            )

            response.raise_for_status()
            print(response.json())
        - lang: JavaScript
          label: Wan 2.7 image and video URLs
          source: >
            const form = new FormData();

            form.append("model", "wan2.7");

            form.append(
              "prompt",
              "Preserve the image subjects and follow the video motion.",
            );

            form.append("seconds", "5");

            form.append("size", "1280x720");

            form.append("reference_videos",
            "https://your-media-host/reference.mp4");

            form.append("input_reference",
            "https://your-image-host/reference-1.png");

            form.append("input_reference",
            "https://your-image-host/reference-2.jpg");


            const response = await fetch("https://api.cometapi.com/v1/videos", {
              method: "POST",
              headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },
              body: form,
            });


            if (!response.ok) {
              throw new Error(await response.text());
            }


            console.log(await response.json());
        - lang: Shell
          label: Wan 2.7 uploaded images and video
          source: |-
            curl https://api.cometapi.com/v1/videos \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -F 'model=wan2.7' \
              -F 'prompt=Preserve the image subjects and follow the video motion.' \
              -F 'seconds=5' \
              -F 'size=1280x720' \
              -F 'input_reference=@reference-1.png;type=image/png' \
              -F 'input_reference=@reference-2.jpg;type=image/jpeg' \
              -F 'reference_videos=@reference.mp4;type=video/mp4'
        - lang: Python
          label: Wan 2.7 uploaded images and video
          source: |
            import os
            from contextlib import ExitStack

            import requests

            with ExitStack() as stack:
                fields = [
                    ("model", (None, "wan2.7")),
                    (
                        "prompt",
                        (None, "Preserve the image subjects and follow the video motion."),
                    ),
                    ("seconds", (None, "5")),
                    ("size", (None, "1280x720")),
                    (
                        "input_reference",
                        (
                            "reference-1.png",
                            stack.enter_context(open("reference-1.png", "rb")),
                            "image/png",
                        ),
                    ),
                    (
                        "input_reference",
                        (
                            "reference-2.jpg",
                            stack.enter_context(open("reference-2.jpg", "rb")),
                            "image/jpeg",
                        ),
                    ),
                    (
                        "reference_videos",
                        (
                            "reference.mp4",
                            stack.enter_context(open("reference.mp4", "rb")),
                            "video/mp4",
                        ),
                    ),
                ]

                response = requests.post(
                    "https://api.cometapi.com/v1/videos",
                    headers={
                        "Authorization": "Bearer " + os.environ["COMETAPI_KEY"]
                    },
                    files=fields,
                    timeout=120,
                )

            response.raise_for_status()
            print(response.json())
        - lang: JavaScript
          label: Wan 2.7 uploaded images and video
          source: |
            import { readFile } from "node:fs/promises";

            const form = new FormData();
            form.append("model", "wan2.7");
            form.append(
              "prompt",
              "Preserve the image subjects and follow the video motion.",
            );
            form.append("seconds", "5");
            form.append("size", "1280x720");
            form.append(
              "input_reference",
              new Blob([await readFile("reference-1.png")], {
                type: "image/png",
              }),
              "reference-1.png",
            );
            form.append(
              "input_reference",
              new Blob([await readFile("reference-2.jpg")], {
                type: "image/jpeg",
              }),
              "reference-2.jpg",
            );
            form.append(
              "reference_videos",
              new Blob([await readFile("reference.mp4")], {
                type: "video/mp4",
              }),
              "reference.mp4",
            );

            const response = await fetch("https://api.cometapi.com/v1/videos", {
              method: "POST",
              headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },
              body: form,
            });

            if (!response.ok) {
              throw new Error(await response.text());
            }

            console.log(await response.json());
        - lang: Shell
          label: Wan 3.0 image, video, and audio URLs
          source: |
            curl \
              https://api.cometapi.com/v1/videos \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              --form-string model=wan3.0 \
              --form-string 'prompt=Preserve image subjects, video motion, and audio rhythm.' \
              --form-string seconds=5 \
              --form-string size=1280x720 \
              --form-string reference_videos=https://your-media-host/reference.mp4 \
              --form-string reference_audios=https://your-media-host/reference-1.mp3 \
              --form-string reference_audios=https://your-media-host/reference-2.mp3 \
              --form-string input_reference=https://your-image-host/reference-1.png \
              --form-string input_reference=https://your-image-host/reference-2.jpg
        - lang: Python
          label: Wan 3.0 image, video, and audio URLs
          source: |
            import os

            import requests

            fields = [
                ("model", (None, "wan3.0")),
                (
                    "prompt",
                    (
                        None,
                        "Preserve image subjects, video motion, and audio rhythm."
                    ),
                ),
                ("seconds", (None, "5")),
                ("size", (None, "1280x720")),
                ("reference_videos", (None, "https://your-media-host/reference.mp4")),
                ("reference_audios", (None, "https://your-media-host/reference-1.mp3")),
                ("reference_audios", (None, "https://your-media-host/reference-2.mp3")),
                ("input_reference", (None, "https://your-image-host/reference-1.png")),
                ("input_reference", (None, "https://your-image-host/reference-2.jpg")),
            ]

            response = requests.post(
                "https://api.cometapi.com/v1/videos",
                headers={
                    "Authorization": "Bearer " + os.environ["COMETAPI_KEY"]
                },
                files=fields,
                timeout=120,
            )

            response.raise_for_status()
            print(response.json())
        - lang: JavaScript
          label: Wan 3.0 image, video, and audio URLs
          source: >
            const form = new FormData();

            form.append("model", "wan3.0");

            form.append(
              "prompt",
              "Preserve image subjects, video motion, and audio rhythm.",
            );

            form.append("seconds", "5");

            form.append("size", "1280x720");

            form.append("reference_videos",
            "https://your-media-host/reference.mp4");

            form.append("reference_audios",
            "https://your-media-host/reference-1.mp3");

            form.append("reference_audios",
            "https://your-media-host/reference-2.mp3");

            form.append("input_reference",
            "https://your-image-host/reference-1.png");

            form.append("input_reference",
            "https://your-image-host/reference-2.jpg");


            const response = await fetch("https://api.cometapi.com/v1/videos", {
              method: "POST",
              headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },
              body: form,
            });


            if (!response.ok) {
              throw new Error(await response.text());
            }


            console.log(await response.json());
        - lang: Shell
          label: Wan 3.0 uploaded images, video, and audio
          source: |-
            curl https://api.cometapi.com/v1/videos \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -F 'model=wan3.0' \
              -F 'prompt=Preserve image subjects, video motion, and audio rhythm.' \
              -F 'seconds=5' \
              -F 'size=1280x720' \
              -F 'input_reference=@reference-1.png;type=image/png' \
              -F 'input_reference=@reference-2.jpg;type=image/jpeg' \
              -F 'reference_videos=@reference.mp4;type=video/mp4' \
              -F 'reference_audios=@reference-1.mp3;type=audio/mpeg' \
              -F 'reference_audios=@reference-2.mp3;type=audio/mpeg'
        - lang: Python
          label: Wan 3.0 uploaded images, video, and audio
          source: |
            import os
            from contextlib import ExitStack

            import requests

            with ExitStack() as stack:
                fields = [
                    ("model", (None, "wan3.0")),
                    (
                        "prompt",
                        (None, "Preserve image subjects, video motion, and audio rhythm."),
                    ),
                    ("seconds", (None, "5")),
                    ("size", (None, "1280x720")),
                    (
                        "input_reference",
                        (
                            "reference-1.png",
                            stack.enter_context(open("reference-1.png", "rb")),
                            "image/png",
                        ),
                    ),
                    (
                        "input_reference",
                        (
                            "reference-2.jpg",
                            stack.enter_context(open("reference-2.jpg", "rb")),
                            "image/jpeg",
                        ),
                    ),
                    (
                        "reference_videos",
                        (
                            "reference.mp4",
                            stack.enter_context(open("reference.mp4", "rb")),
                            "video/mp4",
                        ),
                    ),
                    (
                        "reference_audios",
                        (
                            "reference-1.mp3",
                            stack.enter_context(open("reference-1.mp3", "rb")),
                            "audio/mpeg",
                        ),
                    ),
                    (
                        "reference_audios",
                        (
                            "reference-2.mp3",
                            stack.enter_context(open("reference-2.mp3", "rb")),
                            "audio/mpeg",
                        ),
                    ),
                ]

                response = requests.post(
                    "https://api.cometapi.com/v1/videos",
                    headers={
                        "Authorization": "Bearer " + os.environ["COMETAPI_KEY"]
                    },
                    files=fields,
                    timeout=120,
                )

            response.raise_for_status()
            print(response.json())
        - lang: JavaScript
          label: Wan 3.0 uploaded images, video, and audio
          source: |
            import { readFile } from "node:fs/promises";

            const form = new FormData();
            form.append("model", "wan3.0");
            form.append(
              "prompt",
              "Preserve image subjects, video motion, and audio rhythm.",
            );
            form.append("seconds", "5");
            form.append("size", "1280x720");
            form.append(
              "input_reference",
              new Blob([await readFile("reference-1.png")], {
                type: "image/png",
              }),
              "reference-1.png",
            );
            form.append(
              "input_reference",
              new Blob([await readFile("reference-2.jpg")], {
                type: "image/jpeg",
              }),
              "reference-2.jpg",
            );
            form.append(
              "reference_videos",
              new Blob([await readFile("reference.mp4")], {
                type: "video/mp4",
              }),
              "reference.mp4",
            );
            form.append(
              "reference_audios",
              new Blob([await readFile("reference-1.mp3")], {
                type: "audio/mpeg",
              }),
              "reference-1.mp3",
            );
            form.append(
              "reference_audios",
              new Blob([await readFile("reference-2.mp3")], {
                type: "audio/mpeg",
              }),
              "reference-2.mp3",
            );

            const response = await fetch("https://api.cometapi.com/v1/videos", {
              method: "POST",
              headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },
              body: form,
            });

            if (!response.ok) {
              throw new Error(await response.text());
            }

            console.log(await response.json());
        - lang: Shell
          label: Wan 2.7 first and last frame URLs
          source: |-
            curl https://api.cometapi.com/v1/videos \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -F 'model=wan2.7' \
              -F 'prompt=Move smoothly from the opening frame to the ending frame.' \
              -F 'seconds=5' \
              -F 'size=1280x720' \
              -F 'first_frame=https://your-image-host/first-frame.png' \
              -F 'last_frame=https://your-image-host/last-frame.jpg'
        - lang: Python
          label: Wan 2.7 first and last frame URLs
          source: |
            import os

            import requests

            fields = [
                ("model", (None, "wan2.7")),
                (
                    "prompt",
                    (None, "Move smoothly from the opening frame to the ending frame."),
                ),
                ("seconds", (None, "5")),
                ("size", (None, "1280x720")),
                ("first_frame", (None, "https://your-image-host/first-frame.png")),
                ("last_frame", (None, "https://your-image-host/last-frame.jpg")),
            ]

            response = requests.post(
                "https://api.cometapi.com/v1/videos",
                headers={
                    "Authorization": "Bearer " + os.environ["COMETAPI_KEY"]
                },
                files=fields,
                timeout=120,
            )

            response.raise_for_status()
            print(response.json())
        - lang: JavaScript
          label: Wan 2.7 first and last frame URLs
          source: >
            const form = new FormData();

            form.append("model", "wan2.7");

            form.append(
              "prompt",
              "Move smoothly from the opening frame to the ending frame.",
            );

            form.append("seconds", "5");

            form.append("size", "1280x720");

            form.append("first_frame",
            "https://your-image-host/first-frame.png");

            form.append("last_frame", "https://your-image-host/last-frame.jpg");


            const response = await fetch("https://api.cometapi.com/v1/videos", {
              method: "POST",
              headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },
              body: form,
            });


            if (!response.ok) {
              throw new Error(await response.text());
            }


            console.log(await response.json());
        - lang: Shell
          label: Wan 2.7 uploaded first and last frames
          source: |-
            curl https://api.cometapi.com/v1/videos \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -F 'model=wan2.7' \
              -F 'prompt=Move smoothly from the opening frame to the ending frame.' \
              -F 'seconds=5' \
              -F 'size=1280x720' \
              -F 'first_frame=@first-frame.png;type=image/png' \
              -F 'last_frame=@last-frame.jpg;type=image/jpeg'
        - lang: Python
          label: Wan 2.7 uploaded first and last frames
          source: |
            import os
            from contextlib import ExitStack

            import requests

            with ExitStack() as stack:
                fields = [
                    ("model", (None, "wan2.7")),
                    (
                        "prompt",
                        (None, "Move smoothly from the opening frame to the ending frame."),
                    ),
                    ("seconds", (None, "5")),
                    ("size", (None, "1280x720")),
                    (
                        "first_frame",
                        (
                            "first-frame.png",
                            stack.enter_context(open("first-frame.png", "rb")),
                            "image/png",
                        ),
                    ),
                    (
                        "last_frame",
                        (
                            "last-frame.jpg",
                            stack.enter_context(open("last-frame.jpg", "rb")),
                            "image/jpeg",
                        ),
                    ),
                ]

                response = requests.post(
                    "https://api.cometapi.com/v1/videos",
                    headers={
                        "Authorization": "Bearer " + os.environ["COMETAPI_KEY"]
                    },
                    files=fields,
                    timeout=120,
                )

            response.raise_for_status()
            print(response.json())
        - lang: JavaScript
          label: Wan 2.7 uploaded first and last frames
          source: |
            import { readFile } from "node:fs/promises";

            const form = new FormData();
            form.append("model", "wan2.7");
            form.append(
              "prompt",
              "Move smoothly from the opening frame to the ending frame.",
            );
            form.append("seconds", "5");
            form.append("size", "1280x720");
            form.append(
              "first_frame",
              new Blob([await readFile("first-frame.png")], {
                type: "image/png",
              }),
              "first-frame.png",
            );
            form.append(
              "last_frame",
              new Blob([await readFile("last-frame.jpg")], {
                type: "image/jpeg",
              }),
              "last-frame.jpg",
            );

            const response = await fetch("https://api.cometapi.com/v1/videos", {
              method: "POST",
              headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },
              body: form,
            });

            if (!response.ok) {
              throw new Error(await response.text());
            }

            console.log(await response.json());
        - lang: Shell
          label: Wan 3.0 first and last frame URLs
          source: |-
            curl https://api.cometapi.com/v1/videos \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -F 'model=wan3.0' \
              -F 'prompt=Move smoothly from the opening frame to the ending frame.' \
              -F 'seconds=5' \
              -F 'size=1280x720' \
              -F 'first_frame=https://your-image-host/first-frame.png' \
              -F 'last_frame=https://your-image-host/last-frame.jpg'
        - lang: Python
          label: Wan 3.0 first and last frame URLs
          source: |
            import os

            import requests

            fields = [
                ("model", (None, "wan3.0")),
                (
                    "prompt",
                    (None, "Move smoothly from the opening frame to the ending frame."),
                ),
                ("seconds", (None, "5")),
                ("size", (None, "1280x720")),
                ("first_frame", (None, "https://your-image-host/first-frame.png")),
                ("last_frame", (None, "https://your-image-host/last-frame.jpg")),
            ]

            response = requests.post(
                "https://api.cometapi.com/v1/videos",
                headers={
                    "Authorization": "Bearer " + os.environ["COMETAPI_KEY"]
                },
                files=fields,
                timeout=120,
            )

            response.raise_for_status()
            print(response.json())
        - lang: JavaScript
          label: Wan 3.0 first and last frame URLs
          source: >
            const form = new FormData();

            form.append("model", "wan3.0");

            form.append(
              "prompt",
              "Move smoothly from the opening frame to the ending frame.",
            );

            form.append("seconds", "5");

            form.append("size", "1280x720");

            form.append("first_frame",
            "https://your-image-host/first-frame.png");

            form.append("last_frame", "https://your-image-host/last-frame.jpg");


            const response = await fetch("https://api.cometapi.com/v1/videos", {
              method: "POST",
              headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },
              body: form,
            });


            if (!response.ok) {
              throw new Error(await response.text());
            }


            console.log(await response.json());
        - lang: Shell
          label: Wan 3.0 uploaded first and last frames
          source: |-
            curl https://api.cometapi.com/v1/videos \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -F 'model=wan3.0' \
              -F 'prompt=Move smoothly from the opening frame to the ending frame.' \
              -F 'seconds=5' \
              -F 'size=1280x720' \
              -F 'first_frame=@first-frame.png;type=image/png' \
              -F 'last_frame=@last-frame.jpg;type=image/jpeg'
        - lang: Python
          label: Wan 3.0 uploaded first and last frames
          source: |
            import os
            from contextlib import ExitStack

            import requests

            with ExitStack() as stack:
                fields = [
                    ("model", (None, "wan3.0")),
                    (
                        "prompt",
                        (None, "Move smoothly from the opening frame to the ending frame."),
                    ),
                    ("seconds", (None, "5")),
                    ("size", (None, "1280x720")),
                    (
                        "first_frame",
                        (
                            "first-frame.png",
                            stack.enter_context(open("first-frame.png", "rb")),
                            "image/png",
                        ),
                    ),
                    (
                        "last_frame",
                        (
                            "last-frame.jpg",
                            stack.enter_context(open("last-frame.jpg", "rb")),
                            "image/jpeg",
                        ),
                    ),
                ]

                response = requests.post(
                    "https://api.cometapi.com/v1/videos",
                    headers={
                        "Authorization": "Bearer " + os.environ["COMETAPI_KEY"]
                    },
                    files=fields,
                    timeout=120,
                )

            response.raise_for_status()
            print(response.json())
        - lang: JavaScript
          label: Wan 3.0 uploaded first and last frames
          source: |
            import { readFile } from "node:fs/promises";

            const form = new FormData();
            form.append("model", "wan3.0");
            form.append(
              "prompt",
              "Move smoothly from the opening frame to the ending frame.",
            );
            form.append("seconds", "5");
            form.append("size", "1280x720");
            form.append(
              "first_frame",
              new Blob([await readFile("first-frame.png")], {
                type: "image/png",
              }),
              "first-frame.png",
            );
            form.append(
              "last_frame",
              new Blob([await readFile("last-frame.jpg")], {
                type: "image/jpeg",
              }),
              "last-frame.jpg",
            );

            const response = await fetch("https://api.cometapi.com/v1/videos", {
              method: "POST",
              headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },
              body: form,
            });

            if (!response.ok) {
              throw new Error(await response.text());
            }

            console.log(await response.json());
components:
  schemas:
    WanCreateRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          description: >-
            Wan model ID: wan2.6, wan2.7, wan3.0, or wan3.0-prime. Use wan2.6
            for text or reference-video input. Use wan2.7 for text, image/video
            references, or frame inputs. Use wan3.0 or wan3.0-prime to also
            include reference audio.
          example: wan3.0
        prompt:
          type: string
          description: >-
            Text prompt that describes the video to generate. Describe the
            appearance and motion to preserve from references, or the transition
            between first_frame and last_frame. For wan2.6 video references, use
            @Video1, @Video2, and @Video3 in input order.
          example: >-
            A small robot walks through a bright greenhouse with smooth camera
            movement.
        seconds:
          type: integer
          minimum: 2
          maximum: 30
          description: >-
            Requested output duration in whole seconds. Send an explicit
            integer. For wan2.6 reference-to-video, use 5 or 10; text-to-video
            also accepts 15. For wan2.7 reference-to-video, use 2 through 10;
            text and frame inputs accept 2 through 15. For wan3.0 and
            wan3.0-prime, use 2 through 30. Default is 5.
          example: 5
        size:
          type: string
          description: >-
            Supported WxH size values. For wan3.0 and wan3.0-prime: 832x480,
            480x832, 624x624, 640x480, 480x640, 1280x720, 720x1280, 960x960,
            1088x832, 832x1088, 1920x1080, 1080x1920, 1440x1440, 1632x1248,
            1248x1632. For wan2.6: 1280x720, 720x1280, 1088x832, 832x1088,
            1920x1080, 1080x1920, 1440x1440, 1632x1248, 1248x1632. For wan2.7:
            1280x720, 720x1280, 1920x1080, 1080x1920, 1440x1440. Default is
            1920x1080. For Wan 2.7 frame inputs, the opening image determines
            the aspect ratio; size selects the output resolution tier.
          example: 1920x1080
        input_reference:
          description: >-
            PNG or JPEG reference images for wan2.7, wan3.0, and wan3.0-prime.
            Repeat input_reference with one publicly accessible HTTPS image URL
            or uploaded image file per field. Use all URLs or all files within
            this field. Do not combine URLs into a comma-separated value. A
            single URL or file uses the image-to-video workflow. Each image can
            be up to 20 MB. For wan3.0 and wan3.0-prime, send at most 10
            reference images, whether you use URLs or uploaded files. Image and
            video references can share a request; reference audio requires
            wan3.0 or wan3.0-prime. Submit frame inputs separately. Omit for
            text-to-video and wan2.6 reference-to-video. Submit images in the
            order you want to reference them in the prompt.
          anyOf:
            - title: Single image URL
              type: string
              format: uri
              pattern: ^https://
              description: One publicly accessible HTTPS image URL.
            - title: Image URLs
              type: array
              minItems: 1
              items:
                type: string
                format: uri
                pattern: ^https://
                description: One publicly accessible HTTPS reference image URL.
            - title: Image files
              type: array
              minItems: 1
              items:
                type: string
                format: binary
                description: One uploaded reference image file.
        reference_videos:
          type: array
          minItems: 1
          items:
            anyOf:
              - type: string
                format: uri
                pattern: ^https://
              - type: string
                format: binary
          description: >-
            Reference videos for wan2.6, wan2.7, wan3.0, and wan3.0-prime.
            Repeat reference_videos with publicly accessible HTTPS URLs or
            uploaded MP4 files with H.264 video. Use one input type within this
            field: all URLs or all files. For wan2.6, send 1 to 3 clips, each 2
            to 30 seconds and up to 30 MB, with at least 16 fps; omit image,
            audio, and frame fields. For wan2.7, combine video references with
            image references. For wan3.0 and wan3.0-prime, send at most 5 clips
            totaling at most 15 seconds, with at least 16 fps. Video uploads are
            limited to 5 files, each at most 50 MiB (50 x 1024 x 1024 bytes);
            the lower wan2.6 limits still apply. Submit frame inputs separately.
        reference_audios:
          type: array
          minItems: 1
          items:
            anyOf:
              - type: string
                format: uri
                pattern: ^https://
              - type: string
                format: binary
          description: >-
            Reference audio for wan3.0 and wan3.0-prime, combined with image or
            video references. Repeat reference_audios with publicly accessible
            HTTPS MP3 URLs or uploaded MP3 files. Use one input type within this
            field: all URLs or all files. Send at most 5 audio references
            totaling at most 15 seconds, counted separately from reference video
            duration. Audio uploads are limited to 5 files, each at most 15 MiB
            (15 x 1024 x 1024 bytes). Submit frame inputs separately. Omit for
            wan2.6 and wan2.7.
        first_frame:
          anyOf:
            - type: string
              format: uri
              pattern: ^https://
            - type: string
              format: binary
          description: >-
            Opening frame for wan2.7, wan3.0, and wan3.0-prime, as one publicly
            accessible HTTPS PNG or JPEG URL or one uploaded PNG or JPEG file.
            Use first_frame alone or add last_frame to guide the ending. Submit
            frame inputs in a separate request from input_reference,
            reference_videos, and reference_audios. Omit for wan2.6. For Wan 2.7
            frame inputs, the opening image determines the aspect ratio; size
            selects the output resolution tier.
        last_frame:
          anyOf:
            - type: string
              format: uri
              pattern: ^https://
            - type: string
              format: binary
          description: >-
            Ending frame for wan2.7, wan3.0, and wan3.0-prime, as one publicly
            accessible HTTPS PNG or JPEG URL or one uploaded PNG or JPEG file.
            Use with first_frame to guide the ending. Submit frame inputs in a
            separate request from input_reference, reference_videos, and
            reference_audios. Omit for wan2.6. For Wan 2.7 frame inputs, the
            opening image determines the aspect ratio; size selects the output
            resolution tier.
      additionalProperties: false
    WanVideoTask:
      type: object
      required:
        - id
        - object
        - model
        - status
        - progress
        - created_at
      properties:
        id:
          type: string
          description: Task ID. Use this value with retrieve and content endpoints.
          example: task_example
        task_id:
          type: string
          description: Compatibility alias for id when present.
          example: task_example
        object:
          type: string
          description: Object type. Video tasks return video.
          example: video
        model:
          type: string
          description: Model ID used for the task.
          example: wan3.0
        status:
          type: string
          description: >-
            Task lifecycle status. Poll until the value is completed, failed, or
            error.
          enum:
            - queued
            - in_progress
            - completed
            - failed
            - error
          example: queued
        progress:
          type: integer
          minimum: 0
          maximum: 100
          description: Task progress as a coarse percentage.
          example: 0
        created_at:
          type: integer
          description: Task creation time as a Unix timestamp in seconds.
          example: 1779938152
        completed_at:
          type: integer
          description: >-
            Task completion time as a Unix timestamp in seconds. This field
            appears on completed tasks.
          example: 1779938219
        video_url:
          type: string
          description: Temporary video delivery URL. This field appears on completed tasks.
          example: <temporary-video-url>
        error:
          type: object
          description: Failure details. This field appears when the task fails.
          additionalProperties: true
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer authentication. Use your CometAPI API key.

````