# Kling

> Kling text/image video, extension, lip sync and image jobs.

App · 19 actions. Web page: https://docs.lodol.com/docs/integrations/kling

## Actions

### Create extend video task

Create extend video task.

**Inputs**

- Video id (`video_id`, text, required): The ID of a retained video generated with Kling V1.0, V1.5 or V1.6. Other model versions cannot be extended by this endpoint.
- Prompt (`prompt`, text): Text Prompt
- Negative prompt (`negative_prompt`, text): Negative text prompt
- Cfg scale (`cfg_scale`, number): Prompt reference strength. The higher the value, the stronger the reference to the prompt.
- Watermark info (`watermark_info`, object): Whether to generate watermarked results simultaneously
- Callback url (`callback_url`, text): The callback notification address for the task results. If configured, the server will actively notify when the task status changes.
- External task id (`external_task_id`, text): Customized Task ID

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "code": 0,
    "data": {
      "created_at": 1,
      "task_id": "example",
      "task_info": {
        "external_task_id": "example"
      },
      "task_status": "submitted",
      "task_status_msg": "example",
      "updated_at": 1
    },
    "message": "example",
    "request_id": "example"
  }
}
```

### Create image task

Create image task.

**Inputs**

- Model name (`model_name`, text): Model Name. One of: `kling-v2-1`, `kling-v3`.
- Prompt (`prompt`, text, required): Positive text prompt
- Negative prompt (`negative_prompt`, text): Negative text prompt
- Image (`image`, text): Reference Image
- Image reference (`image_reference`, text): Image reference type. One of: `subject`, `face`.
- Image fidelity (`image_fidelity`, number): Face reference intensity for user-uploaded images during generation
- Human fidelity (`human_fidelity`, number): Facial reference intensity, refers to the similarity of the facial features of the person in the reference image
- Element list (`element_list`, list): Reference element list based on element library ID
- Resolution (`resolution`, text): Image generation resolution. One of: `1k`, `2k`.
- N (`n`, number): Number of generated images
- Aspect ratio (`aspect_ratio`, text): Aspect ratio of the generated images (width:height). One of: `16:9`, `9:16`, `1:1`, `4:3`, `3:4`, `3:2`, `2:3`, `21:9`.
- Watermark info (`watermark_info`, object): Whether to generate watermarked results simultaneously
- Callback url (`callback_url`, text): The callback notification address for the result of this task. If configured, the server will actively notify when the task status changes.
- External task id (`external_task_id`, text): Customized Task ID

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "code": 0,
    "data": {
      "created_at": 1,
      "task_id": "example",
      "task_info": {
        "external_task_id": "example"
      },
      "task_status": "submitted",
      "task_status_msg": "example",
      "updated_at": 1
    },
    "message": "example",
    "request_id": "example"
  }
}
```

### Create image video task

Create image video task.

**Inputs**

- Model name (`model_name`, text, required): Model Name. One of: `kling-v2-5-turbo`, `kling-v2-6`, `kling-v3`.
- Image (`image`, text): Reference Image
- Image tail (`image_tail`, text): Reference Image - End frame control
- Multi shot (`multi_shot`, true/false): Whether to generate multi-shot video
- Shot type (`shot_type`, text): Storyboard method. One of: `customize`, `intelligence`.
- Prompt (`prompt`, text): Positive text prompt
- Multi prompt (`multi_prompt`, list): Information about each storyboard, such as prompts and duration
- Negative prompt (`negative_prompt`, text): Negative text prompt
- Element list (`element_list`, list): Reference Element List, based on element ID from element library
- Voice list (`voice_list`, list): List of voices referenced when generating videos
- Sound (`sound`, text): Whether to generate sound when generating video. One of: `on`, `off`.
- Cfg scale (`cfg_scale`, number): Flexibility in video generation; higher value means lower model flexibility and stronger relevance to user prompt
- Mode (`mode`, text): Video generation mode. One of: `std`, `pro`, `4k`.
- Static mask (`static_mask`, text): Static brush mask area (mask image created by user using motion brush)
- Dynamic masks (`dynamic_masks`, list): Dynamic brush configuration list
- Camera control (`camera_control`, object): Camera movement control protocol (if not specified, model will intelligently match based on input text/images)
- Duration (`duration`, text): Video duration in seconds. One of: `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, and 3 more.
- Watermark info (`watermark_info`, object): Whether to generate watermarked results simultaneously
- Callback url (`callback_url`, text): Callback notification URL for task result. If configured, server will notify when task status changes.
- External task id (`external_task_id`, text): Customized Task ID

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "code": 0,
    "data": {
      "created_at": 1,
      "task_id": "example",
      "task_info": {
        "external_task_id": "example"
      },
      "task_status": "submitted",
      "task_status_msg": "example",
      "updated_at": 1
    },
    "message": "example",
    "request_id": "example"
  }
}
```

### Create lip sync task

Create lip sync task.

**Inputs**

