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

# Wan 2.7 Reference to Video

> Use Wan 2.7 reference-to-video to generate video from reference images or videos.

## Duration Limit

When any item in `reference_medias` includes `reference_video`, `duration` must be 10 seconds or less. Durations longer than 10 seconds are only supported when all reference media are images.

## Query Task Status

After submitting a task, use the unified query endpoint to check progress and retrieve results:

<Card title="Get Task Info" icon="magnifying-glass" href="/models/common/get-task-info">
  Learn how to query task status and retrieve generation results
</Card>

<Tip>
  For production use, we recommend using the `callback_url` parameter to receive automatic notifications when generation completes, rather than polling the status endpoint.
</Tip>

## Related Resources

<CardGroup cols={2}>
  <Card title="Models Overview" icon="store" href="/models/quickstart">
    Explore all available models
  </Card>

  <Card title="Common API" icon="gear" href="/common-api/get-account-credits">
    Check credits and account usage
  </Card>
</CardGroup>


## OpenAPI

````yaml models/wan/2-7-reference-to-video.json post /api/v1/client/job/CreateTask
openapi: 3.0.0
info:
  title: Crun Wan 2.7 Reference to Video API
  description: crun.ai Wan 2.7 Video API Documentation
  version: 1.0.0
  contact:
    name: Technical Support
    email: support@crun.ai
servers:
  - url: https://api.crun.ai
    description: API Server
security:
  - ApiKeyAuth: []
