# Wan-AI/Wan2.5-T2V

Text-to-Video Model

## Asynchronous Task Submission

### Endpoint

`https://api.umodelverse.ai/v1/tasks/submit`

### Input

| Parameter               | Type   | Required | Description                                                                                                      |
| :---------------------- | :----- | :------- | :--------------------------------------------------------------------------------------------------------------- |
| model                   | string | Yes      | Model name, here it is `Wan-AI/Wan2.5-T2V`                                                                       |
| input.prompt            | string | Yes      | Prompt, used to guide video generation                                                                           |
| input.negative_prompt   | string | No       | Negative prompt, used to restrict undesired content                                                             |
| input.audio_url         | string | No       | Audio file URL, used optionally to guide generation                                                              |
| parameters.size         | string | Yes      | Size of the generated video. <br>Available resolutions and their corresponding aspect ratios are: <br>480P levels:<br>- 832x480: 16:9<br>- 480x832: 9:16<br>720P levels:<br>- 1280x720: 16:9<br>- 720x1280: 9:16<br>1080P levels:<br>- 1920x1080: 16:9<br>- 1080x1920: 9:16 |
| parameters.duration     | int    | No       | Video generation duration (seconds), optional values `5` or `10`, default is `5`                                 |
| parameters.prompt_extend| bool   | No       | Whether to enable intelligent rewriting of the prompt. When enabled, the input prompt is intelligently rewritten using a large model. It significantly improves the generation effect for shorter prompts, but adds time. Default `false` |
| parameters.seed         | int    | No       | Random number seed, range `[-1, 2147483647]`, -1 means random                                                   |

### Request Example
⚠️ If you are using Windows, it is recommended to use Postman or other API invocation tools.
```shell
curl --location --globoff 'https://api.umodelverse.ai/v1/tasks/submit' \
--header 'Authorization: <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
    "model": "Wan-AI/Wan2.5-T2V",
    "input": {
      "prompt": "A beautiful girl is dancing",
      "audio_url": "https://example.com/audio.mp3"
    },
    "parameters": {
      "size": "832x480",
      "duration": 5
    }
  }'
```

### Output

| Parameter      | Type   | Description             |
| :------------- | :----- | :---------------------- |
| output.task_id | string | Unique identifier for the asynchronous task |
| request_id     | string | Unique identifier for the request |

### Response Example

```json
{
  "output": {
    "task_id": "task_id"
  },
  "request_id": "request_id"
}
```

## Query Task Status

### Endpoint

`https://api.umodelverse.ai/v1/tasks/status?task_id=<task_id>`

### Request Example

```shell
curl --location 'https://api.umodelverse.ai/v1/tasks/status?task_id=<task_id>' \
--header 'Authorization: <YOUR_API_KEY>'
```

### Output

| Parameter             | Type    | Description                                       |
| :-------------------- | :------ | :------------------------------------------------ |
| output.task_id        | string  | Unique identifier for the asynchronous task       |
| output.task_status    | string  | Task status: `Pending`,`Running`,`Success`,`Failure` |
| output.urls           | array   | List of URLs for the video result                 |
| output.submit_time    | integer | Task submission timestamp                         |
| output.finish_time    | integer | Task completion timestamp                         |
| output.error_message  | string  | Error message returned on failure                 |
| usage.duration        | integer | Task execution duration (seconds)                 |
| request_id            | string  | Unique identifier for the request                 |

### Response Example

```json
{
  "output": {
    "task_id": "task_id",
    "task_status": "Success",
    "urls": ["https://xxxxx/xxxx.mp4"],
    "submit_time": 1756959000,
    "finish_time": 1756959050
  },
  "usage": {
    "duration": 5
  },
  "request_id": ""
}
```