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

# Wan 2.7 Image to Video

> Submit an asynchronous Ali `wan2.7-i2v` image-to-video task. Specify the first frame image, last frame image, driving audio, or first video clip via `input.media`.

After submitting a task, query its status via `GET /ali/api/v1/tasks/{task_id}`.



## OpenAPI

````yaml api-reference/en/zmodelVideo/ali/api/wan2.7-i2v.json POST /ali/api/v1/services/aigc/video-generation/video-synthesis
openapi: 3.0.1
info:
  title: Wan 2.7 Image to Video
  version: 1.0.0
  description: >-
    Aliyun Wan `wan2.7-i2v` image-to-video capability documentation. The unified
    API endpoint is
    `/ali/api/v1/services/aigc/video-generation/video-synthesis`, used to create
    asynchronous video generation tasks.
  license:
    name: Project License
    url: https://github.com/QuantumNous/new-api/blob/main/LICENSE
servers:
  - url: https://api.powertokens.ai
    description: Baze API server endpoint
security: []
tags:
  - name: Wan 2.7 Video
    description: Ali wan2.7-i2v image-to-video capability
paths:
  /ali/api/v1/services/aigc/video-generation/video-synthesis:
    post:
      tags:
        - Wan 2.7 Video
      summary: Create wan2.7-i2v image-to-video task
      description: >-
        Submit an asynchronous Ali `wan2.7-i2v` image-to-video task. Specify the
        first frame image, last frame image, driving audio, or first video clip
        via `input.media`.


        After submitting a task, query its status via `GET
        /ali/api/v1/tasks/{task_id}`.
      operationId: aliWan27I2VCreate
      parameters:
        - name: Content-Type
          in: header
          required: true
          description: >-
            Request content type. This parameter must be set to
            application/json.
          schema:
            type: string
            enum:
              - application/json
        - name: X-DashScope-Async
          in: header
          required: true
          description: >-
            Async processing configuration parameter. HTTP requests only support
            async mode and must be set to enable.
          schema:
            type: string
            enum:
              - enable
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Wan27I2VRequest'
            examples:
              first_frame_with_audio:
                summary: First frame + driving audio
                value:
                  model: wan2.7-i2v-2026-04-25
                  input:
                    prompt: >-
                      一幅都市奇幻艺术的场景。一个充满动感的涂鸦艺术角色。一个由喷漆所画成的少年，正从一面混凝土墙上活过来。他一边用极快的语速演唱一首英文rap，一边摆着一个经典的、充满活力的说唱歌手姿势。场景设定在夜晚一个充满都市感的铁路桥下。灯光来自一盏孤零零的街灯，营造出电影般的氛围，充满高能量和惊人的细节。视频的音频部分完全由rap构成，没有其他对话或杂音。
                    media:
                      - type: first_frame
                        url: >-
                          https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png
                      - type: driving_audio
                        url: >-
                          https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3
                  parameters:
                    resolution: 720P
                    duration: 10
                    prompt_extend: true
                    watermark: true
              first_last_frame:
                summary: First + last frame
                value:
                  model: wan2.7-i2v-2026-04-25
                  input:
                    prompt: 写实风格,一只小黑猫好奇地仰望天空,镜头从平视角度逐渐升高,最后以俯视角度捕捉到它好奇的眼神。
                    media:
                      - type: first_frame
                        url: >-
                          https://wanx.alicdn.com/material/20250318/first_frame.png
                      - type: last_frame
                        url: >-
                          https://wanx.alicdn.com/material/20250318/last_frame.png
                  parameters:
                    resolution: 720P
                    duration: 10
                    prompt_extend: false
                    watermark: true
              video_continuation:
                summary: Video continuation
                value:
                  model: wan2.7-i2v-2026-04-25
                  input:
                    prompt: 一个女孩对镜自拍，自拍结束后背着书包出门
                    media:
                      - type: first_clip
                        url: >-
                          https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/hfugmr/wan-r2v-role1.mp4
                  parameters:
                    resolution: 720P
                    duration: 10
                    prompt_extend: true
                    watermark: true
      responses:
        '200':
          description: Submitted successfully. Returns a video task object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskResponse'
              example:
                output:
                  task_status: PENDING
                  task_id: 0385dc79-5ff8-4d82-bcb6-xxxxxx
                request_id: 4909100c-7b5a-9f92-bfe5-xxxxxx
        '400':
          description: Invalid request parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication failed, e.g. missing or invalid token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit triggered or insufficient account quota.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: An internal error occurred while processing the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    Wan27I2VRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          enum:
            - wan2.7-i2v
          description: 'Model name. Available value: `wan2.7-i2v`.'
        input:
          $ref: '#/components/schemas/Wan27I2VInput'
        parameters:
          $ref: '#/components/schemas/Wan27I2VParameters'
    VideoTaskResponse:
      type: object
      properties:
        output:
          type: object
          properties:
            task_id:
              type: string
              description: Task ID. Valid for 24 hours for querying.
            task_status:
              type: string
              description: |-
                Task status.

                **Enum values:**
                - `PENDING`: Task is queued
                - `RUNNING`: Task is processing
                - `SUCCEEDED`: Task completed successfully
                - `FAILED`: Task execution failed
                - `CANCELED`: Task has been canceled
                - `UNKNOWN`: Task does not exist or status is unknown
        request_id:
          type: string
          description: >-
            Unique request ID. Can be used for request tracing and issue
            diagnosis.
        code:
          type: string
          description: Error code. Only returned when the request fails.
        message:
          type: string
          description: Error message. Only returned when the request fails.
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code.
        message:
          type: string
          description: Error message.
        request_id:
          type: string
          description: Request ID.
    Wan27I2VInput:
      type: object
      required:
        - media
      properties:
        prompt:
          type: string
          description: >-
            Text prompt describing the desired video content and visual
            characteristics. Supports Chinese and English, up to 5000 characters
            (each character or letter counts as one). Excess characters will be
            automatically truncated.
          maxLength: 5000
        negative_prompt:
          type: string
          description: >-
            Negative prompt describing content you do not want in the video.
            Supports Chinese and English, up to 500 characters. Excess
            characters will be automatically truncated. Example: `low
            resolution, worst quality, deformed, extra fingers, bad
            proportions`.
          maxLength: 500
        media:
          type: array
          description: >-
            List of media assets (images, audio, video) for video generation.
            Each element is a media object with `type` and `url`.


            Supported combinations (invalid combinations will return an error):

            - **First frame only**: `first_frame`

            - **First frame + audio**: `first_frame` + `driving_audio`

            - **First + last frame**: `first_frame` + `last_frame`

            - **First + last frame + audio**: `first_frame` + `last_frame` +
            `driving_audio`

            - **First clip continuation**: `first_clip`

            - **First clip + last frame continuation**: `first_clip` +
            `last_frame`


            Each `type` can appear at most once in the array.
          items:
            $ref: '#/components/schemas/Wan27I2VMedia'
    Wan27I2VParameters:
      type: object
      properties:
        resolution:
          type: string
          enum:
            - 720P
            - 1080P
          description: >-
            Important: `resolution` directly affects cost. Confirm the model
            pricing before calling.


            Specifies the output video resolution tier, controlling video
            clarity (total pixels). The model auto-scales to a similar total
            pixel count based on the selected tier. The video aspect ratio will
            match the input material (first frame or first clip) as closely as
            possible.


            Available values:

            - `720P`

            - `1080P` (default)
          default: 1080P
        duration:
          type: integer
          description: >-
            Important: `duration` directly affects cost, billed per second.
            Confirm the model pricing before calling.


            Video duration in seconds. Range [2, 15]. Default 5.
          minimum: 2
          maximum: 15
          default: 5
        prompt_extend:
          type: boolean
          description: >-
            Whether to enable intelligent prompt rewriting. When enabled, a
            large language model rewrites the input prompt intelligently,
            significantly improving results for short prompts but increasing
            processing time. `true` (default): enable. `false`: disable.
          default: true
        watermark:
          type: boolean
          description: >-
            Whether to add a watermark. The watermark is positioned at the
            bottom-right corner with the text 'AI生成'. `false` (default): no
            watermark. `true`: add watermark.
          default: false
        seed:
          type: integer
          description: >-
            Random seed, range [0, 2147483647]. When unspecified, the system
            auto-generates a random seed. For better reproducibility, set a
            fixed seed. Note: due to the probabilistic nature of model
            generation, the same seed does not guarantee identical results every
            time.
          minimum: 0
          maximum: 2147483647
    Wan27I2VMedia:
      type: object
      required:
        - type
        - url
      properties:
        type:
          type: string
          enum:
            - first_frame
            - last_frame
            - driving_audio
            - first_clip
          description: >-
            Media asset type.

            - `first_frame`: First frame image.

            - `last_frame`: Last frame image.

            - `driving_audio`: Driving audio.

            - `first_clip`: First video clip.


            Each type can appear at most once per request (e.g. cannot include
            two `first_frame` entries).
        url:
          type: string
          description: >-
            Media asset URL. Supports images, audio, and video.


            **Image** (type=`first_frame` or `last_frame`): First frame or last
            frame URL, or Base64 encoded data. Currently supports generating
            videos from the first frame or from the first and last frames.


            Image restrictions:

            - Formats: JPEG, JPG, PNG (no alpha channel), BMP, WEBP.

            - Resolution: width and height range [240, 8000] pixels.

            - Aspect ratio: 1:8 ~ 8:1.

            - File size: up to 20MB.


            Supported input formats:


            Public URL:


            Supports HTTP or HTTPS protocols.


            Example: https://xxx/xxx.png.


            Temporary URL:


            Supports OSS protocol. Must obtain the temporary URL via file
            upload.


            Example: oss://dashscope-instant/xxx/xxx.png.


            Base64 encoded image string:


            Data format: data:{MIME_type};base64,{base64_data}.


            Example: data:image/png;base64,GDU7MtCZzEbTbmRZ...... (truncated for
            demonstration).


            Base64 encoded data format


            Format: data:{MIME_type};base64,{base64_data}.


            {base64_data}: The Base64 encoded string of the image file.


            {MIME_type}: The media type of the image, corresponding to the file
            format.


            Image format to MIME Type mapping:


            | Image Format | MIME Type |

            | --- | --- |

            | JPEG | image/jpeg |

            | JPG | image/jpeg |

            | PNG | image/png |

            | BMP | image/bmp |

            | WEBP | image/webp |
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Pass `Authorization: Bearer <token>` in the request header.'

````