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

# Wan 3.0 File & Reference to Video API

> Generate a Wan 3.0 video from a text prompt and reference file, with optional reference images, videos, or audio.

> [!NOTE]
>
> Wan 3.0 is the standard version. [Wan 3.0 Prime](https://ailabtools.mintlify.site/docs/ai-model/video/wan/30-prime/file-reference-to-video.md) offers the same capabilities and significantly faster end-to-end generation at higher credit rates.

## Billing Introduction

> [!NOTE]
>
> The credit rate is determined by the output video resolution. The total credit cost is based on the combined duration of input reference videos and the output video. See the [Billing Introduction](https://ailabtools.mintlify.site/docs/billing-introduction.md#3-0-file-%26-reference-to-video) for current credit rates.

## File Storage Policy

<table><thead><tr><th>Data Type</th>
<th>Stored</th>
<th>Retention</th>
<th>Training</th>
<th>Deletion</th></tr></thead>
<tbody><tr><td>Uploaded Files</td>
<td>No</td>
<td>N/A</td>
<td>No</td>
<td>Immediate</td></tr></tbody></table>

> [!TIP]
>
> For more information, see the [File Storage Policy](https://ailabtools.mintlify.site/docs/file-storage-policy.md) and [Privacy Policy](https://www.ailabtools.com/privacy-policy).

## Query Task

> [!NOTE]
>
> This API creates an asynchronous task. Save the returned `task_id`, then use [Querying Async Task Results](https://ailabtools.mintlify.site/docs/ai-common/async-task-results/api.md) to retrieve its final result. Results remain available for 24 hours; wait at least 5 seconds between queries.

| Field | Type | Description |
| :- | :- | :- |
| `data` | `object` | |
| +`result_json` | `object` | |
| ++`result_urls` | `array` | Result video URLs. |
| +++`result_urls[]` | `string` | Result video URL. |

```json theme={null}
{
  "data": {
    "result_urls": [""]
  }
}
```

> [!WARNING]
>
> All result URLs are temporarily available and will expire after 24 hours.

## Submit Task


## OpenAPI

````yaml docs/ai-model/video/wan/30/file-reference-to-video-openapi.json POST /api/model/task/create
openapi: 3.2.1
info:
  title: AILabTools API
  termsOfService: https://www.ailabtools.com/term-of-use
  contact:
    name: AILabTools Support Team
    url: https://www.ailabtools.com/support
    email: support@ailabtools.com
  version: 1.0.0
servers:
  - url: https://www.ailabapi.com
security:
  - apiKeyAuth: []
paths:
  /api/model/task/create:
    post:
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - model
                - prompt
                - reference_file
              properties:
                model:
                  type: string
                  enum:
                    - wan-30/video
                  example: wan-30/video
                  description: Model.
                prompt:
                  type: string
                  minLength: 1
                  maxLength: 20000
                  example: >-
                    Create a short visual story based on the key ideas in the
                    reference file, with smooth transitions and natural
                    lighting.
                  description: Prompt.
                reference_file:
                  type: string
                  contentMediaType: application/octet-stream
                  description: >-
                    Reference file for the all-purpose reference mode. 

                    - Supported format: `DOCX` `DOC` `XLSX` `XLS` `PPTX` `PPT`
                    `PDF` `TXT` `KEY` `PAGES` `NUMBERS` `MD`. 

                    - Maximum file size: No more than 100 MB. 

                    - Maximum pages: 50 pages for paginated documents (e.g.,
                    PDF, DOCX, PPT, KEY, PAGES).
                reference_images:
                  type: array
                  maxItems: 10
                  items:
                    type: string
                    contentMediaType: application/octet-stream
                  description: |-
                    Reference images for the all-purpose reference mode. 
                    - Supported formats: `JPEG` `JPG` `PNG` `WEBP` `BMP` 
                    - Maximum file size: No more than 20 MB. 
                    - Minimum resolution: `256 × 256 px`. 
                    - Maximum resolution: `8000 × 8000 px`. 
                    - Aspect ratio: From `1:8` to `8:1`.
                reference_videos:
                  type: array
                  maxItems: 5
                  items:
                    type: string
                    contentMediaType: application/octet-stream
                  description: >-
                    Reference videos for the all-purpose reference mode. 

                    - Supported formats: `MP4` `MOV`. 

                    - Maximum file size: `100 MB`. 

                    - Duration: `1–15 seconds` per video, with a maximum
                    combined duration of `15 seconds`. 

                    - Minimum resolution: `256 × 256 px`. 

                    - Maximum resolution: `4096 × 4096 px`. 

                    - Aspect ratio: From `1:8` to `8:1`.
                reference_audios:
                  type: array
                  maxItems: 5
                  items:
                    type: string
                    contentMediaType: application/octet-stream
                  description: >-
                    Reference audios for the all-purpose reference mode. 

                    - Supported format: `MP3` `WAV`. 

                    - Maximum file size: No more than 15 MB. 

                    - Duration: `1–15 seconds` per audio file, with a maximum
                    combined duration of `15 seconds`.
                resolution:
                  type: string
                  enum:
                    - 480p
                    - 720p
                    - 1080p
                  default: 720p
                  description: Output video resolution.
                duration:
                  type: integer
                  minimum: 2
                  maximum: 30
                  default: 5
                  description: >-
                    Output video duration in seconds. Without video input, the
                    range is [2, 30]. With reference videos: input video
                    duration + output duration ≤ 30.
                audio:
                  type: boolean
                  default: true
                  description: Whether to generate audio.
                aspect_ratio:
                  type: string
                  enum:
                    - adaptive
                    - '1:1'
                    - '3:4'
                    - '4:3'
                    - '9:16'
                    - '16:9'
                  default: adaptive
                  description: Output video aspect ratio.
                seed:
                  type: integer
                  format: int32
                  minimum: 0
                  maximum: 2147483647
                  description: >-
                    Random seed. Using the same parameters and seed helps
                    improve result reproducibility.
                nsfw_checker:
                  type: boolean
                  default: false
                  description: >-
                    Whether to enable additional NSFW content filtering for
                    model-generated results.
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/commonResponseData'
                  - $ref: '#/components/schemas/asyncTaskId'
              example:
                request_id: 01A1E397-AF68-53D9-8CFD-6831D8F108BD
                log_id: '100000000'
                error_detail:
                  code: ''
                  code_message: ''
                  message: ''
                task_id: 1794820417.b515cde0-d9c8-4ad2-206a-bcdu0613bbb1
        4XX:
          $ref: '#/components/responses/4XX'
        5XX:
          $ref: '#/components/responses/5XX'
components:
  schemas:
    commonResponseData:
      type: object
      required:
        - request_id
        - log_id
        - error_detail
      properties:
        request_id:
          type: string
          description: Request ID for debugging.
        log_id:
          type: string
          description: Log ID for debugging.
        error_detail:
          type: object
          required:
            - code
            - code_message
            - message
          properties:
            code:
              type: string
              description: >-
                Error Code. See [Error
                Codes](/docs/response-description#error-codes).
            code_message:
              type: string
              description: Error summary.
            message:
              type: string
              description: Error message.
    asyncTaskId:
      type: object
      required:
        - task_id
      properties:
        task_id:
          type: string
          description: >-
            Task ID for querying [Querying Async Task
            Results](/docs/ai-common/async-task-results/api).
  responses:
    4XX:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/commonResponseData'
          example:
            request_id: 01A1E397-AF68-53D9-8CFD-6831D8F108BD
            log_id: '100000000'
            error_detail:
              code: ERROR_PARAMETERS
              code_message: Invalid parameters.
              message: 'Invalid parameters. - image: Cannot be empty.'
    5XX:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/commonResponseData'
          example:
            request_id: 01A1E397-AF68-53D9-8CFD-6831D8F108BD
            log_id: '100000000'
            error_detail:
              code: ERROR_INTERNAL_SERVER_ERROR
              code_message: >-
                Internal server error. Please try again later. If not resolved
                promptly, contact the platform.
              message: >-
                Internal server error. Please try again later. If not resolved
                promptly, contact the platform.
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: ailabapi-api-key
      description: API KEY for authentication. See [Get API KEY](/docs/get-api-key).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.