> ## 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.

# Wan2.6-Reference to Video

> Use the Wan 2.6 reference-to-video model to generate video from reference image or video

## 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-6-reference-to-video.json post /api/v1/client/job/CreateTask
openapi: 3.0.0
info:
  title: Wan API
  description: crun.ai Wan 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 wan2.6
      operationId: wan-2-6-r2v
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              properties:
                model:
                  type: string
                  enum:
                    - wan/2-6-r2v
                  description: |-
                    The model name to use for generation. Required field.

                    - Must be `wan/2-6-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.6 reference-video-to-video
                    generation task.
                  properties:
                    prompt:
                      type: string
                      description: Text prompt describing the video content. Optional.
                      maxLength: 1500
                      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_video_urls:
                      type: array
                      description: >-
                        Deprecated. Reference video URLs used as the basis for
                        generation.
                      deprecated: true
                      items:
                        type: string
                        format: uri
                      minItems: 1
                      maxItems: 3
                      example:
                        - https://example.com/reference1.mp4
                    reference_urls:
                      type: array
                      description: >-
                        Array of uploaded reference file URLs. Supports both
                        videos and images. Used to extract the character's
                        appearance and (if available) voice timbre, so the
                        generated video matches the reference traits.


                        Each URL MUST point to **one** image or **one** video:


                        - Images: 0 to 5

                        - Videos: 0 to 3

                        - Total limit: images + videos <= 5


                        When multiple reference files are provided, the array
                        order defines character order:


                        - The 1st URL maps to `character1`

                        - The 2nd URL maps to `character2`

                        - And so on


                        Each reference file MUST contain exactly one primary
                        subject character (e.g., `character1` is a little girl,
                        `character2` is an alarm clock).


                        Video requirements:


                        - Format: MP4, MOV

                        - Duration: 1s to 30s

                        - File size: up to 100MB


                        Image requirements:


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

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

                        - File size: up to 10MB
                      items:
                        type: string
                        format: uri
                      minItems: 1
                      maxItems: 5
                      example:
                        - https://example.com/reference-character1.png
                        - https://example.com/reference-character2.mp4
                    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'
                    duration:
                      type: integer
                      description: Video duration in seconds.
                      enum:
                        - 5
                        - 10
                      default: 5
                      example: 10
                    shot_type:
                      type: string
                      description: Video shot type.
                      enum:
                        - single
                        - multi
                      default: single
                      example: single
                  required:
                    - reference_urls
            example:
              model: wan/2-6-r2v
              callback_url: https://your-domain.com/api/callback
              input:
                prompt: >-
                  A cinematic slow-motion scene of a rain-soaked city street at
                  night, neon reflections on the wet pavement.
                reference_urls:
                  - https://example.com/reference-character1.png
                  - https://example.com/reference-character2.mp4
                resolution: 1080P
                aspect_ratio: '16:9'
                duration: 10
                shot_type: single
      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:
                          - >-
                            Value error, Invalid input for model wan/2-6-r2v:
                            duration: Input should be 5, 10
              example:
                code: 422
                message: Missing Params or Type Error
                errors:
                  - >-
                    Value error, Invalid input for model wan/2-6-r2v: duration:
                    Input should be 5, 10
        '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

````