> ## 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 faces in a source video to set up a session for lip sync generation.

Identify Face is the **first step** of the Kling lip sync workflow. It analyzes the faces in a video and returns a `session_id` you must pass to the [Advanced Lip Sync](/guides/model-api/kuaishou/kling-lip-sync) endpoint.

## Workflow overview

```
identify-face  →  session_id  →  advanced-lip-sync  →  task_id  →  poll result
```

The `session_id` binds the video and its face analysis together. Without it, lip sync generation cannot proceed.

## Video requirements

For best results:

* The video must contain **at least one clearly visible human face** facing the camera
* Use a video where the face is well-lit and not heavily occluded
* The video must be accessible via a public URL, or use a `video_id` from a previous Kling generation result

## Quick example

<CodeGroup>
  ```bash cURL theme={null}
  curl https://www.anyfast.ai/kling/v1/videos/identify-face \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "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"}
  )

  data = response.json()
  session_id = data["data"]["session_id"]
  face_count = len(data["data"]["face_list"])
  print(f"Session ID: {session_id}  ({face_count} face(s) detected)")
  ```
</CodeGroup>

## Parameters

| Parameter   | Type   | Required | Description                      |
| ----------- | ------ | -------- | -------------------------------- |
| `video_url` | string | One of   | Public URL of the source video   |
| `video_id`  | string | One of   | ID of a video generated by Kling |

## Response

This endpoint is **synchronous** — the result is returned immediately without polling.

| Field                   | Description                                    |
| ----------------------- | ---------------------------------------------- |
| `data.session_id`       | Pass this to the lip sync endpoint             |
| `data.face_list[]`      | All detected faces in the video                |
| `face_list[].face_id`   | Identifier for each individual face            |
| `face_list[].face_rect` | Bounding box `{x, y, width, height}` in pixels |

If the video contains multiple people, `face_list` will include one entry per detected face.

<Card title="Next step: Advanced Lip Sync" icon="waveform" href="/guides/model-api/kuaishou/kling-lip-sync">
  Use the session\_id to generate a lip-synced video.
</Card>

<Card title="API Reference" icon="code" href="/api-reference/model-api/kuaishou/kling-identify-face">
  View the interactive API playground for Kling Identify Face.
</Card>

<script src="/feedback.js" />
