Kling Video v2.6 Motion Control API Documentation

Kling Video v2.6 Standard Motion Control generate request - Request Code

POST https://gateway.pixazo.ai/kling-video-v2-6-standard-motion-control/v1/kling-video-v2-6-standard-motion-control-request Content-Type: application/json Cache-Control: no-cache Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY { "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/motion.jpg", "video_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/motion.mp4", "character_orientation": "video", "keep_original_sound": true }
import requests url = "https://gateway.pixazo.ai/kling-video-v2-6-standard-motion-control/v1/kling-video-v2-6-standard-motion-control-request" headers = { "Content-Type": "application/json", "Cache-Control": "no-cache", "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY" } data = { "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/motion.jpg", "video_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/motion.mp4", "character_orientation": "video", "keep_original_sound": true } response = requests.post(url, headers=headers, json=data) print(response.json())
const url = 'https://gateway.pixazo.ai/kling-video-v2-6-standard-motion-control/v1/kling-video-v2-6-standard-motion-control-request'; const data = { image_url: 'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/motion.jpg', video_url: 'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/motion.mp4', character_orientation: 'video', keep_original_sound: true }; fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Cache-Control': 'no-cache', 'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY' }, body: JSON.stringify(data) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error));
curl -X POST "https://gateway.pixazo.ai/kling-video-v2-6-standard-motion-control/v1/kling-video-v2-6-standard-motion-control-request" \ -H "Content-Type: application/json" \ -H "Cache-Control: no-cache" \ -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \ --data-raw '{ "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/motion.jpg", "video_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/motion.mp4", "character_orientation": "video", "keep_original_sound": true }'
import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; public class ApiExample { public static void main(String[] args) throws Exception { String url = "https://gateway.pixazo.ai/kling-video-v2-6-standard-motion-control/v1/kling-video-v2-6-standard-motion-control-request"; String json = "{\n" + " \"image_url\": \"https://pub-582b7213209642b9b995c96c95a30381.r2.dev/motion.jpg\",\n" + " \"video_url\": \"https://pub-582b7213209642b9b995c96c95a30381.r2.dev/motion.mp4\",\n" + " \"character_orientation\": \"video\",\n" + " \"keep_original_sound\": true\n" + "}"; HttpClient client = HttpClient.newBuilder() .connectTimeout(Duration.ofSeconds(10)) .build(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(url)) .header("Content-Type", "application/json") .header("Cache-Control", "no-cache") .header("Ocp-Apim-Subscription-Key", "YOUR_SUBSCRIPTION_KEY") .POST(HttpRequest.BodyPublishers.ofString(json)) .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } }
<?php $url = 'https://gateway.pixazo.ai/kling-video-v2-6-standard-motion-control/v1/kling-video-v2-6-standard-motion-control-request'; $data = [ 'image_url' => 'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/motion.jpg', 'video_url' => 'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/motion.mp4', 'character_orientation' => 'video', 'keep_original_sound' => true ]; $json = json_encode($data); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $json); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'Cache-Control: no-cache', 'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY' ]); $response = curl_exec($ch); curl_close($ch); echo $response; ?>

Output

Successful API response:

{ "status": "IN_QUEUE", "request_id": "5aefcXXX-XXXXX-XXXX-XXXX-XXXXXXXX", "message": "Motion transfer job queued successfully" }

Request Body - Kling Video v2.6 Standard Motion Control generate request

Parameters for https://gateway.pixazo.ai/kling-video-v2-6-standard-motion-control/v1/kling-video-v2-6-standard-motion-control-request:

ParameterRequiredTypeDescription
image_urlYesstringURL pointing to the static character image (JPEG/PNG) to which motion will be transferred. Must be publicly accessible.
video_urlYesstringURL pointing to the reference video containing the motion to transfer (MP4). Must be publicly accessible and under 10 seconds.
character_orientationNostringSpecifies how the character in the image should align with the video motion. Use "video" to match the video's orientation or "image" to match the image's orientation.
keep_original_soundNobooleanIf true, preserves the audio from the reference video in the output. If false, output will be silent.

Example Request - Kling Video v2.6 Standard Motion Control generate request

JSON
{ "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/motion.jpg", "video_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/motion.mp4", "character_orientation": "video", "keep_original_sound": true }

Response - Kling Video v2.6 Standard Motion Control generate request

JSON
{ "status": "IN_QUEUE", "request_id": "5aefcXXX-XXXXX-XXXX-XXXX-XXXXXXXX", "message": "Motion transfer job queued successfully" }

Request Headers

HeaderDescription
Content-TypeMust be set to application/json
Cache-ControlMust be set to no-cache
Ocp-Apim-Subscription-KeyAPI subscription key for authentication

Response Handling

The Kling Video v2.6 Standard Motion Control returns specific HTTP status codes and response bodies to indicate the success or failure of a request. Developers should implement error handling in their applications to manage these responses effectively.

Common Status Codes and Responses

