﻿> ## Documentation Index
>
> Fetch the complete documentation index at: https://kling.ai/document-api/llms.txt
> Use this file to discover all available pages before exploring further.

# Face Recognition

> Source: https://kling.ai/document-api/api/video/lip-sync/face-detection
> Locale: en
> Current Tab: Face Recognition
> Sibling Tabs: Lip Sync / Face Recognition
> This content is optimized for LLMs. In-page tabs are expanded and UI-only controls are omitted.

---

## Identify Face

### API Overview

- Method: `POST`
- Path: `/v1/videos/identify-face`
- Auth: `Authorization: Bearer <API_KEY>`
- Content-Type: `application/json`

### Description

Identify faces in the video for lip-sync processing.

### Headers

| Field | Type | Required | Default | Enum | Description |
|---|---|---:|---|---|---|
| `Content-Type` | string | Yes | `application/json` | - | Data Exchange Format |
| `Authorization` | string | Yes | - | - | Authentication information, refer to API authentication |

### Request Body

| Field Path | Type | Required | Default | Enum | Description |
|---|---|---:|---|---|---|
| `video_id` | string | No | - | - | The ID of the video generated by Kling AI |
| `video_url` | string | No | - | - | The URL of the video |

#### Request Body Field Notes

- `video_id`: Used to specify the video and determine whether it can be used for lip-sync services.
- `video_id`: This parameter and 'video_url' are mutually exclusive—only one can be filled, and neither can be left empty.
- `video_id`: Only supports videos generated within the last 30 days with a duration of no more than 60 seconds.
- `video_url`: Used to specify the video and determine whether it can be used for lip-sync services.
- `video_url`: This parameter and 'video_id' are mutually exclusive—only one can be filled, and neither can be left empty.
- `video_url`: Supported video formats: .mp4/.mov, file size ≤100MB, duration 2s–60s, resolution 720p or 1080p, with both width and height between 512px–2160px. If validation fails, an error code will be returned.
- `video_url`: The system validates video content and returns an error code if any issues are detected.

### Request Example

```bash
curl --request POST \
  --url https://api-singapore.klingai.com/v1/videos/identify-face \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "video_url": "https://p1-kling.klingai.com/kcdn/cdn-kcdn112452/kling-qa-test/kling20260206mp4.mp4",
    "video_id": ""
  }'
```

### Response Example

```json
{
  "code": 0, // Error codes; Specific definitions can be found in "Error Code"
  "message": "string", // Error information
  "request_id": "string", // Request ID, generated by the system, used to track requests and troubleshoot problems
  "data": {
    "session_id": "id", // Session ID
    "final_unit_deduction": "string", // The deduction units of task
    "final_balance_deduction": { // Balance deduction information
      "quota": "string", // Balance deduction discount price
      "list_price": "string" // Balance deduction list price
    },
    "face_data": [ //Face data list
      {
        "face_id": "string", // Face ID
        "face_image": "url", // Face image URL
        "start_time": 0, // Face appearance start time, unit: ms
        "end_time": 5200 //Face appearance end time, unit: ms
      }
    ]
  }
}
```
