# HappyHorse-1.0-Video-Edit

Video editing 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 `happyhorse-1.0-video-edit` |
| input.prompt             | string   | Yes      | Text instruction to describe the video editing intent |
| input.video_url          | string   | Yes      | Video URL to be edited |
| input.images             | string[] | No       | Reference image URL list, up to 5 images |
| parameters.resolution    | string   | No       | Video resolution, options: `720P`, `1080P`, default `1080P` |
| parameters.watermark     | boolean  | No       | Whether to add a watermark, default `true` |
| parameters.audio_setting | string   | No       | Audio control, options: `auto`, `origin`, default `auto` |
| parameters.seed          | int      | No       | Random seed, range `[0, 2147483647]` |

### Request Example

```shell
curl --location --globoff 'https://api-us-ca.umodelverse.ai/v1/tasks/submit' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'X-DashScope-Async: enable' \
--header 'Content-Type: application/json' \
--data '{
    "model": "happyhorse-1.0-video-edit",
    "input": {
      "prompt": "Make the character in the video wear the striped sweater from the reference image",
      "video_url": "https://example.com/input.mp4",
      "images": [
        "https://example.com/reference.webp"
      ]
    },
    "parameters": {
      "resolution": "720P",
      "audio_setting": "origin"
    }
  }'
```

### Output

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

## Query Task Status

### Endpoint

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

### 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 | Billable video duration (seconds)                       |
| usage.input_video_duration  | number  | Input video duration (seconds)                          |
| usage.output_video_duration | number  | Output video duration (seconds)                         |
| usage.video_count           | integer | Number of output videos                                 |
| usage.SR                    | integer | Output video resolution height, e.g., `720`, `1080`     |
| request_id                  | string  | Unique identifier of the request                        |
