Skip to main content

Kevin Kling Subject Reference

POST 

/open/aigw/gateway/generations

Generate subject-consistent videos using images (with subject IDs), videos, or pre-created subjects (ElementId). Use <<<id>>> in the prompt to reference subjects. Only supports Kling 3.0 / 3.0-Omni.

Workflow

  1. Call this endpoint to submit a video generation task and obtain taskNo
  2. When processing is complete, the system sends a POST callback notification to callbackUrl with the result
  3. You can also poll the status via GET /open/aigw/gateway/generationTask?taskNo=xxx

Request

Responses

任务提交成功

Callback Notification Format

After generation completes, the system POSTs the following data to callbackUrl:

On success:

{
"taskNo": "a1b2c3d4...",
"status": "success",
"model": "kling_3.0-Omni_subject_reference",
"timestamp": 1234567890,
"data": {
"task_id": "6928de47-2e53-4ee6-901b-be05a8bf7669",
"status": "SUCCESS",
"request_id": "7d8d7f71a7314779b6947eed659085fa",
"result": ["https://cdn.example.com/result_1.mp4"],
"error_info": "",
"traceback": ""
},
"usage": { "totalPoints": 10 },
"sign": "sha256hex..."
}

On failure:

{
"taskNo": "a1b2c3d4...",
"status": "failed",
"model": "kling_3.0-Omni_subject_reference",
"timestamp": 1234567890,
"error": "Error message",
"sign": "sha256hex..."
}

Signature verification: sign = SHA256(taskNo + timestamp + apiKey)

Query Generation Task Status

GET /open/aigw/gateway/generationTask?taskNo={taskNo}

It is recommended to use the callback method first; this endpoint serves as a polling fallback.

Request parameters:

ParameterTypeRequiredDescription
taskNostringYesTask number returned when submitting the task

Response example (success):

{
"code": 1000,
"message": "success",
"data": {
"taskNo": "a1b2c3d4...",
"model": "kling_3.0-Omni_subject_reference",
"status": "success",
"createTime": "2025-01-01 12:00:00",
"data": { "result": ["https://cdn.example.com/result_1.mp4"] },
"usage": { "totalPoints": 10 }
}
}

Response example (failure):

{
"code": 1000,
"message": "success",
"data": {
"taskNo": "a1b2c3d4...",
"model": "kling_3.0-Omni_subject_reference",
"status": "failed",
"error": "Reason for generation failure"
}
}

status values: pending (queued), processing (in progress), success (completed), failed (failed)