HomeDocsKling 2.5 API
Video APIs

Kling 2.5 API

Generate physics-aware simulation footage with motion planning, asset reuse, and multi-channel sensor exports. · Updated 2025-03-18

Overview

Kling 2.5 focuses on robotics and industrial simulation. It supports physically plausible movements, constraint-aware motion planning, and exports for RGB, depth, normals, and optical flow — perfect for digital twins and training datasets.

Required Assets

  • Scene file: glTF (.glb) or FBX uploaded via multipart form data.
  • Optional motion curves: JSON describing joint positions or path splines.
  • Materials and HDRIs packaged inside the scene file or referenced by URL.

Example Request

curl -X POST "https://api.transendai.net/v1/videos/kling2.5/generation" \
  -H "Authorization: Bearer $TRANSEND_API_KEY" \
  -F "[email protected]" \
  -F 'payload={
    "prompt": "Robotic arm assembling a circuit board with pick-and-place motions.",
    "duration": 20,
    "physics": { "frame_rate": 120, "collision_detection": true },
    "sensors": ["rgb", "depth", "optical_flow"],
    "constraints": { "joint_speed_rad": 0.05 }
  }'

Response Payload

{
  "task_id": "task_kling_a81",
  "status": "succeeded",
  "result": {
    "streams": {
      "rgb": "https://edge.transendai.net/task_kling_a81/rgb.mp4",
      "depth": "https://edge.transendai.net/task_kling_a81/depth.tar",
      "optical_flow": "https://edge.transendai.net/task_kling_a81/flow.tar"
    },
    "physics_log": "https://edge.transendai.net/task_kling_a81/physics.json",
    "duration": 20
  }
}

Depth and optical flow streams are delivered as tar archives containing 16-bit PNG frames unless otherwise specified.

Motion Planning

Provide either high-level prompts or explicit joint trajectories:

"motion": {
  "joints": [
    { "name": "shoulder", "angles": [[0, 0.2], [0.5, 0.35], [1.0, 0.3]] },
    { "name": "elbow", "angles": [[0, 0.4], [0.5, 0.5], [1.0, 0.42]] }
  ]
}

Each array entry is [timeline_fraction, value]. Kling automatically interpolates between waypoints while respecting constraints.

Sensor Output Options

SensorFormatNotes
rgbMP4/H.264Color footage, default 1080p.
depthPNG (16-bit)Unit: meters.
normalsPNG (float-encoded)For surface analysis.
optical_flowPNG (float-encoded)Use decode_flow.py helper from the SDK.

Error Codes

CodeConditionRemediation
400Scene missing or malformed JSON.Validate multipart payload and JSON syntax.
409Constraint violation detected.Reduce joint speeds or relax motion bounds.
415Unsupported asset format.Convert models to .glb or .fbx.

Operational Guidance

  • Keep scene files under 200 MB; larger assets should be uploaded to S3 with signed URLs.
  • Use frame rates ≥ 60 FPS for robotics applications that require smooth control curves.
  • For custom sensors, coordinate with support to enable private plugins.

Related Resources