Introduction
Kling Avatar 2.0 Talking avatar takes a portrait (image_url) and an audio file of speech or song (audio_url) and returns a video of that person delivering the audio. The clip's length is set by the audio itself - there is no separate duration field - up to roughly 5 minutes. An optional prompt directs mood, gestures and where the eyes go, separately from what the audio says.
Key features & highlights
The audio sets the length
There is no duration parameter on this endpoint: trim your audio to the length you want the finished clip to run before you send it. Both speech and singing work as source audio.
The prompt directs the performance, the audio drives the words
prompt is optional and describes how the performance should feel - a mood, a gesture, where the eyes go - while audio_url supplies what is actually said or sung. Keeping the two separate is what let our test clips match delivered dialogue to the source audio word for word while still following a specific direction.
Request parameters
| Parameter | Required | Description |
|---|---|---|
prompt | No | Optional direction for the performance: mood, gestures, where the eyes go. Separate from what the audio says. at most 2500 characters |
image_url | Yes | Portrait to animate. JPEG or PNG only. |
audio_url | Yes | Speech or song the avatar performs. The clip is exactly as long as this audio - there is no separate duration field. |
resolution | No | 720p or 1080p. 1080p costs more per second of audio. |
Pricing
Billed per second of the audio you send, at the resolution you choose. A portrait or request Kling refuses isn't charged.
| Specification | Price |
|---|---|
| $0.0512 / second |
| $0.1024 / second |
Use cases
Give a script a face
Pair a recorded or generated line with a portrait to produce a spoken clip - useful for narrated intros, testimonials, or dialogue for a character whose face you've already settled on.
Direct a sung performance from a still photo
Send a sung audio track alongside a portrait and a short prompt describing the performance (audience, energy, a hand gesture) rather than the words themselves.
Prompt guide & pro tips
Write an arc, not a single mood
A direction like "glancing down once, then back into the lens with a shy laugh at the end" gives the avatar a small sequence to perform, rather than holding one static expression across the whole clip.
Choose a clear, front-facing portrait
A well-lit, front-facing photo gives the most reliable lip sync and expression. Side angles, obscured faces or extreme close-crops are more likely to drift as the clip runs.
Expect the clip to run a touch longer than the audio
In our tests the finished video consistently ran a little longer than the source audio - an 11.4-second line came back as a 12.27-second clip - so build in a small pad rather than expecting frame-exact timing at the very end. Billing follows the audio length, not the finished clip.
Trim silence off both ends of the audio
A file that opens or closes on a long pause gives the avatar dead time with nothing to perform. Trim the audio close to where the speech or singing actually starts and ends before you send it.
API quick start
# Generate the idempotency key once; reuse it when retrying after a lost response.
export SPICY_IDEMPOTENCY_KEY="${SPICY_IDEMPOTENCY_KEY:-$(uuidgen)}"
curl -X POST https://api.spicyapi.ai/api/v1/jobs/createTask \
-H "Authorization: Bearer $SPICY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $SPICY_IDEMPOTENCY_KEY" \
-d '{
"model": "kling/avatar-2.0/talking-avatar",
"input": {
"audio_url": "https://example.com/reference.mp3",
"image_url": "https://example.com/reference.png",
"prompt": "A slow aerial shot drifting over a misty pine forest at sunrise",
"resolution": "720p"
}
}'
# Copy data.taskId from the response into TASK_ID, then poll the status.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.spicyapi.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
-H "Authorization: Bearer $SPICY_API_KEY"
See the API reference for authentication, the complete schema, polling, and error handling.











