> ## 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 Video Continuation

> Submit an asynchronous Ali `wan2.7-i2v` video continuation task.

Use `first_clip` to specify the initial video segment, optionally paired with `last_frame` for an end frame reference.

Supported `media` combinations:
- `first_clip`
- `first_clip + last_frame`

The `prompt` field is optional for this capability. `size` only supports `720P` and `1080P`. `seconds` only supports integer strings from `2` to `15`. Also supports official fields `negative_prompt`, `prompt_extend`, `watermark`, and `seed`.



## OpenAPI

````yaml api-reference/en/zmodelVideo/ali/wan2.7-i2v-video-continuation.json POST /v1/videos
openapi: 3.0.1
info:
  title: Wan 2.7 Video Continuation
  version: 1.0.0
  description: >-
    Ali `wan2.7-i2v` video continuation capability documentation. The unified
    API endpoint is `/v1/videos`.


    This document covers the video continuation scenario and uses the top-level
    `media` array to express the upstream provider's new `input.media` protocol.


    Supported `media.type` values for this scenario are `first_clip` and
    `last_frame`.


    Supported `media` combinations:

    - `first_clip`

    - `first_clip + last_frame`


    The `prompt` field is optional for this capability. `size` only supports
    `720P` and `1080P`. `seconds` only supports integer strings from `2` to
    `15`. Also supports official fields `negative_prompt`, `prompt_extend`,
    `watermark`, and `seed`.
  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 video continuation capability
paths:
  /v1/videos:
    post:
      tags:
        - Wan 2.7 Video
      summary: Create Wan 2.7 Video Continuation task
      description: >-
        Submit an asynchronous Ali `wan2.7-i2v` video continuation task.


        Use `first_clip` to specify the initial video segment, optionally paired
        with `last_frame` for an end frame reference.


        Supported `media` combinations:

        - `first_clip`

        - `first_clip + last_frame`


        The `prompt` field is optional for this capability. `size` only supports
        `720P` and `1080P`. `seconds` only supports integer strings from `2` to
        `15`. Also supports official fields `negative_prompt`, `prompt_extend`,
        `watermark`, and `seed`.
      operationId: aliWan27I2VVideoContinuation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Wan27VideoContinuationRequest'
            examples:
              first_clip_only:
                summary: First clip only
                value:
                  model: wan2.7-i2v
                  prompt: >-
                    The character continues walking naturally forward,
                    maintaining the same style as the input clip.
                  media:
                    - type: first_clip
                      url: https://example.com/assets/input.mp4
                  seconds: '5'
                  size: 1080P
              first_clip_with_last_frame:
                summary: First clip + last frame
                value:
                  model: wan2.7-i2v
                  prompt: >-
                    The character transitions naturally from walking to a
                    standing pose.
                  media:
                    - type: first_clip
                      url: https://example.com/assets/input.mp4
                    - type: last_frame
                      url: https://example.com/assets/end-pose.png
                  seconds: '5'
                  size: 1080P
      responses:
        '200':
          description: >-
            Submitted successfully. Returns an OpenAI-compatible video task
            object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskResponse'
        '400':
          description: >-
            Invalid request parameters, e.g. unsupported `media` combination, or
            `size` / `seconds` out of supported range.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_request:
                  summary: Invalid request
                  value:
                    error:
                      message: unsupported wan2.7-i2v media combination
                      type: invalid_request_error
                      code: invalid_request
        '401':
          description: Authentication failed.
          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:
    Wan27VideoContinuationRequest:
      type: object
      required:
        - model
        - media
      properties:
        model:
          type: string
          enum:
            - wan2.7-i2v
          description: 'Model name. Available value: `wan2.7-i2v`.'
        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.
        size:
          type: string
          enum:
            - 720P
            - 1080P
          description: >-
            Specifies the output resolution tier for controlling video clarity
            (total pixels).


            The model automatically scales to a similar total pixel count based
            on the selected resolution tier. The video aspect ratio will attempt
            to stay consistent with the input material (first frame or first
            clip).
          default: 1080P
        seconds:
          type: string
          description: >-
            Video duration as a string. Supports integer strings from `2` to
            `15`.
          default: '5'
          enum:
            - '2'
            - '3'
            - '4'
            - '5'
            - '6'
            - '7'
            - '8'
            - '9'
            - '10'
            - '11'
            - '12'
            - '13'
            - '14'
            - '15'
        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`.
        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.
        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
          minimum: 0
          maximum: 2147483647
          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.
        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 clip only**: `first_clip`

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


            Each `type` can appear at most once in the array.
          items:
            $ref: '#/components/schemas/Wan27MediaInput'
    VideoTaskResponse:
      type: object
      properties:
        id:
          type: string
          description: Public task ID.
        task_id:
          type: string
          description: Backward-compatible alias for the public task ID.
        object:
          type: string
          example: video
        model:
          type: string
          description: Model name.
        status:
          type: string
          enum:
            - queued
            - in_progress
            - completed
            - failed
            - unknown
          description: Unified video task status.
        progress:
          type: integer
          description: Task progress percentage.
        created_at:
          type: integer
          format: int64
          description: Creation time as a Unix timestamp (seconds).
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type: string
    Wan27MediaInput:
      type: object
      required:
        - type
        - url
      properties:
        type:
          type: string
          enum:
            - first_clip
            - last_frame
          description: >-
            Media asset type.

            - `first_clip`: First video clip.

            - `last_frame`: Last frame image.


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


            **Video** (type=`first_clip`)


            Video file URL. The model generates continuation content based on
            this video. The upper limit of the continuation duration is
            controlled by the `duration` parameter.


            For example: when `duration=15` and the input video is 3 seconds,
            the model generates 12 seconds of continuation, the final output
            video has a total duration of 15 seconds, and is billed for 15
            seconds.


            Video restrictions:


            - Formats: MP4, MOV.

            - Duration: 2~10s.

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

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

            - File size: up to 100MB.


            Supported input formats:


            Public URL:


            Supports HTTP and HTTPS protocols.


            Example: `https://xxx/xxx.mp4`.


            Temporary URL:


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


            Example: `oss://dashscope-instant/xxx/xxx.mp4`.


            **Image** (type=`last_frame`): Last frame URL, or Base64 encoded
            data.


            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: API Key
      description: 'Pass `Authorization: Bearer <token>` in the request header.'

````