> ## 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 Reference to Video

> Submit an asynchronous Ali `wan2.7-r2v` reference-to-video task. Specify reference images, reference videos, or first frame images via `input.media`, optionally paired with `reference_voice` for voice reference.

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-r2v.json POST /ali/api/v1/services/aigc/video-generation/video-synthesis
openapi: 3.0.1
info:
  title: Wan 2.7 Reference to Video
  version: 1.0.0
  description: >-
    Aliyun Wan `wan2.7-r2v` reference-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-r2v reference-to-video capability
paths:
  /ali/api/v1/services/aigc/video-generation/video-synthesis:
    post:
      tags:
        - Wan 2.7 Video
      summary: Create wan2.7-r2v reference-to-video task
      description: >-
        Submit an asynchronous Ali `wan2.7-r2v` reference-to-video task. Specify
        reference images, reference videos, or first frame images via
        `input.media`, optionally paired with `reference_voice` for voice
        reference.


        After submitting a task, query its status via `GET
        /ali/api/v1/tasks/{task_id}`.
      operationId: aliWan27R2VCreate
      parameters:
        - name: Content-Type
          in: header
          required: true
          schema:
            type: string
          description: >-
            Request content type. This parameter must be set to
            application/json.
        - name: X-DashScope-Async
          in: header
          required: true
          schema:
            type: string
          description: >-
            Asynchronous processing configuration parameter. HTTP requests only
            support async mode and must be set to enable.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Wan27R2VRequest'
            examples:
              multi_reference:
                summary: Multi-subject reference (image + video + voice)
                value:
                  model: wan2.7-r2v
                  input:
                    prompt: >-
                      Video 1 holds Image 3, playing a soothing country folk
                      song on the chair in Image 4, and says: "The sun is so
                      nice today." Image 1 holds Image 2, walks past Video 1,
                      places Image 2 on the table next to Video 1, and says:
                      "That sounds great, can you sing it again?"
                    media:
                      - type: reference_image
                        url: >-
                          https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/en-US/20260408/sjuytr/wan-r2v-object-girl.jpg
                        reference_voice: >-
                          https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/en-US/20260408/gbqewz/wan-r2v-girl-voice.mp3
                      - type: reference_video
                        url: >-
                          https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/en-US/20260129/qigswt/wan-r2v-role2.mp4
                        reference_voice: >-
                          https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/en-US/20260408/isllrq/wan-r2v-boy-voice.mp3
                      - type: reference_image
                        url: >-
                          https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/en-US/20260129/rtjeqf/wan-r2v-object3.png
                      - type: reference_image
                        url: >-
                          https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/en-US/20260129/qpzxps/wan-r2v-object4.png
                      - type: reference_image
                        url: >-
                          https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/en-US/20260129/wfjikw/wan-r2v-backgroud5.png
                  parameters:
                    resolution: 720P
                    ratio: '16:9'
                    duration: 10
                    prompt_extend: false
                    watermark: true
              single_image_storyboard:
                summary: Single image reference (multi-panel storyboard)
                value:
                  model: wan2.7-r2v-2026-06-12
                  input:
                    prompt: >-
                      Reference image, 3D cartoon adventure movie style,
                      Q-version characters with fine textures, smooth motion,
                      vibrant colors, keep characters consistent with the forest
                      scene, no text. Atmosphere: adventure, lighthearted,
                      mysterious, childlike. Characters: Little boy explorer -
                      round hat, backpack, short cloak. Companion: flying little
                      robot, round body, blue glowing eyes. Scene: fantasy
                      forest, giant tree roots, mushrooms, vines, treasure cave
                      entrance, sunbeams. Storyboard: 1. Wide shot: tall trees
                      and light beams crisscross in the fantasy forest,
                      mysterious and bright. 2. Medium shot: the little boy
                      pushes aside vines to explore. 3. Medium shot: the little
                      robot flies beside him, scanning ahead with blue light. 4.
                      Close-up: an old treasure map unfolds in the boy's hands.
                      5. Medium close-up: he shows an excited expression, eyes
                      lighting up. 6. Action shot: they jump over tree roots and
                      a stream, venturing deeper into the forest. 7. Medium
                      shot: a moss-covered treasure chest is revealed behind the
                      vines. 8. Close-up: golden light shines from the edge of
                      the chest. 9. Closing shot: the boy and the little robot
                      stand in surprise before the chest, full of adventure.
                    media:
                      - type: reference_image
                        url: >-
                          https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/en-US/20260403/wgjaxy/banana_storyboard_00000020.png
                  parameters:
                    resolution: 720P
                    duration: 10
                    prompt_extend: false
                    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:
    Wan27R2VRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          enum:
            - wan2.7-r2v
          description: 'Model name. Available value: `wan2.7-r2v`.'
        input:
          $ref: '#/components/schemas/Wan27R2VInput'
        parameters:
          $ref: '#/components/schemas/Wan27R2VParameters'
    VideoTaskResponse:
      type: object
      properties:
        output:
          type: object
          properties:
            task_id:
              type: string
              description: Task ID. Valid for querying within 24 hours.
            task_status:
              type: string
              description: |-
                Task status.

                Enum values

                PENDING: Task queued

                RUNNING: Task processing

                SUCCEEDED: Task completed successfully

                FAILED: Task failed

                CANCELED: Task canceled

                UNKNOWN: Task does not exist or status 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. See error codes
            for details.
        message:
          type: string
          description: >-
            Error message. Only returned when the request fails. See error codes
            for details.
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code.
        message:
          type: string
          description: Error message.
        request_id:
          type: string
          description: Request ID.
    Wan27R2VInput:
      type: object
      required:
        - prompt
        - media
      properties:
        prompt:
          type: string
          description: >-
            Text prompt describing the desired video content and visual
            characteristics. Supports Chinese and English; each character,
            letter, or punctuation mark counts as one character. Excess
            characters are automatically truncated.


            - `wan2.7-r2v`: up to 5000 characters.


            **Reference naming conventions:**

            - For Chinese prompts, reference images with markers like "图1", "图2"
            and reference videos with markers like "视频1", "视频2".

            - For English prompts, use markers like "Image 1", "Video 1"
            (capitalized first letter, space between letter and number).

            - The order matches the `media` array order. Images and videos are
            counted separately, e.g. "图1" and "视频1" can exist simultaneously.

            - If only one reference image or video is provided, you can simply
            use "参考图片" (reference image) or "参考视频" (reference video).


            **Scene description examples:**

            - Direct reference: "图1在图2里玩耍" (Image 1 is playing in Image 2).

            - Combined description: "图1的猫在图2的房间里玩耍" (The cat from Image 1 plays
            in the room from Image 2).


            **Multi-panel/storyboard images:**

            When the reference image is a multi-panel (storyboard) image,
            describe the content in a multi-shot narrative format. You do not
            need to describe every panel; provide key shot content and the model
            will automatically identify the panel logic and intelligently fill
            in the details. For best results, it is recommended to provide only
            one multi-panel image per request.
          maxLength: 5000
        negative_prompt:
          type: string
          description: >-
            Negative prompt describing content you do not want to see in the
            video. Limits unwanted visual elements. Supports Chinese and
            English, up to 500 characters. Excess characters are automatically
            truncated.


            Example: low resolution, error, worst quality, low quality,
            deformed, extra fingers, bad proportions, etc.
          maxLength: 500
        media:
          type: array
          description: >-
            Array of media assets, including images, videos, and audio. Supports
            image/video input as visual reference, and images can provide
            multi-view references for characters, props, scenes, etc.


            Each element in the array is a media object containing `type` and
            `url` fields.


            The order in the array defines the reference mapping order in the
            prompt. Images and videos are counted separately, so "图1" (Image 1)
            and "视频1" (Video 1) can exist simultaneously.

            - The 1st `reference_video` in the array corresponds to "视频1", the
            2nd to "视频2", etc.

            - The 1st `reference_image` in the array corresponds to "图1", the
            2nd to "图2", etc.
          items:
            $ref: '#/components/schemas/Wan27R2VMedia'
    Wan27R2VParameters:
      type: object
      properties:
        resolution:
          type: string
          enum:
            - 720P
            - 1080P
          description: >-
            Important: `resolution` directly affects cost. Confirm the model
            pricing before calling.


            Output video resolution tier, controlling video clarity (total
            pixels).


            `wan2.7-r2v`: available values `720P`, `1080P`. Default: `1080P`.
          default: 1080P
        ratio:
          type: string
          enum:
            - '16:9'
            - '9:16'
            - '1:1'
            - '4:3'
            - '3:4'
          description: >-
            Video aspect ratio.


            **Behavior logic:**

            - If no first frame image is provided: generates video at the
            specified `ratio`.

            - If a first frame image is provided: the `ratio` parameter is
            ignored and the video is generated at an approximate ratio matching
            the first frame image's aspect ratio.


            Available values and corresponding output resolutions:


            **720P:**

            - `16:9` → 1280×720

            - `9:16` → 720×1280

            - `1:1` → 960×960

            - `4:3` → 1104×832

            - `3:4` → 832×1104


            **1080P:**

            - `16:9` → 1920×1080

            - `9:16` → 1080×1920

            - `1:1` → 1440×1440

            - `4:3` → 1648×1248

            - `3:4` → 1248×1648
          default: '16:9'
        duration:
          type: integer
          description: >-
            Important: `duration` directly affects cost. Confirm the model
            pricing before calling.


            Video duration in seconds.


            - `wan2.7-r2v`: default 5.

            - When reference assets include a video: range [2, 10].

            - When reference assets do not include a video: range [2, 15].
          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 for better results.
            Particularly effective for short prompts, but increases processing
            time.

            - `true` (default): enable intelligent rewriting.

            - `false`: disable intelligent rewriting.
          default: true
        watermark:
          type: boolean
          description: >-
            Whether to add a watermark to the video. 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]. If not specified, the system
            automatically generates a random seed. To improve reproducibility of
            generation results, it is recommended to fix the seed value.


            Note: Due to the probabilistic nature of model generation, the same
            seed does not guarantee identical results every time.
          minimum: 0
          maximum: 2147483647
    Wan27R2VMedia:
      type: object
      required:
        - type
        - url
      properties:
        type:
          type: string
          description: >-
            type string (required)


            Media asset type. Available values:


            reference_image: Reference image. Provides subject
            (person/animal/object) and scene reference.


            reference_video: Reference video. Provides subject
            (person/animal/object) and voice reference. B-roll/empty scene
            videos are not recommended.


            first_frame: First frame image. Generates video based on the first
            frame, typically containing the subject (person/animal/object).
            Supports combined use with subject reference for consistency, or
            voice reference.


            First frame: already contains the subject to reference; you can pair
            it with subject reference for enhanced consistency, or use voice
            reference.


            First frame: does not yet contain the subject to reference; you can
            use subject reference to define the characteristics of the new
            subject appearing during the video.


            Material constraints:


            First frame image: max 1.


            At least 1 reference image or reference video must be provided.
            Total reference images + reference videos ≤ 5.


            When a reference asset contains a subject character, it should
            contain only a single character.
        url:
          type: string
          description: >-
            Media asset URL. Each value points to an image or video.


            **For reference image (`type=reference_image`):**

            Reference image URL or Base64 encoded data. The reference image can
            be a subject (person/animal/object) or a background. When it
            contains a subject, it should include only one character.


            Image constraints:

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

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

            - Aspect ratio: 1:8 to 8:1.

            - File size: up to 20MB.


            Supported input formats:

            - Public URL: HTTP or HTTPS, e.g. `https://xxx/xxx.png`.

            - Temporary URL (OSS): `oss://dashscope-instant/xxx/xxx.png` (must
            be obtained by uploading the file).

            - Base64 encoded string: `data:{MIME_type};base64,{base64_data}`,
            e.g. `data:image/png;base64,...`.


            **For reference video (`type=reference_video`):**

            Reference video URL. The video should contain a subject
            (person/animal/object). B-roll or empty scene videos are not
            recommended. When it contains a subject, it should include only one
            character. If the video has audio, the voice can also be referenced.


            Video constraints:

            - Formats: mp4, mov.

            - Duration: 1 to 30 seconds.

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

            - Aspect ratio: 1:8 to 8:1.

            - File size: up to 100MB.


            Supported input formats:

            - Public URL: HTTP or HTTPS, e.g. `https://xxx/xxx.mp4`.

            - Temporary URL (OSS): `oss://dashscope-instant/xxx/xxx.mp4` (must
            be obtained by uploading the file).
        reference_voice:
          type: string
          description: >-
            Audio URL for voice reference. Used to specify the voice of the
            subject character in the reference asset (image/video). Used
            together with `reference_image` or `reference_video`. The audio is
            only used for voice timbre reference, unrelated to the speech
            content. It is recommended to match the language of the reference
            audio with the prompt language for better results.


            **Voice activation logic:**

            - Default behavior: If the `reference_video` contains audio and no
            `reference_voice` is specified, the original video audio is used by
            default.

            - Priority: If both `reference_video` (with audio) and
            `reference_voice` are provided, `reference_voice` takes priority and
            overrides the video's original audio.


            Audio constraints:

            - Formats: wav, mp3.

            - Duration: 1 to 10 seconds.

            - File size: up to 15MB.


            Supported input formats:

            - Public URL: HTTP or HTTPS, e.g. `https://xxx/xxx.mp3`.

            - Temporary URL (OSS): `oss://dashscope-instant/xxx/xxx.mp3` (must
            be obtained by uploading the file).
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Pass `Authorization: Bearer <token>` in the request header.'

````