curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "kling-v2-6-motion-control",
"prompt": "Keep the character consistent, perform a turn and wave following the reference video, cinematic lighting",
"image_url": "https://example.com/ref-image.png",
"video_url": "https://example.com/ref-video-8s.mp4",
"keep_original_sound": "yes",
"character_orientation": "image",
"mode": "std",
"watermark_info": {"enabled": false}
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "kling-v2-6-motion-control",
"prompt": "Keep the character consistent, perform a turn and wave following the reference video, cinematic lighting",
"image_url": "https://example.com/ref-image.png",
"video_url": "https://example.com/ref-video-8s.mp4",
"keep_original_sound": "yes",
"character_orientation": "image",
"mode": "std",
"watermark_info": {"enabled": False}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "kling-v2-6-motion-control",
prompt: "Keep the character consistent, perform a turn and wave following the reference video, cinematic lighting",
image_url: "https://example.com/ref-image.png",
video_url: "https://example.com/ref-video-8s.mp4",
keep_original_sound: "yes",
character_orientation: "image",
mode: "std",
watermark_info: { enabled: false }
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Authentication failed. Please check your API key.",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient account balance. Please top up and try again.",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "Too many requests. Please try again later.",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "Internal server error. Please try again later.",
"type": "server_error"
}
}
Kling 2.6
Kling v2.6 Motion Control Video Generation
- Kling motion control model (reference image + reference video)
- Called via unified endpoint
/v1/videos/generations - Supports image / video character orientation, max duration 10s / 30s respectively
- Asynchronous task — returns task_id on submission
POST
/
v1
/
videos
/
generations
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "kling-v2-6-motion-control",
"prompt": "Keep the character consistent, perform a turn and wave following the reference video, cinematic lighting",
"image_url": "https://example.com/ref-image.png",
"video_url": "https://example.com/ref-video-8s.mp4",
"keep_original_sound": "yes",
"character_orientation": "image",
"mode": "std",
"watermark_info": {"enabled": false}
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "kling-v2-6-motion-control",
"prompt": "Keep the character consistent, perform a turn and wave following the reference video, cinematic lighting",
"image_url": "https://example.com/ref-image.png",
"video_url": "https://example.com/ref-video-8s.mp4",
"keep_original_sound": "yes",
"character_orientation": "image",
"mode": "std",
"watermark_info": {"enabled": False}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "kling-v2-6-motion-control",
prompt: "Keep the character consistent, perform a turn and wave following the reference video, cinematic lighting",
image_url: "https://example.com/ref-image.png",
video_url: "https://example.com/ref-video-8s.mp4",
keep_original_sound: "yes",
character_orientation: "image",
mode: "std",
watermark_info: { enabled: false }
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Authentication failed. Please check your API key.",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient account balance. Please top up and try again.",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "Too many requests. Please try again later.",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "Internal server error. Please try again later.",
"type": "server_error"
}
}
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "kling-v2-6-motion-control",
"prompt": "Keep the character consistent, perform a turn and wave following the reference video, cinematic lighting",
"image_url": "https://example.com/ref-image.png",
"video_url": "https://example.com/ref-video-8s.mp4",
"keep_original_sound": "yes",
"character_orientation": "image",
"mode": "std",
"watermark_info": {"enabled": false}
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "kling-v2-6-motion-control",
"prompt": "Keep the character consistent, perform a turn and wave following the reference video, cinematic lighting",
"image_url": "https://example.com/ref-image.png",
"video_url": "https://example.com/ref-video-8s.mp4",
"keep_original_sound": "yes",
"character_orientation": "image",
"mode": "std",
"watermark_info": {"enabled": False}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "kling-v2-6-motion-control",
prompt: "Keep the character consistent, perform a turn and wave following the reference video, cinematic lighting",
image_url: "https://example.com/ref-image.png",
video_url: "https://example.com/ref-video-8s.mp4",
keep_original_sound: "yes",
character_orientation: "image",
mode: "std",
watermark_info: { enabled: false }
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Authentication failed. Please check your API key.",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient account balance. Please top up and try again.",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "Too many requests. Please try again later.",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "Internal server error. Please try again later.",
"type": "server_error"
}
}
Authentication
string
required
All requests require Bearer Token authenticationGet your API Key:Visit the API Key Management page to obtain your API KeyAdd the following header to each request:
Authorization: Bearer YOUR_API_KEY
Request Parameters
string
required
Model name:
kling-v3-motion-control or kling-v2-6-motion-controlboolean
default:"false"
Whether to run content moderation before submitting the video task.
true: useomni-moderation-latestto review prompts and input imagesfalseor omitted: do not send a moderation request, adding no moderation cost or latency (default)
string
Text prompt describing the desired motion, camera movement, and styleOptional but recommended — more specific descriptions produce more stable resultsExample:
"The character dances following the reference video, smooth motion, realistic style"string
required
Reference image URLMust be a publicly accessible link
string
required
Reference video URLMust be a publicly accessible direct link; mp4/mov recommended, under 100MB
The server probes the actual duration of
video_url. Minimum is 3 seconds; maximum is determined by character_orientation.string
default:"yes"
Whether to retain the original audio track from the reference videoOptions:
yes: Keep original audio (default)no: Do not keep original audio
string
required
Character orientation controlOptions:
image: Use the character orientation from the reference image (reference video duration:3~10s)video: Use the character orientation from the reference video (reference video duration:3~30s)
string
required
Generation modeOptions:
std: Standard mode (balanced speed and quality)pro: High-quality mode (higher latency)
object
Watermark control object (optional)
Show watermark_info fields
Show watermark_info fields
boolean
default:"false"
Whether to add a watermark
true: Add watermarkfalse: No watermark (default)
Duration Rules
| Condition | Allowed Reference Video Duration |
|---|---|
character_orientation = image | 3s ~ 10s |
character_orientation = video | 3s ~ 30s |
Billing duration is determined by the actual duration probed from
video_url by the server, not a client-side estimate.Response
integer
Response status code, 200 on success
array
Examples
Example 1: image orientation (within 10s)
{
"model": "kling-v2-6-motion-control",
"prompt": "Keep character orientation consistent with the reference image, perform a turn and wave",
"image_url": "https://example.com/ref-image.png",
"video_url": "https://example.com/ref-video-8s.mp4",
"character_orientation": "image",
"mode": "std",
"keep_original_sound": "yes",
"watermark_info": {"enabled": false}
}
Example 2: video orientation (within 30s)
{
"model": "kling-v2-6-motion-control",
"prompt": "Follow the character orientation and rhythm of the reference video, maintain fluid motion",
"image_url": "https://example.com/ref-image.png",
"video_url": "https://example.com/ref-video-12s.mp4",
"character_orientation": "video",
"mode": "pro",
"keep_original_sound": "no",
"watermark_info": {"enabled": false}
}