Query Status & Download Video (Kling Format)

Endpoints

  • Text-to-video: GET /kling/v1/videos/text2video/{task_id}
  • Image-to-video: GET /kling/v1/videos/image2video/{task_id}

Request Example

Poll status and fetch the video (for image-to-video replace text2video with image2video):

cURL
Python
Node.js
# Query status: replace text2video with image2video for image-to-video
curl https://api-model.shuntianchuang.cn/kling/v1/videos/text2video/task_xxxxxxxx \
  -H "Authorization: Bearer sk-你的令牌"

# Once the task succeeds, download from data.task_result.videos[0].url
curl -o kling.mp4 "video URL returned in data.task_result.videos[0]"

Response Body

The query responds with the Kling-format envelope; business data lives in data:

data fieldDescription
task_idTask ID
task_statusLifecycle: submitted → processing → succeed or failed
task_status_msgFailure reason (empty on success)
task_result.videos[]On success, the video list: url download link, duration in seconds
create_time / update_timeTask creation / update time (ms timestamp); legacy-compatible mirrors created_at / updated_at hold the same values
final_unit_deductionUpstream usage actually consumed by this task (string), useful for reconciliation

Response Example

{
  "code": 0,
  "message": "SUCCEED",
  "data": {
    "task_id": "task_xxxxxxxx",
    "task_status": "succeed",
    "task_status_msg": "",
    "create_time": 1790573568000,
    "update_time": 1790573782998,
    "created_at": 1790573568000,
    "updated_at": 1790573782998,
    "final_unit_deduction": "250000",
    "task_result": {
      "videos": [
        {
          "id": "933421703588872232",
          "url": "https://aigc-output-video-xxxx.cos.ap-guangzhou.myqcloud.com/xxxx.mp4?q-sign-algorithm=sha1&...",
          "duration": "5.083"
        }
      ]
    }
  }
}
WARNING

The output url is an upstream signed link that expires in about 45 minutes. Download and re-host it immediately; do not treat it as long-term storage.

NOTE

Kling-format parameters are mapped by the gateway before reaching the upstream (see Submit Task for field mapping and exceptions); availability, billing, and response fields follow the actual responses of this platform; model names and prices follow the model marketplace. Billing settles on actual usage when the task completes (failed tasks are refunded).