paths:
  /api/v1/client/job/CreateTask:
    post:
      summary: Generate video using Wan 2.7 reference-to-video
      operationId: wan-2-7-r2v
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              properties:
                model:
                  type: string
                  enum:
                    - wan/2-7-r2v
                  description: |-
                    The model name to use for generation. Required field.

                    - Must be `wan/2-7-r2v` for this endpoint
                callback_url:
                  type: string
                  format: uri
                  description: >-
                    Optional. Callback URL for receiving task completion
                    notifications.


                    - System will POST task status and results to this URL when
                    generation completes

                    - Callback payloads structure is consistent with the `data`
                    object returned by the task status query

                    - Your callback endpoint should accept POST requests with
                    JSON payload containing results

                    - It returns an HTTP 200 status code upon successful receipt
                  example: https://your-domain.com/api/callback
                input:
                  type: object
                  description: >-
                    Input parameters for the Wan 2.7 reference-to-video
                    generation task.
                  properties:
                    prompt:
                      type: string
                      description: >-
                        Text prompt describing the video content or editing
                        request.
                      minLength: 1
                      maxLength: 5000
                      example: >-
                        A cinematic slow-motion scene of a rain-soaked city
                        street at night, neon reflections on the wet pavement.
                    negative_prompt:
                      type: string
                      description: Negative prompt to exclude unwanted elements. Optional.
                      maxLength: 500
                      example: No people, no text, no logos.
                    reference_medias:
                      type: array
                      description: >-
                        Reference media list. Supports 1 to 5 objects. Each
                        object must provide either `reference_image` or
                        `reference_video`, and may include `reference_voice`.


                        **Duration rule**:

                        - When any reference media item includes
                        `reference_video`, `duration` must be 10 seconds or
                        less.

                        - Durations longer than 10 seconds are only supported
                        when all reference media are images.


                        **Reference image restrictions**:

                        - Supported formats: JPEG, JPG, PNG (transparent channel
                        not supported), BMP, WEBP.

                        - Resolution: width and height must both be within [240,
                        8000] pixels.

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

                        - File size: up to 20 MB per image.


                        **Reference video restrictions**:

                        - Supported formats: MP4, MOV.

                        - Duration: 1 to 30 seconds.

                        - Resolution: width and height must both be within [240,
                        4096] pixels.

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

                        - File size: up to 100 MB per video.


                        **Reference voice restrictions**:

                        - Supported formats: WAV, MP3.

                        - Duration: 1 to 10 seconds.

                        - File size: up to 15 MB.
                      minItems: 1
                      maxItems: 5
                      items:
                        type: object
                        properties:
                          reference_image:
                            type: string
                            format: uri
                            description: >-
                              Reference image URL.


                              **Image restrictions**:

                              - Supported formats: JPEG, JPG, PNG (transparent
                              channel not supported), BMP, WEBP.

                              - Resolution: width and height must both be within
                              [240, 8000] pixels.

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

                              - File size: up to 20 MB.
                          reference_video:
                            type: string
                            format: uri
                            description: >-
                              Reference video URL.


                              When this field is provided in any
                              `reference_medias` item, `duration` must be 10
                              seconds or less.


                              **Video restrictions**:

                              - Supported formats: MP4, MOV.

                              - Duration: 1 to 30 seconds.

                              - Resolution: width and height must both be within
                              [240, 4096] pixels.

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

                              - File size: up to 100 MB.
                          reference_voice:
                            type: string
                            format: uri
                            description: >-
                              Audio URL used to specify the voice timbre of the
                              subject character in the reference media (image or
                              video). Use it together with `reference_image` or
                              `reference_video`. This audio is used only as a
                              voice timbre reference and is unrelated to spoken
                              content. For better matching, keep the reference
                              audio language consistent with the prompt
                              language.


                              **Voice audio behavior**:

                              - Default: if `reference_video` contains audio and
                              `reference_voice` is not 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
                              original video audio timbre.


                              **Audio restrictions**:

                              - Supported formats: WAV, MP3.

                              - Duration: 1 to 10 seconds.

                              - File size: up to 15 MB.
                      example:
                        - reference_image: https://example.com/reference-character.png
                          reference_voice: https://example.com/reference-voice.mp3
                        - reference_video: https://example.com/reference-motion.mp4
                    duration:
                      type: integer
                      description: >-
                        Video duration in seconds. Supports 2 to 15 seconds.
                        When any item in `reference_medias` includes
                        `reference_video`, the duration must be 10 seconds or
                        less.
                      minimum: 2
                      maximum: 15
                      default: 5
                      example: 10
                    resolution:
                      type: string
                      description: Output video resolution.
                      enum:
                        - 1080P
                        - 720P
                      default: 720P
                      example: 1080P
                    aspect_ratio:
                      type: string
                      description: Aspect ratio of the generated video.
                      enum:
                        - '16:9'
                        - '9:16'
                        - '4:3'
                        - '3:4'
                        - '1:1'
                      default: '16:9'
                      example: '16:9'
                    region:
                      type: string
                      description: >-
                        Service region. mainland: China Mainland, global:
                        International
                      enum:
                        - mainland
                        - global
                      nullable: true
                      default: null
                      example: global
                    prompt_extend:
                      type: boolean
                      description: Whether to automatically extend the prompt.
                      default: false
                      example: false
                    input_compliance:
                      type: string
                      nullable: true
                      description: >-
                        Optional input compliance check switch. Use `enable` to
                        turn input checks on, `disable` to turn them off, or
                        omit/pass `null` to use the default setting.
                      enum:
                        - disable
                        - enable
                      default: null
                      example: enable
                    output_compliance:
                      type: string
                      nullable: true
                      description: >-
                        Optional output compliance check switch. Use `enable` to
                        turn output checks on, `disable` to turn them off, or
                        omit/pass `null` to use the default setting.
                      enum:
                        - disable
                        - enable
                      default: null
                      example: enable
                  required:
                    - prompt
                    - reference_medias
            example:
              model: wan/2-7-r2v
              callback_url: https://your-domain.com/api/callback
              input:
                prompt: >-
                  A character walking through a neon-lit alley while keeping the
                  reference appearance consistent.
                reference_medias:
                  - reference_image: https://example.com/reference-character.png
                    reference_voice: https://example.com/reference-voice.mp3
                resolution: 1080P
                aspect_ratio: '16:9'
                region: global
                duration: 10
                prompt_extend: false
                input_compliance: enable
                output_compliance: enable
      responses:
        '200':
          description: Request successful
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          task_id:
                            type: string
                            description: >-
                              Task ID, can be used with Get Task Details
                              endpoint to query task status
                            example: task_12345678
              example:
                code: 200
                message: success
                data:
                  task_id: task_12345678
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      errors:
                        type: array
                        description: Detailed validation error messages
                        items:
                          type: string
                        example:
                          - specific error field message
              example:
                code: 422
                message: Missing Params or Type Error
                errors:
                  - specific error field message
        '500':
          $ref: '#/components/responses/Error'
components:
  schemas:
    ApiResponse:
      type: object
      properties:
        code:
          type: integer
          enum:
            - 200
            - 401
            - 402
            - 404
            - 422
            - 429
            - 455
            - 500
            - 501
            - 505
          description: >-
            Response status code


            - **200**: Success - Request has been processed successfully

            - **401**: Unauthorized - Authentication credentials are missing or
            invalid

            - **402**: Insufficient Credits - Account does not have enough
            credits to perform the operation

            - **404**: Not Found - The requested resource or endpoint does not
            exist

            - **422**: Validation Error - The request parameters failed
            validation checks

            - **429**: Rate Limited - Request limit has been exceeded for this
            resource

            - **455**: Service Unavailable - System is currently undergoing
            maintenance

            - **500**: Server Error - An unexpected error occurred while
            processing the request

            - **501**: Generation Failed - Content generation task failed

            - **505**: Feature Disabled - The requested feature is currently
            disabled
        message:
          type: string
          description: Response message, error description when failed
          example: success
  responses:
    Error:
      description: Server Error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        All APIs require authentication via API Key.


        Get API Key:

        1. Visit [API Key Management Page](https://crun.ai/user-api-key) to get
        your API Key


        Usage:

        Add to request header:


        x-api-key: YOUR_API_KEY


        Note:

        - Keep your API Key secure and do not share it with others

        - If you suspect your API Key has been compromised, reset it immediately
        in the management page

````