Digital Human Video
This document explains how to use Kling Avatar v2 async digital human video generationEndpoint.
Supported models:
| Model name | Type | Suitable scenarios | Billing mode |
|---|---|---|---|
kling-avatar-v2-standard | digital human video | standard narration, customer-service explanation, course introduction, marketing short video | billed by output video duration |
kling-avatar-v2-pro | digital human video | higher-quality digital-human narration, formal promotional video, brand video, important course content | billed by output video duration |
Endpoint async task mode:
| Operation | Method | Path |
|---|---|---|
| submitdigital human videotask | POST | /v1/video/generations |
| querydigital human videotask | GET | /v1/video/generations/{task_id} |
1. Authentication
Endpoint requires request headers API Key:
Authorization: Bearer sk-xxxxxxxxxxxxxxxx
Content-Type: application/json
Example:
https:
2. Model overview
Kling Avatar v2 imageandaudio generationdigital human video. userrequiresprovidesone imageandaaudio, Model generation and action video.
supports:
| Model | Note |
|---|---|
kling-avatar-v2-standard | standard, standard narrationand generation |
kling-avatar-v2-pro | Pro, stable |
3. submitdigital human videotask
POST https://api.xxx.xx/v1/video/generations
3.1 Request Parameters
| Parameters | Type | Required | Note |
|---|---|---|---|
model | string | Yes | kling-avatar-v2-standard or kling-avatar-v2-pro |
image_url | string | Yes | image URL |
audio_url | string | Yes | audio URL, |
audio_duration_seconds | number | Yes | audioduration, submit billing |
prompt | string | No | style, scenario, Status, camera |
Note:
audio_duration_secondspass.- Field submit, billing.
- pass inaudio duration, cost and task.
3.2 submitResponse Examples
{
"id": "task_xxxxxxxxxxxxx",
"task_id": "task_xxxxxxxxxxxxx",
"object": "video.generation.job",
"status": "queued"
}
Field Reference:
| Field | Note |
|---|---|
id/task_id | async task ID, query result |
status | task status, value queued, processing, completed, failed |
4. querydigital human videotask
GET https://api.xxx.xx/v1/video/generations/{task_id}
queryExample:
curl -X GET "https://api.xxx.xx/v1/video/generations/task_xxxxxxxxxxxxx" \
-H "Authorization: Bearer sk-xxxxxxxxxxxxxxxx"
Completed Response Example:
{
"id": "task_xxxxxxxxxxxxx",
"task_id": "task_xxxxxxxxxxxxx",
"object": "video.generation.job",
"status": "completed",
"video_url": "https://api.xxx.xx/media/xxxxx.mp4",
"result": {
"outputs": [
"https://api.xxx.xx/media/xxxxx.mp4"
]
}
}
5. Request Examples
5.1 Standard generationcustomer-service explanationvideo
curl -X POST "https://api.xxx.xx/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"model": "kling-avatar-v2-standard",
"image_url": "https://cdn.example.com/avatar/customer-service.png",
"audio_url": "https://cdn.example.com/audio/customer-intro.mp3",
"audio_duration_seconds": 12,
"prompt": "friendly customer service presenter, natural expression, clean studio lighting"}'
5.2 Standard generationcourse introduction
curl -X POST "https://api.xxx.xx/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"model": "kling-avatar-v2-standard",
"image_url": "https://cdn.example.com/avatar/teacher.png",
"audio_url": "https://cdn.example.com/audio/course-opening.mp3",
"audio_duration_seconds": 18.5,
"prompt": "professional teacher, warm smile, stable camera, natural lip sync"}'
5.3 Pro generation video
curl -X POST "https://api.xxx.xx/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"model": "kling-avatar-v2-pro",
"image_url": "https://cdn.example.com/avatar/brand-host.png",
"audio_url": "https://cdn.example.com/audio/brand-message.mp3",
"audio_duration_seconds": 24,
"prompt": "premium corporate spokesperson video, clean studio background, confident expression"}'
5.4 Pro generationnews broadcast
curl -X POST "https://api.xxx.xx/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"model": "kling-avatar-v2-pro",
"image_url": "https://cdn.example.com/avatar/news-anchor.png",
"audio_url": "https://cdn.example.com/audio/news-briefing.mp3",
"audio_duration_seconds": 32.7,
"prompt": "news anchor style, formal tone, stable frontal shot, neutral expression"}'
6. Common Errors
6.1 image_url
digital human video provides image:
{
"image_url": "https://cdn.example.com/avatar.png"
}
6.2 audio_url
digital human video provides audio:
{
"audio_url": "https://cdn.example.com/voice.mp3"
}
6.3 audio_duration_seconds
Error:
{
"model": "kling-avatar-v2-standard",
"image_url": "https://cdn.example.com/avatar.png",
"audio_url": "https://cdn.example.com/voice.mp3"
}
audioduration:
{
"audio_duration_seconds": 12.5
}
7. recommended
- image.
- use TTS or generate aaudio.
- audio duration.
- submit
/v1/video/generations, pass inimage_url,audio_url,audio_duration_seconds. - poll
/v1/video/generations/{task_id}. - task completed read
video_url.
8. Minimum Valid Request
8.1 Avatar Standard
curl -X POST "https://api.xxx.xx/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"model": "kling-avatar-v2-standard",
"image_url": "https://cdn.example.com/avatar.png",
"audio_url": "https://cdn.example.com/voice.mp3",
"audio_duration_seconds": 10}'
8.2 Avatar Pro
curl -X POST "https://api.xxx.xx/v1/video/generations" \
-H "Authorization: Bearer sk-xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"model": "kling-avatar-v2-pro",
"image_url": "https://cdn.example.com/avatar.png",
"audio_url": "https://cdn.example.com/voice.mp3",
"audio_duration_seconds": 10}'