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

# Vidu Q4 Image to Video API

> Generate a Vidu Q4 video from an uploaded image, with an optional text prompt, configurable output resolution, duration, and audio generation.

## Billing Introduction

> [!NOTE]
>
> The credit rate is determined by the selected output video resolution. The total credit cost is calculated based on the generated video's duration. See the [Billing Introduction](https://ailabtools.mintlify.site/docs/billing-introduction.md#q4-image-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/vidu/q4/image-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
                - image
              properties:
                model:
                  type: string
                  enum:
                    - vidu-q4/image-to-video
                  example: vidu-q4/image-to-video
                  description: Model.
                image:
                  type: string
                  contentMediaType: application/octet-stream
                  description: |-
                    - Supported formats: `JPEG` `JPG` `PNG` `WEBP` 
                    - Maximum file size: No more than 50 MB. 
                    - Minimum resolution: `256 × 256 px`. 
                    - Maximum resolution: `4096 × 4096 px`.
                prompt:
                  type: string
                  maxLength: 20000
                  example: >-
                    The person looks up and smiles as the camera slowly moves
                    closer. Natural lighting and smooth motion.
                  description: Prompt.
                resolution:
                  type: string
                  enum:
                    - 540p
                    - 720p
                    - 1080p
                    - 2k
                    - 4k
                  default: 1080p
                  description: Output video resolution.
                duration:
                  type: integer
                  minimum: 3
                  maximum: 16
                  default: 5
                  description: Output video duration in seconds.
                audio:
                  type: boolean
                  default: true
                  description: Whether to generate audio.
      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.