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.
Headers
Section titled “Headers”Authorization Bearer YOUR_API_KEY required Account API key. Required on every request.
Path parameter
Section titled “Path parameter”id string required The taskId returned at creation, prefixed tk-hiapi-.
Field reference
Section titled “Field reference”| Field | Type | Description |
|---|---|---|
taskId | string | Task ID, fixed prefix tk-hiapi- |
model | string | Model name passed at creation |
status | string | Status enum, see below |
created | number | Creation time (Unix seconds) |
completed | number | Terminal time in Unix seconds; 0 while non-terminal |
output | array | Present only when status == success |
error | object | Present only when status == fail, shaped { code, message } |
Status enum
Section titled “Status enum”| status | Meaning | Returns output? |
|---|---|---|
queued | Enqueued, not started | No |
handling | Processing | No |
archiving | Done, output being prepared | No |
success | Terminal: complete, output available | Yes |
fail | Terminal: failed | No, returns error |
output[] fields
Section titled “output[] fields”| Field | Type | Description |
|---|---|---|
url | string | Resource URL, directly downloadable |
type | string | Output type, see below |
expireAt | number | Access 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).
Success response (status = success)
Section titled “Success response (status = success)”{ "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 }}Failure response (status = fail)
Section titled “Failure response (status = fail)”{ "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}