# Kling/v2.6-I2V

Image-to-Video 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 `kling-v2-6` |
| input.prompt            | string | Yes      | Prompt used to guide video generation |
| input.negative_prompt   | string | No       | Negative prompt used to restrict undesired content |
| parameters.mode         | string | No       | Generation mode. Available values: `std`, `pro`. Default is `pro`. Currently only `pro` is supported |
| parameters.aspect_ratio | string | No       | Video aspect ratio. Available values: `16:9`, `9:16`, `1:1` |
| parameters.duration     | int    | No       | Video duration (seconds). Available values: `5`, `10`. Default is `5` |
| parameters.image        | string | Yes      | Reference image <br>Supports Base64-encoded image or image URL (must be accessible)<br>Please note: if using Base64, ensure all image data parameters are Base64-encoded. Do NOT include any prefix such as `data:image/png;base64,`. The correct format should be the raw Base64 string only.<br>Example:<br>Correct Base64 format:<br><br> iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==<br><br>Incorrect Base64 format (with prefix):<br><br> data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==<br><br>Please provide only the Base64 string so the system can properly process it<br>- Supported formats: .jpg / .jpeg / .png<br>- File size must not exceed 10MB; image dimensions must be at least 300px; aspect ratio must be between 1:2.5 and 2.5:1<br>- Either `image` or `image_tail` must be provided; both cannot be empty |
| parameters.image_tail   | string | No       | Video ending frame image URL. Supports URL or Base64 encoding. Requirements are the same as `parameters.image` |

**Note**:
- v2.6 does not support videos with audio (including `voice_list` or `sound` parameters). Contact technical support if needed.

### Request Example

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

```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": "kling-v2-6",
    "input": {
      "prompt": "The image comes to life with gentle movement"
    },
    "parameters": {
      "mode": "pro",
      "aspect_ratio": "16:9",
      "duration": 5,
      "image": "https://example.com/first_frame.jpg"
    }
  }'
```

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