Status CodeDescriptionResponse Body
200Success - The request was successfully processed.{ "success": true, ... }
Bad Request - The request contains invalid parameters or missing fields.{ "error": "Invalid request parameters" }
401Unauthorized - The provided subscription key is missing or invalid.{ "error": "Invalid or missing authentication" }
403Forbidden - The subscription does not have access to this API or action.{ "error": "Access denied for this operation" }
404Not Found - The requested resource or endpoint could not be found.{ "error": "Endpoint not found" }
Too Many Requests - The request rate limit has been exceeded.{ "error": "Rate limit exceeded, please retry later" }
500Internal Server Error - An unexpected error occurred on the server.{ "error": "An unexpected error occurred, please try again later" }

Example Error Response

{ "error": "Invalid parameters" }

Retrieving Results

After submitting your request, use this endpoint to check status and retrieve results.

Endpoint

POST https://gateway.pixazo.ai/kling-video-v2-6-standard-motion-control/v1/kling-video-v2-6-standard-motion-control-request-result

Request Body

{ "request_id": "5aefcXXX-XXXXX-XXXX-XXXX-XXXXXXXX" }

Example Polling Request

POST https://gateway.pixazo.ai/kling-video-v2-6-standard-motion-control/v1/kling-video-v2-6-standard-motion-control-request-result Content-Type: application/json Cache-Control: no-cache Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY { "request_id": "5aefcXXX-XXXXX-XXXX-XXXX-XXXXXXXX" }
import requests url = "https://gateway.pixazo.ai/kling-video-v2-6-standard-motion-control/v1/kling-video-v2-6-standard-motion-control-request-result" headers = { "Content-Type": "application/json", "Cache-Control": "no-cache", "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY" } data = { "request_id": "5aefcXXX-XXXXX-XXXX-XXXX-XXXXXXXX" } response = requests.post(url, headers=headers, json=data) print(response.json())
const url = 'https://gateway.pixazo.ai/kling-video-v2-6-standard-motion-control/v1/kling-video-v2-6-standard-motion-control-request-result'; const data = { request_id: '5aefcXXX-XXXXX-XXXX-XXXX-XXXXXXXX' }; fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Cache-Control': 'no-cache', 'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY' }, body: JSON.stringify(data) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error));
curl -X POST "https://gateway.pixazo.ai/kling-video-v2-6-standard-motion-control/v1/kling-video-v2-6-standard-motion-control-request-result" \ -H "Content-Type: application/json" \ -H "Cache-Control: no-cache" \ -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \ --data-raw '{ "request_id": "5aefcXXX-XXXXX-XXXX-XXXX-XXXXXXXX" }'
import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; public class PollingExample { public static void main(String[] args) throws Exception { String url = "https://gateway.pixazo.ai/kling-video-v2-6-standard-motion-control/v1/kling-video-v2-6-standard-motion-control-request-result"; String json = "{\n" + " \"request_id\": \"5aefcXXX-XXXXX-XXXX-XXXX-XXXXXXXX\"\n" + "}"; HttpClient client = HttpClient.newBuilder() .connectTimeout(Duration.ofSeconds(10)) .build(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(url)) .header("Content-Type", "application/json") .header("Cache-Control", "no-cache") .header("Ocp-Apim-Subscription-Key", "YOUR_SUBSCRIPTION_KEY") .POST(HttpRequest.BodyPublishers.ofString(json)) .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } }
<?php $url = 'https://gateway.pixazo.ai/kling-video-v2-6-standard-motion-control/v1/kling-video-v2-6-standard-motion-control-request-result'; $data = [ 'request_id' => '5aefcXXX-XXXXX-XXXX-XXXX-XXXXXXXX' ]; $json = json_encode($data); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $json); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'Cache-Control: no-cache', 'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY' ]); $response = curl_exec($ch); curl_close($ch); echo $response; ?>

Response States

StatusDescription
IN_QUEUERequest is queued and waiting for processing.
IN_PROGRESSThe motion transfer is currently being rendered.
COMPLETEDThe motion transfer has completed successfully. Results are available in the output_url field.
FAILEDThe request failed due to invalid input, resource unavailability, or system error. Check the error_message field for details.

Example Success Response

{ "status": "COMPLETED", "request_id": "5aefcXXX-XXXXX-XXXX-XXXX-XXXXXXXX", "output_url": "https://storage.pixazo.ai/output/5aefcXXX-XXXXX-XXXX-XXXX-XXXXXXXX.mp4", "duration_seconds": 4.2, "width": 512, "height": 768, "content_type": "video/mp4", "has_audio": true }

Example In-Progress Response

{ "status": "IN_PROGRESS", "request_id": "5aefcXXX-XXXXX-XXXX-XXXX-XXXXXXXX", "progress_percent": 65, "estimated_remaining_seconds": 18 }

Kling Video v2.6 Motion Control API Pricing

Resolution Price (USD)
All Resolution$0.07