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

# Kling Identify Face

> Detect the usable face interval in a source video and create a session for Kling Lip Sync.

Identify Face is the synchronous prerequisite for [Kling Lip Sync](https://docs.anyfast.ai/guides/model-api/kling/kling-lip-sync.md). It checks the source video, detects faces, and returns the `session_id`, `face_id`, and time range required by the lip-sync request.

## Input options

Provide exactly one source:

| Field | Description |
| - | - |
| `video_url` | Public URL of an MP4 or MOV file |
| `video_id` | ID of a Kling-generated video created within the last 30 days |

For `video_url`, the video must be 2–60 seconds, no more than 100 MB, 720p or 1080p, and between 512 px and 2,160 px on each side. Use a video with a clear, visible human face and minimal occlusion.

## Identify a face

```bash cURL theme={null}
curl --request POST \
  --url https://www.anyfast.ai/kling/v1/videos/identify-face \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "video_url": "https://example.com/person-speaking.mp4"
  }'
```

```python Python theme={null}
import requests

response = requests.post(
    "https://www.anyfast.ai/kling/v1/videos/identify-face",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={"video_url": "https://example.com/person-speaking.mp4"},
)
response.raise_for_status()
result = response.json()

session_id = result["data"]["session_id"]
face = result["data"]["face_data"][0]
print(session_id, face["face_id"], face["start_time"], face["end_time"])
```

## Read the response

The response is synchronous. You do not need to poll it.

| Field | Description |
| - | - |
| `data.session_id` | Session that binds the source video to its face analysis |
| `data.face_data[]` | Detected faces and their usable time intervals |
| `data.face_data[].face_id` | Face ID to pass as `face_choose[].face_id` |
| `data.face_data[].face_image` | Preview image of the detected face |
| `data.face_data[].start_time` | Start of the usable face interval, in milliseconds |
| `data.face_data[].end_time` | End of the usable face interval, in milliseconds |
| `data.final_unit_deduction` | Final Kling unit deduction for face identification |

When several faces are returned, select the one whose time interval overlaps the speech segment you plan to insert. Kling Lip Sync currently accepts one selected face.

> [card] [Next: Kling Lip Sync](https://docs.anyfast.ai/guides/model-api/kling/kling-lip-sync.md)
>
> Use the session ID and face ID to create a lip-sync task.

> [card] [Identify Face API Reference](https://docs.anyfast.ai/api-reference/model-api/kling/kling-identify-face.md)
>
> Review the complete request and response schema.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.