- Session id (`session_id`, text, required): Session ID generated during the identify face API. It remains unchanged during the selection/editing process.
- Face choose (`face_choose`, list, required): Specified Face for Lip-Sync
- Watermark info (`watermark_info`, object): Whether to generate watermarked results simultaneously
- External task id (`external_task_id`, text): Custom Task ID
- Callback url (`callback_url`, text): The callback notification address for the result of this task. If configured, the server will actively notify when the task status changes.

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "code": 0,
    "data": {
      "created_at": 1,
      "task_id": "example",
      "task_info": {
        "external_task_id": "example"
      },
      "task_status": "submitted",
      "task_status_msg": "example",
      "updated_at": 1
    },
    "message": "example",
    "request_id": "example"
  }
}
```

### Create multi image task

Create multi image task.

**Inputs**

- Model name (`model_name`, text): Model Name. One of: `kling-v2-1`.
- Prompt (`prompt`, text): Positive text prompt
- Subject image list (`subject_image_list`, list, required): One to four cropped subject images, each with a subject_image URL or raw base64 value.
- Scene image (`scene_image`, text): Scene Reference Image
- Style image (`style_image`, text): Style Reference Image
- N (`n`, number): Number of generated images
- Aspect ratio (`aspect_ratio`, text): Aspect ratio of the generated images (width:height). One of: `16:9`, `9:16`, `1:1`, `4:3`, `3:4`, `3:2`, `2:3`, `21:9`.
- Watermark info (`watermark_info`, object): Whether to generate watermarked results simultaneously
- Callback url (`callback_url`, text): The callback notification address for the result of this task. If configured, the server will actively notify when the task status changes
- External task id (`external_task_id`, text): Customized Task ID

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "code": 0,
    "data": {
      "created_at": 1,
      "task_id": "example",
      "task_info": {
        "external_task_id": "example"
      },
      "task_status": "submitted",
      "task_status_msg": "example",
      "updated_at": 1
    },
    "message": "example",
    "request_id": "example"
  }
}
```

### Create text video task

Create text video task.

**Inputs**

- Model name (`model_name`, text, required): Model Name. One of: `kling-v2-5-turbo`, `kling-v2-6`, `kling-v3`.
- Multi shot (`multi_shot`, true/false): Whether to generate multi-shot video
- Shot type (`shot_type`, text): Storyboard method. One of: `customize`, `intelligence`.
- Prompt (`prompt`, text): Positive text prompt
- Multi prompt (`multi_prompt`, list): Each storyboard cue can include both positive and negative descriptions
- Negative prompt (`negative_prompt`, text): Negative text prompt
- Sound (`sound`, text): Is sound generated simultaneously when generating videos. One of: `on`, `off`.
- Cfg scale (`cfg_scale`, number): The degree of freedom for generating video; the larger the value, the smaller the degree of freedom of the model
- Mode (`mode`, text): Video generation mode. One of: `std`, `pro`, `4k`.
- Camera control (`camera_control`, object): Terms of controlling camera movement (if not specified, the model will intelligently match based on the input text/images)
- Aspect ratio (`aspect_ratio`, text): The aspect ratio of the generated video frame (width:height). One of: `16:9`, `9:16`, `1:1`.
- Duration (`duration`, text): Video Length, unit: s (seconds). One of: `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, and 3 more.
- Watermark info (`watermark_info`, object): Whether to generate watermarked results simultaneously
- Callback url (`callback_url`, text): Callback notification URL for this task result. If configured, the server will actively notify when the task status changes
- External task id (`external_task_id`, text): Customized Task ID

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "code": 0,
    "data": {
      "created_at": 1,
      "task_id": "example",
      "task_info": {
        "external_task_id": "example"
      },
      "task_status": "submitted",
      "task_status_msg": "example",
      "updated_at": 1
    },
    "message": "example",
    "request_id": "example"
  }
}
```

### Get extend video task

Get extend video task.

**Inputs**

- Task id (`task_id`, text): Task ID for Video Generation. Fill the value directly in the request path. Choose either task_id or external_task_id for querying. Use either task_id or external_task_id as the {id} path parameter; exactly one is required.
- External task id (`external_task_id`, text): Customized Task ID for Video Generation. Fill the value directly in the request path. Choose either task_id or external_task_id for querying. Use either task_id or external_task_id as the {id} path parameter; exactly one is required.

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "code": 0,
    "data": {
      "created_at": 1,
      "task_id": "example",
      "task_info": {
        "external_task_id": "example"
      },
      "task_result": {
        "videos": []
      },
      "task_status": "submitted",
      "task_status_msg": "example",
      "updated_at": 1
    },
    "message": "example",
    "request_id": "example"
  }
}
```

### Get image task

Get image task.

**Inputs**

- Task id (`task_id`, text): The task ID for image generation. Request path parameter, directly fill the value in the request path. Use either task_id or external_task_id as the {id} path parameter; exactly one is required.
- External task id (`external_task_id`, text): Customized Task ID for image generation. Use either task_id or external_task_id as the {id} path parameter; exactly one is required.

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "code": 0,
    "data": {
      "created_at": 1,
      "task_id": "example",
      "task_info": {
        "external_task_id": "example"
      },
      "task_result": {
        "images": []
      },
      "task_status": "submitted",
      "task_status_msg": "example",
      "updated_at": 1
    },
    "message": "example",
    "request_id": "example"
  }
}
```

