Light Mode
Get Task
GET
/api/v1/task/{task_id}This is provided as part of the Kling API from PiAPI.
This endpoint could get video generation progress or result of Kling task.
Request
Path Params
task_id
string
required
Header Params
x-api-key
string
required
Your API Key used for request authorization
Request samples
Responses
Success(200)
HTTP Code: 200
Content Type : JSONapplication/json
Data Schema
code
integer
required
data
object
required
task_id
string
required
model
string
required
task_type
string
required
status
enum<string>
required
Hover on the "Completed" option and you coult see the explaintion of all status: completed/processing/pending/failed/staged
Allowed values:
CompletedProcessingPendingFailedStaged
input
object
required
output
object
required
meta
object
required
detail
null
required
logs
array [object]
required
error
object
required
message
string
required
If you get non-null error message, here are some steps you chould follow:
- Check our common error message
- Retry for several times
- If you have retried for more than 3 times and still not work, file a ticket on Discord and our support will be with you soon.
Example
{
"code": 200,
"data": {
"task_id": "b3efc0ab-3fdb-4b88-b20a-94eef777e125",
"model": "kling",
"task_type": "video_generation",
"status": "completed",
"config": {
"service_mode": "private",
"webhook_config": {
"endpoint": "",
"secret": ""
}
},
"input": {},
"output": {
"type": "m2v_txt2video_hq",
"status": 99,
"works": [
{
"status": 99,
"type": "m2v_txt2video_hq",
"cover": {
"resource": "https://xxx.png",
"resource_without_watermark": "",
"height": 1440,
"width": 1440,
"duration": 0
},
"video": {
"resource": "https://xxx.mp4",
"resource_without_watermark": "https://storage.goapi.ai/xxx.mp4",
"height": 1440,
"width": 1440,
"duration": 5100
}
}
]
},
"meta": {},
"detail": null,
"logs": [],
"error": {
"code": 0,
"raw_message": "",
"message": "",
"detail": null
}
},
"message": "success"
}
Last modified: 4 months ago