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

# wan2.7-r2v

> Submit at least one reference image or video. Reference images and videos together must not exceed five; an optional first frame can be added separately.



## OpenAPI

````yaml api-reference/model-api/alibaba/openapi/wan2.7-r2v/openapi.yaml POST /v1/video/generations
openapi: 3.1.0
info:
  title: Wan2.7 R2V
  description: >-
    Generate consistent video from reference images, videos, voices, and an
    optional first frame.
  version: 1.0.0
servers:
  - url: https://www.anyfast.ai
security:
  - bearerAuth: []
paths:
  /v1/video/generations:
    post:
      summary: Create a Wan2.7 reference-to-video task
      description: >-
        Submit at least one reference image or video. Reference images and
        videos together must not exceed five; an optional first frame can be
        added separately.
      operationId: createWan27R2v
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              properties:
                model:
                  type: string
                  enum:
                    - wan2.7-r2v
                input:
                  type: object
                  required:
                    - prompt
                    - media
                  properties:
                    prompt:
                      type: string
                      maxLength: 5000
                      description: >-
                        Refer to assets as Image 1, Image 2, Video 1, and Video
                        2.
                    negative_prompt:
                      type: string
                      maxLength: 500
                    media:
                      type: array
                      minItems: 1
                      maxItems: 6
                      items:
                        $ref: '#/components/schemas/Media'
                parameters:
                  $ref: '#/components/schemas/GenerationParameters'
              example:
                model: wan2.7-r2v
                input:
                  prompt: >-
                    The character from Image 1 walks through the street from
                    Video 1.
                  media:
                    - type: reference_image
                      url: https://example.com/character.png
                    - type: reference_video
                      url: https://example.com/street.mp4
                parameters:
                  resolution: 720P
                  ratio: '16:9'
                  duration: 5
                  prompt_extend: true
                  watermark: false
      responses:
        '200':
          description: Task created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskCreated'
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
        '429':
          description: Rate limit exceeded
components:
  schemas:
    Media:
      type: object
      required:
        - type
        - url
      properties:
        type:
          type: string
          enum:
            - reference_image
            - reference_video
            - first_frame
        url:
          type: string
          description: Reference media URL. Images also accept Base64 data URLs.
        reference_voice:
          type: string
          format: uri
          description: >-
            Optional public WAV or MP3 voice-reference URL for a reference image
            or video.
    GenerationParameters:
      type: object
      properties:
        resolution:
          type: string
          enum:
            - 720P
            - 1080P
          default: 1080P
        ratio:
          type: string
          enum:
            - '16:9'
            - '9:16'
            - '1:1'
            - '4:3'
            - '3:4'
          default: '16:9'
          description: Ignored when a first_frame is provided.
        duration:
          type: integer
          minimum: 2
          maximum: 15
          default: 5
          description: >-
            Maximum 10 seconds when reference_video is present; otherwise
            maximum 15 seconds.
        prompt_extend:
          type: boolean
          default: true
          description: >-
            Whether to rewrite and enrich the prompt. To enable NSFW generation,
            use a token from the Special-Ns resource group and set this
            parameter to false.
        watermark:
          type: boolean
          default: false
        seed:
          type: integer
          minimum: 0
          maximum: 2147483647
    TaskCreated:
      type: object
      properties:
        id:
          type: string
          example: asyntask_example123
        task_id:
          type: string
          example: asyntask_example123
        object:
          type: string
          example: video
        model:
          type: string
          example: wan2.7-r2v
        status:
          type: string
          example: queued
        progress:
          type: integer
          example: 0
        created_at:
          type: integer
          example: 1784520000
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````