# Wan-AI/Wan2.6-T2V

Text-to-video model

## Submit Async Task

### Endpoint

`https://api-us-ca.umodelverse.ai/v1/tasks/submit`

### Input

| Parameter | Type | Required | Description |
| :-------- | :---- | :-------- | :----------- |
| model | string | Yes | Model name, here it is `Wan-AI/Wan2.6-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 URL for guidance. If the audio duration exceeds the specified video duration, it will be truncated; if shorter, the latter part of the video will be silent |
| parameters.size | string | Yes | Output video size. <br>Supported resolutions and aspect ratios:<br>720P:<br>- 1280x720: 16:9<br>- 720x1280: 9:16<br>1080P:<br>- 1920x1080: 16:9<br>- 1080x1920: 9:16 |
| parameters.duration | int | No | Video duration in seconds. Options: `5`, `10`, `15`. Default: `5` |
| parameters.seed | int | No | Random seed, range `[0, 2147483647]` |
| parameters.prompt_extend | boolean | No | Whether to enable prompt enhancement. If enabled, a large model rewrites the prompt to improve results. More effective for short prompts but increases latency. Default: `true`. Example: `true` |
| parameters.shot_type | string | No | Specifies the shot type: single continuous shot or multiple shots. Effective only when `prompt_extend=true`. Priority: `shot_type` > `prompt`. For example, if `shot_type` is `single`, the model will output a single-shot video even if the prompt requests multiple shots. Options: `single` (default), `multi`. Example: `single` |

### Request Example

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

### Output

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

### Response Example

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

## Query Task Status

### Endpoint

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

### Request Example

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

### Output

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

### Response Example (Success)

```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": ""
}
```

### Response Example (Failure)

```json
{
  "output": {
    "task_id": "task_id",
    "task_status": "Failure",
    "submit_time": 1756959000,
    "finish_time": 1756959019,
    "error_message": "error_message"
  },
  "usage": {
    "duration": 5
  },
  "request_id": ""
}
```
