# Pixverse/Pixverse-v6

Text-to-Video, Image-to-Video, and Video Extension Model

## Submit Task (Asynchronous)

### Endpoint

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

### Input

| Parameter             | Type   | Required | Description                                                                                                      |
| :-------------------- | :----- | :------- | :--------------------------------------------------------------------------------------------------------------- |
| model                 | string | Yes      | Model name, here it is `pixverse-v6`                                                                             |
| input.first_frame_url | string | No       | First frame image URL of the video. Supports URL or Base64. Required when generating video from first+last frame |
| input.last_frame_url  | string | No       | Last frame image URL of the video. Supports URL or Base64. Required when generating video from first+last frame  |
| input.img_url         | string | No       | Required when generating video from a reference image. Supports URL or Base64                                    |
| input.video_url       | string | No       | Required when extending a video. Must be a URL pointing to the reference video                                   |
| input.prompt          | string | Yes      | Prompt to guide video generation                                                                                 |
| parameters.resolution | string | No       | Resolution of the generated video. Supported values: `1080p`, `720p`, `540p`, `360p`                            |
| parameters.aspect_ratio | string | No     | Aspect ratio. Supported values: `16:9`, `4:3`, `1:1`, `3:4`, `9:16`, `2:3`, `3:2`, `21:9`. Only effective when generating from text only (no reference image or video) |
| parameters.duration   | int    | No       | Video duration (seconds), range: 1–15                                                                            |
| parameters.generate_audio | int | No      | Whether to generate video with audio                                                                             |
| parameters.seed       | int    | No       | Random seed, range: `[0, 2147483647]`                                                                            |

### Request Examples

⚠️ If you are using Windows, it is recommended to use Postman or other API tools.

* Text-to-Video

```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": "pixverse-v6",
    "input": {
      "prompt": "Convert to quick pencil sketch"
    },
    "parameters": {
      "resolution": "720p",
      "aspect_ratio": "16:9",
      "duration": 5
    }
  }'
```

* First + Last Frame Video Generation

```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": "pixverse-v6",
    "input": {
      "first_frame_url": "https://umodelverse-inference.cn-wlcb.ufileos.com/ucloud-maxcot.jpg",
      "last_frame_url": "https://umodelverse-inference.cn-wlcb.ufileos.com/ucloud-maxcot.jpg",
      "prompt": "Convert to quick pencil sketch"
    },
    "parameters": {
      "resolution": "720p",
      "duration": 5
    }
  }'
```

* Reference Image-to-Video

```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": "pixverse-v6",
    "input": {
      "img_url": "https://umodelverse-inference.cn-wlcb.ufileos.com/ucloud-maxcot.jpg",
      "prompt": "Convert to quick pencil sketch"
    },
    "parameters": {
      "resolution": "720p",
      "duration": 5
    }
  }'
```

* Video Extension

```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": "pixverse-v6",
    "input": {
      "video_url": "https://umodelverse-inference.cn-wlcb.ufileos.com/maxcot-dance.mp4",
      "prompt": "Convert to quick pencil sketch"
    },
    "parameters": {
      "resolution": "720p",
      "duration": 5
    }
  }'
```

### Output

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

### 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 returned when failed                      |
| usage.duration       | integer | Task execution duration (seconds)                       |
| request_id           | string  | Unique identifier of the request                        |

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