Skip to content

Kling Video ​

Kling Video uses an asynchronous video task API. Create a task first, then poll the task endpoint for status and the final video URL.

Recommended integration: Unified Video API

For new integrations, use /v1/video/generations to create tasks and /v1/video/generations/{task_id} to retrieve results.

Endpoints ​

Unified Video API ​

CapabilityMethodPath
Create video taskPOST/v1/video/generations
Retrieve video taskGET/v1/video/generations/{task_id}

Every request requires an API key:

http
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Models ​

Model
kling-v3
kling-v3-omni

Actual availability depends on your account permissions.

Supported Modes ​

ModeHow to call
Text to videoUse prompt with kling-v3 or kling-v3-omni
Image to videoUse image for the first frame
First and last frameUse image for the first frame and metadata.image_tail for the last frame
Omni videoUse kling-v3-omni with Omni fields in metadata
Camera controlUse metadata.camera_control when supported by the selected model

Unified API Request Parameters ​

FieldTypeRequiredDescription
modelstringYesKling model name
promptstringYesVideo generation prompt
imagestringNoFirst-frame image URL. When provided, the request is handled as image-to-video
modestringNoQuality/generation tier, such as std, pro, or 4k. Defaults to std. Actual availability depends on the model and account permissions
durationnumberNoVideo duration in seconds. Defaults to 5. kling-v3 / kling-v3-omni generally support 3 to 15 seconds; for multi-shot generation, the total duration must not exceed 15 seconds
sizestringNoUsed to infer aspect ratio, not forwarded as an output resolution directly; for example, 1920x1080 => 16:9, 1080x1920 => 9:16, 1024x1024 => 1:1
metadataobjectNoKling-specific options

Use mode to control the quality tier. size only lets the unified API infer aspect_ratio; do not use size as the parameter for 720P, 1080P, or 4K output.

metadata Fields ​

Supported metadata fields are merged into the request body sent to Kling. The public fields currently supported are listed below; fields not listed here are not guaranteed to be forwarded.

FieldTypeDescription
negative_promptstringNegative prompt
aspect_ratiostringAspect ratio, such as 16:9, 9:16, 1:1
image_tailstringLast-frame image URL
cfg_scalenumberPrompt relevance
camera_controlobjectCamera control
static_maskstringStatic mask
dynamic_masksobject[]Dynamic masks
callback_urlstringCallback URL
external_task_idstringClient-defined task ID
soundboolean/objectOmni audio switch or audio configuration
image_listobject[]Omni image inputs, such as first frame, end frame, or reference images
video_listobject[]Omni video inputs
element_listobject[]Omni character, subject, or asset inputs
multi_shotbooleanWhether to enable Omni multi-shot generation
shot_typestringOmni multi-shot type
multi_promptstring/object[]Omni multi-shot prompts
voice_listobject[]Omni voice or dialogue inputs
watermark_infoobjectWatermark configuration

Examples ​

Text to Video ​

bash
curl -X POST https://cubicspaces.cloud/v1/video/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "kling-v3",
    "prompt": "A cinematic shot of a futuristic cubic city at sunrise, slow camera movement, realistic lighting",
    "mode": "std",
    "duration": 5,
    "size": "1920x1080",
    "metadata": {
      "aspect_ratio": "16:9",
      "negative_prompt": "blur, distortion, low quality"
    }
  }'

Image to Video ​

bash
curl -X POST https://cubicspaces.cloud/v1/video/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "kling-v3",
    "prompt": "Animate the product from the first frame with a slow clockwise rotation, keep the product shape stable",
    "image": "https://example.com/first-frame.png",
    "mode": "std",
    "duration": 5,
    "metadata": {
      "aspect_ratio": "16:9",
      "negative_prompt": "deformation, flicker"
    }
  }'

First and Last Frame ​

bash
curl -X POST https://cubicspaces.cloud/v1/video/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "kling-v3",
    "prompt": "Create a smooth transition from the first frame to the last frame",
    "image": "https://example.com/first-frame.png",
    "duration": 5,
    "metadata": {
      "image_tail": "https://example.com/last-frame.png",
      "aspect_ratio": "16:9"
    }
  }'

Omni Video ​

kling-v3-omni uses the Omni video capability. It supports text-to-video, first/end frames, reference images, reference videos, multi-shot inputs, and audio-related inputs. The simplest text-to-video request can use the unified video API:

bash
curl -X POST https://cubicspaces.cloud/v1/video/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "kling-v3-omni",
    "prompt": "A cinematic shot of a futuristic city at sunset, smooth camera movement, high detail, realistic lighting",
    "mode": "std",
    "duration": 5,
    "size": "1920x1080",
    "metadata": {
      "aspect_ratio": "16:9"
    }
  }'

For first/end-frame Omni generation, you can also use image and metadata.image_tail:

bash
curl -X POST https://cubicspaces.cloud/v1/video/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "kling-v3-omni",
    "prompt": "Create a smooth transition from the first frame to the last frame, keep the subject identity consistent",
    "image": "https://example.com/first-frame.png",
    "duration": 8,
    "metadata": {
      "image_tail": "https://example.com/last-frame.png",
      "aspect_ratio": "16:9",
      "mode": "std"
    }
  }'

For richer Omni inputs, pass image_list, video_list, element_list, multi_shot, and related fields in metadata:

json
{
  "model": "kling-v3-omni",
  "prompt": "A product showcase with a close-up opening shot and a final wide studio shot",
  "duration": 10,
  "metadata": {
    "mode": "pro",
    "aspect_ratio": "16:9",
    "image_list": [
      {
        "image_url": "https://example.com/first-frame.png",
        "type": "first_frame"
      },
      {
        "image_url": "https://example.com/end-frame.png",
        "type": "end_frame"
      }
    ],
    "multi_shot": true,
    "multi_prompt": [
      "Close-up of the product with soft studio lighting",
      "Wide shot showing the product in a clean futuristic showroom"
    ]
  }
}

Camera Control Example ​

json
{
  "model": "kling-v3",
  "prompt": "A slow push-in shot toward the product on a clean studio table",
  "image": "https://example.com/product.png",
  "duration": 5,
  "metadata": {
    "aspect_ratio": "16:9",
    "camera_control": {
      "type": "simple",
      "config": {
        "zoom": 1.2,
        "horizontal": 0,
        "vertical": 0
      }
    }
  }
}

Response and Retrieval ​

A successful unified create request returns a video task object:

json
{
  "id": "video_xxx",
  "task_id": "video_xxx",
  "object": "video",
  "model": "kling-v3",
  "status": "queued",
  "progress": 0,
  "created_at": 1770000000
}

Use either id or task_id to retrieve the task.

Retrieve the task:

bash
curl https://cubicspaces.cloud/v1/video/generations/video_xxx \
  -H "Authorization: Bearer YOUR_API_KEY"

Completed task response:

json
{
  "id": "video_xxx",
  "task_id": "video_xxx",
  "object": "video",
  "model": "kling-v3",
  "status": "completed",
  "progress": 100,
  "seconds": "5",
  "created_at": 1770000000,
  "completed_at": 1770000120,
  "metadata": {
    "url": "https://example.com/output.mp4"
  }
}

Status Values ​

statusDescription
queuedThe task is queued
in_progressThe task is running
completedThe task has completed
failedThe task failed

When the task is completed, read the video URL from metadata.url.