Create Video From Image Frames
April 18, 2025 (October 1, 2025)
Table of contents
This endpoint generates a video from one or two images (start and end frames).
https://api.useapi.net/v1/kling/videos/image2video-frames
Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
# Alternatively you can use multipart/form-data
# Content-Type: multipart/form-data
API tokenis required, see Setup useapi.net for details.
Request Body
{
"email": "[email protected]",
"image": "https://example.com/start-image.jpg",
"prompt": "A futuristic city with flying cars and tall buildings",
"negative_prompt": "people, low quality, distorted",
"duration": "10",
"model_name": "kling-v2-5",
"mode": "pro",
"replyUrl": "https://your-callback-url.com/webhook",
"replyRef": "your-reference-id"
}
-
emailis optional when only one account configured.
However, if you have multiple accounts configured, this parameter becomes required. -
imageis required ifimage_tailis not provided. URL to the start frame image. Required for models2.x.
Image can be uploaded using POST /assets and the returned URLs can be used here. -
image_tailis required ifimageis not provided. URL to the end frame image. Models2.1 Masterand2.5currently does not support this parameter. Image can be uploaded using POST /assets and the returned URLs can be used here. -
promptis optional, text description to guide the video generation.
Maximum length: 2500 characters. -
negative_promptis optional, what not to include in the generated video. Model2.5do not support this parameter.
Maximum length: 2500 characters. -
cfg_scaleis optional, guidance scale for image-to-video generation. Models2.xdo not support this parameter.
Range:0to1. Default:0.5. -
durationis optional, length of the video in seconds.
Supported values:5(default) or10. -
model_nameis optional, the AI model version to use.
Supported values:kling-v1-5,kling-v1-6,kling-v2-1-master,kling-v2-1(default),kling-v2-5 -
modeis optional, quality level. Models2.1 Masterand2.5currently does not support this parameter.
Supported values:std(standard, default) orpro(higher quality, slower generation). -
enable_audiois optional, add sound effects.
Supported values:false(default) ortrue. -
maxJobsis optional, range from1to50.
Specifies the maximum number of concurrent jobs. -
replyUrlis optional, a callback URL to receive generation progress and result.
See GET /tasks/task_idfor response model. -
replyRefis optional, a reference identifier for the callback.
Notes:
- At least one of
imageorimage_tailmust be provided. - If
image_tailprovided, the mode is automatically set topro.
Responses
-
{ "task": { "id": 123456789, "userId": 12345, "type": "m2v_img2video_hq", "scene": "NORMAL_CREATION", "status": 5, "status_name": "submitted", "status_final": false, "taskInfo": { "type": "m2v_img2video_hq", "inputs": [ { "name": "input", "inputType": "URL", "token": null, "blobStorage": null, "url": "https://example.com/start-image.jpg", "cover": null, "fromWorkId": null }, { "name": "tail_image", "inputType": "URL", "token": null, "blobStorage": null, "url": "https://example.com/end-image.jpg", "cover": null, "fromWorkId": null } ], "arguments": [ { "name": "prompt", "value": "A futuristic city with flying cars and tall buildings" }, { "name": "negative_prompt", "value": "people, low quality, distorted" }, { "name": "duration", "value": "5" }, { "name": "kling_version", "value": "2.1" }, { "name": "tail_image_enabled", "value": "true" } ], "extraArgs": {}, "callbackPayloads": [], "scene": "NORMAL_CREATION" }, "favored": false, "deleted": false, "viewed": false, "createTime": 1745376611075, "updateTime": 1745376611075 }, "works": [], "status": 5, "status_name": "submitted", "status_final": false, "message": "", "limitation": { "type": "m2v_img2video_hq", "remaining": 10000, "limit": 10000 }, "userPoints": { "points": [], "total": 0 }, "userTickets": { "ticket": [] }, "editProject": null } -
{ "error": "image or image_tail is required" } -
{ "error": "Unauthorized", "code": 401 } -
Kling was unable to locate one of the referenced assets. Make sure to use POST /assets to upload assets.
{ "error": "Sorry, the requested resource was not found (VALID.ResourceNotFound)", "message": "Not Found" } -
Kling uses a
500response to indicate moderation and other issues with the input. It may be hard to separate actual 500 errors from moderation errors, so use theerrorfield text and your best judgement to tell them apart, since themessagefield most often has very generic and perhaps misleading text.{ "error": "The content you uploaded appears to violate the community guidelines. (CM_EXT.POther)", "message": "Service busy (CM_EXT.POther)" }
When successful, the response includes a task ID which can be used to check the status using GET /tasks/task_id.
Model
{ // TypeScript, all fields are optional
task: {
id: number
userId: number
type: string
scene: string
status: number
status_name: 'submitted' | 'failed' | 'processing' | 'succeed'
status_final: boolean
taskInfo: {
type: string
inputs: Array<{
name: string
inputType: string
token: string | null
blobStorage: any | null
url: string
cover: string | null
fromWorkId: number | null
}>
arguments: Array<{
name: string
value: string
}>
extraArgs: Record<string, any>
callbackPayloads: any[]
scene: string
}
favored: boolean
deleted: boolean
viewed: boolean
createTime: number
updateTime: number
viewTime: number
}
works: Array<any>
status: number
status_name: 'submitted' | 'failed' | 'processing' | 'succeed'
status_final: boolean
message: string
error: string
limitation: {
type: string
remaining: number
limit: number
}
userPoints: {
points: Array<{
orderId: string
type: string
amount: number
balance: number
startTime: number
endTime: number
}>
total: number
}
userTickets: {
ticket: Array<{
orderId: string
type: string
packageType: string
amount: number
balance: number
startTime: number
endTime: number
}>
}
editProject: any | null
}
Examples
-
curl -X POST "https://api.useapi.net/v1/kling/videos/image2video-frames" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer …" \ -d '{ "email": "[email protected]", "image": "https://example.com/start-image.jpg", "image_tail": "https://example.com/end-image.jpg", "prompt": "A futuristic city with flying cars and tall buildings", "negative_prompt": "people, low quality, distorted" }' -
const token = "API token"; const email = "Previously configured account email"; const apiUrl = "https://api.useapi.net/v1/kling/videos/image2video-frames"; const response = await fetch(apiUrl, { method: "POST", headers: { "Content-Type": "application/json", "Authorization": `Bearer ${token}`, }, body: JSON.stringify({ email: email, image: "https://example.com/start-image.jpg", image_tail: "https://example.com/end-image.jpg", prompt: "A futuristic city with flying cars and tall buildings", negative_prompt: "people, low quality, distorted" }) }); const result = await response.json(); console.log("response", {response, result}); -
import requests token = "API token" email = "Previously configured account email" apiUrl = "https://api.useapi.net/v1/kling/videos/image2video-frames" headers = { "Content-Type": "application/json", "Authorization" : f"Bearer {token}" } data = { "email": email, "image": "https://example.com/start-image.jpg", "image_tail": "https://example.com/end-image.jpg", "prompt": "A futuristic city with flying cars and tall buildings", "negative_prompt": "people, low quality, distorted" } response = requests.post(apiUrl, headers=headers, json=data) print(response, response.json())