### Get image video task

Get image video task.

**Inputs**

- Task id (`task_id`, text): Task ID for image to video. Use either task_id or external_task_id as the {id} path parameter; exactly one is required.
- External task id (`external_task_id`, text): Customized Task ID for image to video. Use either task_id or external_task_id as the {id} path parameter; exactly one is required.

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "code": 0,
    "data": {
      "created_at": 1,
      "task_id": "example",
      "task_info": {
        "external_task_id": "example"
      },
      "task_result": {
        "videos": []
      },
      "task_status": "submitted",
      "task_status_msg": "example",
      "updated_at": 1
    },
    "message": "example",
    "request_id": "example"
  }
}
```

### Get lip sync task

Get lip sync task.

**Inputs**

- Task id (`task_id`, text): Task ID for Video Generation - Lip-Sync. Fill the value directly in the request path.

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "code": 0,
    "data": {
      "created_at": 1,
      "task_id": "example",
      "task_info": {
        "external_task_id": "example"
      },
      "task_result": {
        "videos": []
      },
      "task_status": "submitted",
      "task_status_msg": "example",
      "updated_at": 1
    },
    "message": "example",
    "request_id": "example"
  }
}
```

### Get multi image task

Get multi image task.

**Inputs**

- Task id (`task_id`, text): The task ID for image generation. Request path parameter, directly fill the value in the request path. Query by external_task_id or task_id. Use either task_id or external_task_id as the {id} path parameter; exactly one is required.
- External task id (`external_task_id`, text): Customized Task ID for image generation. Use either task_id or external_task_id as the {id} path parameter; exactly one is required.

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "code": 0,
    "data": {
      "created_at": 1,
      "task_id": "example",
      "task_info": {
        "external_task_id": "example"
      },
      "task_result": {
        "images": []
      },
      "task_status": "submitted",
      "task_status_msg": "example",
      "updated_at": 1
    },
    "message": "example",
    "request_id": "example"
  }
}
```

### Get text video task

Get text video task.

**Inputs**

- Task id (`task_id`, text): Task ID for text-to-video. Fill the value directly in the request path. Choose either task_id or external_task_id for querying. Use either task_id or external_task_id as the {id} path parameter; exactly one is required.
- External task id (`external_task_id`, text): Customized Task ID for text-to-video. Fill the value directly in the request path. Choose either task_id or external_task_id for querying. Use either task_id or external_task_id as the {id} path parameter; exactly one is required.

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "code": 0,
    "data": {
      "created_at": 1,
      "task_id": "example",
      "task_info": {
        "external_task_id": "example"
      },
      "task_result": {
        "videos": []
      },
      "task_status": "submitted",
      "task_status_msg": "example",
      "updated_at": 1
    },
    "message": "example",
    "request_id": "example"
  }
}
```

### Get usage

Get usage.

**Inputs**

- Start time (`start_time`, date and time, required): Start time.
- End time (`end_time`, date and time, required): End time.

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "code": 1,
    "data": {},
    "message": "example"
  }
}
```

### List extend video tasks

List extend video tasks.

**Inputs**

- Page Num (`pageNum`, number): Page number
- Page Size (`pageSize`, number): Number of items per page

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "code": 0,
    "data": [],
    "message": "example",
    "request_id": "example"
  }
}
```

### List image tasks

List image tasks.

**Inputs**

- Page Num (`pageNum`, number): Page number
- Page Size (`pageSize`, number): Number of items per page

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "code": 0,
    "data": [],
    "message": "example",
    "request_id": "example"
  }
}
```

### List image video tasks

List image video tasks.

**Inputs**

- Page Num (`pageNum`, number): Page number
- Page Size (`pageSize`, number): Data volume per page

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "code": 0,
    "data": [],
    "message": "example",
    "request_id": "example"
  }
}
```

### List lip sync tasks

List lip sync tasks.

**Inputs**

- Page Num (`pageNum`, number): Page number
- Page Size (`pageSize`, number): Number of items per page

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "code": 0,
    "data": [],
    "message": "example",
    "request_id": "example"
  }
}
```

### List multi image tasks

List multi image tasks.

**Inputs**

- Page Num (`pageNum`, number): Page number
- Page Size (`pageSize`, number): Number of items per page

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "code": 0,
    "data": [],
    "message": "example",
    "request_id": "example"
  }
}
```

### List text video tasks

List text video tasks.

**Inputs**

- Page Num (`pageNum`, number): Page number
- Page Size (`pageSize`, number): Number of items per page

**Outputs**

- `data` (object): Api result.

**Example output**

```json
{
  "data": {
    "code": 0,
    "data": [],
    "message": "example",
    "request_id": "example"
  }
}
```
