Skip to content
English

Get Task Detail

GET /v1/tasks/:id

The path parameter :id is the tk-hiapi- taskId returned when the task was created. Commonly used for polling.

Authorization Bearer YOUR_API_KEY required

Account API key. Required on every request.

id string required

The taskId returned at creation, prefixed tk-hiapi-.

example tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR
FieldTypeDescription
taskIdstringTask ID, fixed prefix tk-hiapi-
modelstringModel name passed at creation
statusstringStatus enum, see below
creatednumberCreation time (Unix seconds)
completednumberTerminal time in Unix seconds; 0 while non-terminal
outputarrayPresent only when status == success
errorobjectPresent only when status == fail, shaped { code, message }
statusMeaningReturns output?
queuedEnqueued, not startedNo
handlingProcessingNo
archivingDone, output being preparedNo
successTerminal: complete, output availableYes
failTerminal: failedNo, returns error
FieldTypeDescription
urlstringResource URL, directly downloadable
typestringOutput type, see below
expireAtnumberAccess deadline (Unix seconds); download or re-store before it expires

Common type values (extensible): video, image, audio, first_frame, last_frame, thumbnail. output is always an array, and one task may return multiple types (e.g. video + first_frame).

{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR",
"model": "happyhorse-1-0",
"status": "success",
"created": 1777282033,
"completed": 1777282099,
"output": [
{
"url": "https://cdn.hiapi.ai/tasks/.../video.mp4",
"type": "video",
"expireAt": 1777886899
},
{
"url": "https://cdn.hiapi.ai/tasks/.../first_frame.jpg",
"type": "first_frame",
"expireAt": 1777886899
}
]
}
}

Non-terminal response (e.g. status = archiving)

Section titled “Non-terminal response (e.g. status = archiving)”
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "archiving",
"created": 1777282033,
"completed": 0
}
}
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "fail",
"created": 1777282033,
"completed": 1777282099,
"error": {
"code": "TASK_FAILED",
"message": "task failed"
}
}
}

error.code values are listed under status codes.

Task does not exist or does not belong to the current account:

{
"code": 404,
"message": "task not found",
"data": null
}