Create Video From Image with Effects
April 18, 2025
Table of contents
This endpoint generates a video from an image using special effects.
https://api.useapi.net/v1/kling/videos/image2video-effects
Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
# Alternatively you can use multipart/form-data
# Content-Type: multipart/form-data
API token
is required, see Setup useapi.net for details.
Request Body
{
"email": "[email protected]",
"effect": "rocket",
"image": "https://example.com/image.jpg",
"image_tail": "https://example.com/image-tail.jpg",
"prompt": "A detailed description for the effect",
"replyUrl": "https://your-callback-url.com/webhook",
"replyRef": "your-reference-id"
}
-
email
is optional when only one account configured.
However, if you have multiple accounts configured, this parameter becomes required. -
effect
is required, the name of the effect to apply.
Get available effects from GET /videos/effects. -
image
is required, URL to the image to animate.
Images can be uploaded using POST /assets and the returned URLs can be used here. -
image_tail
is optional, URL to the end frame image.
Required for some effects that supportcompositedSchema
. Images can be uploaded using POST /assets. -
prompt
is optional, text description to guide the effect.
Required for some effects that supportcompositedSchema
. Maximum length: 2500 characters. -
maxJobs
is optional, range from1
to10
.
Specifies the maximum number of concurrent jobs. -
replyUrl
is optional, a callback URL to receive results when completed. -
replyRef
is optional, a reference identifier for the callback.
Notes:
- Different effects have different requirements. Check the response from GET /videos/effects to see if an effect supports tail images and prompts.
- Effects with a
compositedSchema
typically require bothimage_tail
andprompt
parameters. - Effects without a
compositedSchema
only support a singleimage
parameter.
Responses
-
{ "id": 12345678, "created": 1712345678000, "status": "submitted", "status_final": false, "type": "m2v_img2video_se_hq", "taskInfo": { "inputs": [ { "name": "input", "url": "https://example.com/image.jpg" }, { "name": "tail_image", "url": "https://example.com/image-tail.jpg" } ], "arguments": [ { "name": "special_effect", "value": "rocket" }, { "name": "prompt", "value": "A detailed description for the effect" }, { "name": "kling_version", "value": "1.6" }, { "name": "tail_image_enabled", "value": "true" } ] }, "scheduled": true }
-
{ "error": "Effect rocket not found. Supported effects: cartoon,cyberpunk,spinoff" }
-
{ "error": "Unauthorized", "code": 401 }
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
id: number // Task ID
created: number // Creation timestamp in milliseconds
status: string // Task status: "submitted", "processing", "failed", or "succeed"
status_final: boolean // Whether this is the final status of the task
type: string // Task type, typically "m2v_img2video_se_hq"
taskInfo: {
inputs: Array<{
name: string // Input name ("input" or "tail_image")
url: string // Input URL
}>
arguments: Array<{
name: string // Argument name
value: string // Argument value
}>
}
scheduled: boolean // Whether the task is scheduled
}
Examples
-
curl -X POST "https://api.useapi.net/v1/kling/videos/image2video-effects" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer …" \ -d '{ "email": "[email protected]", "effect": "rocket", "image": "https://example.com/image.jpg", "image_tail": "https://example.com/image-tail.jpg", "prompt": "A detailed description for the effect" }'
-
const token = "API token"; const email = "Previously configured account email"; const apiUrl = "https://api.useapi.net/v1/kling/videos/image2video-effects"; const response = await fetch(apiUrl, { method: "POST", headers: { "Content-Type": "application/json", "Authorization": `Bearer ${token}`, }, body: JSON.stringify({ email: email, effect: "rocket", image: "https://example.com/image.jpg", image_tail: "https://example.com/image-tail.jpg", prompt: "A detailed description for the effect" }) }); 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-effects" headers = { "Content-Type": "application/json", "Authorization" : f"Bearer {token}" } data = { "email": email, "effect": "rocket", "image": "https://example.com/image.jpg", "image_tail": "https://example.com/image-tail.jpg", "prompt": "A detailed description for the effect" } response = requests.post(apiUrl, headers=headers, json=data) print(response, response.json())