Kling 2.6
curl --request POST \
--url https://whollyapi.com/api/v1/jobs/createTask \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": {
"image_urls": [
"<string>"
],
"prompt": "<string>",
"sound": true,
"duration": "<string>"
}
}
'import requests
url = "https://whollyapi.com/api/v1/jobs/createTask"
payload = {
"model": "<string>",
"input": {
"image_urls": ["<string>"],
"prompt": "<string>",
"sound": True,
"duration": "<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: {
image_urls: ['<string>'],
prompt: '<string>',
sound: true,
duration: '<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' => [
'image_urls' => [
'<string>'
],
'prompt' => '<string>',
'sound' => true,
'duration' => '<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 \"image_urls\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"sound\": true,\n \"duration\": \"<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 \"image_urls\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"sound\": true,\n \"duration\": \"<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 \"image_urls\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"sound\": true,\n \"duration\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 123,
"msg": "<string>",
"data": {
"taskId": "<string>"
}
}Kling
Kling 2.6
POST
/
api
/
v1
/
jobs
/
createTask
Kling 2.6
curl --request POST \
--url https://whollyapi.com/api/v1/jobs/createTask \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": {
"image_urls": [
"<string>"
],
"prompt": "<string>",
"sound": true,
"duration": "<string>"
}
}
'import requests
url = "https://whollyapi.com/api/v1/jobs/createTask"
payload = {
"model": "<string>",
"input": {
"image_urls": ["<string>"],
"prompt": "<string>",
"sound": True,
"duration": "<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: {
image_urls: ['<string>'],
prompt: '<string>',
sound: true,
duration: '<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' => [
'image_urls' => [
'<string>'
],
'prompt' => '<string>',
'sound' => true,
'duration' => '<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 \"image_urls\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"sound\": true,\n \"duration\": \"<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 \"image_urls\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"sound\": true,\n \"duration\": \"<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 \"image_urls\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"sound\": true,\n \"duration\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 123,
"msg": "<string>",
"data": {
"taskId": "<string>"
}
}Generate videos from a single input image using the
Use the
kling-2.6/image-to-video model.
Authentication
All API requests require a Bearer Token.Authorization: Bearer YOUR_API_KEY
Create Video Task
Submit an image-to-video generation task using the following endpoint:POST /api/v1/jobs/createTask
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Must be kling-2.6/image-to-video. |
input | object | Yes | Input parameters for the video generation task. |
string
required
Must be
grok-imagine/image-to-video.object
required
Input parameters for the video generation task.
string[]
External reference image URLs. Supports JPEG, PNG, and WEBP. Each image can be up to 10 MB. Do not use together with
task_id.Use @image(n) in the prompt to reference an uploaded image, for example @image1 a sunset over the ocean.Only one image is supported at 1080p. Spicy mode is unavailable when using external images.string
Optional English-language prompt describing motion, actions, camera work, timing, environment, and motion dynamics. Maximum length: 5000 characters.
boolean
default:"false"
This parameter specifies whether the generated video contains sound (boolean: true/false)
string
Generated video duration in seconds. Supported values:
5, 10.Example Request
{
"model": "kling-2.6/image-to-video",
"input": {
"prompt": "In a bright rehearsal room, sunlight streams through the windows, and a standing microphone is placed in the center of the room.",
"image_urls": [
"https://demo.com/176485100274.png"
],
"sound": false,
"duration": "5"
}
}
Response
Successful Response
A successful task creation 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 to query the task status and retrieve generation results.
Get Task Details
Learn how to query task status and obtain generation results.
Error Response
{
"code": 500,
"msg": "Server Error - An unexpected error occurred while processing the request",
"data": null
}
Response Codes
| Code | Status | Description |
|---|---|---|
200 | Success | Request was processed successfully. |
401 | Unauthorized | Authentication credentials are missing or invalid. |
402 | Insufficient Credits | Account does not have enough credits. |
404 | Not Found | The requested endpoint does not exist. |
422 | Validation Error | Request parameters failed validation. |
429 | Rate Limited | Request limit has been exceeded. |
433 | Request Limit | Sub-key usage exceeds the allowed limit. |
455 | Service Unavailable | The system is undergoing maintenance. |
500 | Server Error | An unexpected server error occurred. |
501 | Generation Failed | The content generation task failed. |
505 | Feature Disabled | The requested feature is currently disabled. |
