Kling V2.5 Turbo Image to Video Pro
curl --request POST \
--url https://whollyapi.com/api/v1/jobs/createTask \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": {
"prompt": "<string>",
"image_url": "<string>",
"tail_image_url": "<string>",
"duration": "<string>",
"negative_prompt": "<string>",
"cfg_scale": "<string>"
}
}
'import requests
url = "https://whollyapi.com/api/v1/jobs/createTask"
payload = {
"model": "<string>",
"input": {
"prompt": "<string>",
"image_url": "<string>",
"tail_image_url": "<string>",
"duration": "<string>",
"negative_prompt": "<string>",
"cfg_scale": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
input: {
prompt: '<string>',
image_url: '<string>',
tail_image_url: '<string>',
duration: '<string>',
negative_prompt: '<string>',
cfg_scale: '<string>'
}
})
};
fetch('https://whollyapi.com/api/v1/jobs/createTask', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://whollyapi.com/api/v1/jobs/createTask",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'input' => [
'prompt' => '<string>',
'image_url' => '<string>',
'tail_image_url' => '<string>',
'duration' => '<string>',
'negative_prompt' => '<string>',
'cfg_scale' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://whollyapi.com/api/v1/jobs/createTask"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input\": {\n \"prompt\": \"<string>\",\n \"image_url\": \"<string>\",\n \"tail_image_url\": \"<string>\",\n \"duration\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"cfg_scale\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://whollyapi.com/api/v1/jobs/createTask")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"input\": {\n \"prompt\": \"<string>\",\n \"image_url\": \"<string>\",\n \"tail_image_url\": \"<string>\",\n \"duration\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"cfg_scale\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://whollyapi.com/api/v1/jobs/createTask")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"input\": {\n \"prompt\": \"<string>\",\n \"image_url\": \"<string>\",\n \"tail_image_url\": \"<string>\",\n \"duration\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"cfg_scale\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 123,
"msg": "<string>",
"data": {
"taskId": "<string>"
}
}Kling
Kling V2.5 Turbo Image to Video Pro
POST
/
api
/
v1
/
jobs
/
createTask
Kling V2.5 Turbo Image to Video Pro
curl --request POST \
--url https://whollyapi.com/api/v1/jobs/createTask \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": {
"prompt": "<string>",
"image_url": "<string>",
"tail_image_url": "<string>",
"duration": "<string>",
"negative_prompt": "<string>",
"cfg_scale": "<string>"
}
}
'import requests
url = "https://whollyapi.com/api/v1/jobs/createTask"
payload = {
"model": "<string>",
"input": {
"prompt": "<string>",
"image_url": "<string>",
"tail_image_url": "<string>",
"duration": "<string>",
"negative_prompt": "<string>",
"cfg_scale": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
input: {
prompt: '<string>',
image_url: '<string>',
tail_image_url: '<string>',
duration: '<string>',
negative_prompt: '<string>',
cfg_scale: '<string>'
}
})
};
fetch('https://whollyapi.com/api/v1/jobs/createTask', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://whollyapi.com/api/v1/jobs/createTask",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'input' => [
'prompt' => '<string>',
'image_url' => '<string>',
'tail_image_url' => '<string>',
'duration' => '<string>',
'negative_prompt' => '<string>',
'cfg_scale' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://whollyapi.com/api/v1/jobs/createTask"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input\": {\n \"prompt\": \"<string>\",\n \"image_url\": \"<string>\",\n \"tail_image_url\": \"<string>\",\n \"duration\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"cfg_scale\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://whollyapi.com/api/v1/jobs/createTask")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"input\": {\n \"prompt\": \"<string>\",\n \"image_url\": \"<string>\",\n \"tail_image_url\": \"<string>\",\n \"duration\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"cfg_scale\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://whollyapi.com/api/v1/jobs/createTask")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"input\": {\n \"prompt\": \"<string>\",\n \"image_url\": \"<string>\",\n \"tail_image_url\": \"<string>\",\n \"duration\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"cfg_scale\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 123,
"msg": "<string>",
"data": {
"taskId": "<string>"
}
}Generate high-quality videos from a source image using the
The returned
kling/v2-5-turbo-image-to-video-pro model.
Endpoint
POST /api/v1/jobs/createTask
Authentication
All API requests require a Bearer Token.Authorization: Bearer YOUR_API_KEY
Create a Video Generation Task
Submit an image-to-video generation task using the endpoint below.POST /api/v1/jobs/createTask
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The model used for generation. |
input | object | Yes | Input parameters for the video generation task. |
string
required
Must be
grok-imagine/image-to-video.object
required
Input Parameters
Theinput object contains the parameters used to generate the video.string
required
The
prompt describes the video you want to generate.Maximum length: 2500 characters.string
required
The
image_url must contain the URL of an uploaded image.Supported formats:image/jpegimage/png
10 MBstring
You can optionally provide
tail_image_url as the desired tail frame of the video.The image must be an uploaded file URL.Supported formats:image/jpegimage/png
10 MBstring
The duration of the generated video in seconds.Supported values:
"5""10"
"5"string
Use
negative_prompt to describe elements or qualities that should be excluded from the generated video.Maximum length: 500 characters.string
The
cfg_scale parameter controls how closely the model follows the prompt.| Setting | Value |
|---|---|
| Minimum | 0 |
| Maximum | 1 |
| Step | 0.1 |
| Default | 0.5 |
Example Request
{
"model": "kling/v2-5-turbo-image-to-video-pro",
"input": {
"prompt": "A team of paratroopers descends into enemy territory, as they pass through clouds, the camera switches to a slow pan above the battlefield.",
"image_url": "https://demo.com/1755256297923.png",
"duration": "5",
"negative_prompt": "blur, distort, and low quality",
"cfg_scale": 0.5
}
}
Response
Successful Response
A successful request returns a task ID.number
Response status code.
string
Response message. Contains the error description when the request fails.Example:
successobject
required
The task data object containing task id.
string
required
The unique identifier for this task.Example:
task_123456taskId can be used with the Get Task Details endpoint to check the generation status and retrieve the results.
Get Task Details
Learn how to query task status and retrieve generation results.
Error Response
{
"code": 500,
"msg": "Server Error - An unexpected error occurred while processing the request",
"data": null
}
API Response Codes
| Code | Status | Description |
|---|---|---|
200 | Success | Request processed successfully. |
401 | Unauthorized | Authentication credentials are missing or invalid. |
402 | Insufficient Credits | The account does not have enough credits. |
404 | Not Found | The requested resource or endpoint does not exist. |
422 | Validation Error | Request parameters failed validation checks. |
429 | Rate Limited | The request limit has been exceeded. |
433 | Request Limit | Sub-key usage exceeds the allowed limit. |
455 | Service Unavailable | The system is currently undergoing maintenance. |
500 | Server Error | An unexpected error occurred while processing the request. |
501 | Generation Failed | The content generation task failed. |
505 | Feature Disabled | The requested feature is currently disabled. |
