@image_1, @video_1, or custom @name tags.prompt as shown below:| Material | Reference syntax | Limit |
|---|---|---|
Reference images images | @image_1, @image_2, … | 10 images |
Reference videos videos | @video_1, @video_2, … | 5 videos, each 2–30 seconds, 30 seconds combined |
Elements elements | @name | 7 elements, of which at most 3 video elements |
Voices voices | @name | 3 voices |
image_N, video_N, first_frame, or last_frame.aspect_ratio is omitted, the ratio adapts to your materials if any are provided, and falls back to 16:9 when none are. When videos is provided, keep_original_sound controls whether the original audio is kept; when videos is omitted, native audio is enabled by default.callBackUrl parameter to receive automatic notifications when generation completes, rather than polling the status endpoint.curl --location 'https://api.kie.ai/api/v1/jobs/createTask' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "kling-4.0/reference-to-video",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"prompt": "@Hero sits at the desk in @video_1, picks up the doll from @image_1, and greets using @Narrator",
"duration": 10,
"resolution": "1080p",
"image_urls": [
"https://example.com/doll.png"
],
"video_urls": [
"https://example.com/room.mp4"
],
"keep_original_sound": false,
"elements": [
{
"name": "Hero",
"image_urls": [
"https://example.com/hero-front.jpg",
"https://example.com/hero-side.jpg"
],
"tag": "character",
"description": "Young man in a red jacket"
}
],
"voices": [
{
"name": "Narrator",
"audio_url": "https://example.com/narrator.mp3"
}
]
}
}'{
"code": 200,
"msg": "success",
"data": {
"taskId": "task_kling-4.0-reference-to-video_abc123"
}
}