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

# Wan 2.2 Text-to-Video

Wan 2.2 (Wanxiang 2.2) Pro text-to-video model can generate high-quality video content based on text descriptions. Compared with previous-generation models, it offers significant improvements in visual details and motion stability, and supports generating videos with durations of 5 seconds and 8 seconds.

<Tip>
  This is an **asynchronous** API and only returns the task\_id of the asynchronous task. You should use this task\_id to request the [Get Task Result API](/en/docs/models/reference-get-async-task-result) to retrieve the video generation result.
</Tip>

## Request Headers

<ParamField header="Content-Type" type="string" required={true}>
  Enum value: `application/json`
</ParamField>

<ParamField header="Authorization" type="string" required={true}>
  Bearer authentication format: Bearer \{\{API key}}.
</ParamField>

## Request Body

<ParamField body="input" type="object" required={true}>
  Basic input information, such as the prompt.

  <Expandable title="properties" defaultOpen={true}>
    <ParamField body="prompt" type="string" required={true}>
      Text prompt. Chinese and English are supported. The length must not exceed 800 characters; each Chinese character/letter counts as one character, and any excess will be automatically truncated.

      Example value: A kitten running under the moonlight.
    </ParamField>

    <ParamField body="negative_prompt" type="string" required={false}>
      Negative prompt, used to describe content you do not want to see in the video frame and to restrict the video image.

      Chinese and English are supported. The length must not exceed 500 characters, and any excess will be automatically truncated.

      Example value: low resolution, errors, worst quality, low quality, incomplete, extra fingers, poor proportions, etc.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="parameters" type="object" required={true}>
  Video processing parameters.

  <Expandable title="properties" defaultOpen={true}>
    <ParamField body="size" type="string" required={true}>
      Multiple resolution tiers are supported, including 480P, 720P, and 1080P. The default value is `1920*1080` (1080P).
      Used to specify the video resolution in width\*height format. The resolutions supported by different models are as follows:

      **480P tier**: Available video resolutions and their corresponding video aspect ratios:

      * `832*480`: 16:9.
      * `480*832`: 9:16.
      * `624*624`: 1:1.

      **720P tier**: Available video resolutions and their corresponding video aspect ratios:

      * `1280*720`: 16:9.
      * `720*1280`: 9:16.

      **1080P tier**: Available video resolutions and their corresponding video aspect ratios:

      * `1920*1080`: 16:9.
      * `1080*1920`: 9:16.
      * `1440*1440`: 1:1.
      * `1632*1248`: 4:3.
      * `1248*1632`: 3:4.

      <Warning>
        **Common misconception about the size parameter**: size must be set to the specific value of the target resolution (such as `1280*720`), not an aspect ratio (such as `1:1`) or the name of a resolution tier (such as `480P` or `720P`).
      </Warning>
    </ParamField>

    <ParamField body="duration" type="integer" required={false}>
      Duration of the generated video.

      * For `480P` and `720P` resolutions, the available durations are `5` or `8` seconds.
      * For `1080P` resolution, the duration is fixed at `5` seconds.

      Default value: `5`.
    </ParamField>

    <ParamField body="prompt_extend" type="bool" required={false}>
      Whether to enable intelligent prompt rewriting. When enabled, a large model is used to intelligently rewrite the input prompt. This significantly improves generation results for shorter prompts, but increases processing time.

      * `true`: Default value; enables intelligent rewriting.
      * `false`: Disables intelligent rewriting.
    </ParamField>

    <ParamField body="seed" type="integer" required={false}>
      Random seed, used to control the randomness of the content generated by the model. Value range: `[0, 2147483647]`.

      If not provided, the algorithm automatically generates a random number as the seed. If you want the generated content to remain relatively stable, use the same seed parameter value.
    </ParamField>

    <ParamField body="loras" type="object[]" required={false}>
      List of LoRA models to apply (up to 3).

      <Expandable title="properties" defaultOpen={false}>
        <ParamField body="path" type="string" required={true}>
          Path of the LoRA model
        </ParamField>

        <ParamField body="scale" type="float" required={true}>
          Weight coefficient of the LoRA model

          Value range: 0.0 \~ 4.0
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

## Response Information

<ResponseField name="task_id" type="string" required={true}>
  The task\_id of the asynchronous task. You should use this task\_id to request the [Get Task Result API](/en/docs/models/reference-get-async-task-result) to obtain the generation result
</ResponseField>
