Get Task Detail
Endpoint: GET /v1/tasks/:id
The path parameter :id is the tk-hiapi- taskId returned when the task was created. Commonly used for polling.
Headers
| Header | Value | Required | Notes |
|---|---|---|---|
Authorization | Bearer YOUR_API_KEY | yes | Account API key. Required on every request. |
The task must belong to the API key’s account; cross-account queries return 404 — full header rules in the Unified Async API Introduction.
Path parameter
Request example — GET https://api.hiapi.ai/v1/tasks/tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR
{}
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | yes | — | The taskId returned at creation, prefixed tk-hiapi-. e.g. tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR |
Polling guidance
- After creating a task, wait 2–3 seconds before the first query; then poll every 3–5 seconds — for slower generations (e.g. video), 5–10 seconds is enough.
- Stop polling once
statusreachessuccess/fail: terminal states are irreversible and ataskId’s result is fixed (see the task status enum). - On
success, downloadoutput[].urlpromptly — mind theexpireAtdeadline; to keep outputs long-term, setstorage: "persistent"at creation or promote them later. - For production, prefer a callback for terminal notifications and keep polling as a fallback.
- On
503, retry later with exponential backoff.
Field reference
| Field | Type | Description |
|---|---|---|
taskId | string | Task ID, fixed prefix tk-hiapi- |
model | string | Resolved model full name. When the task was submitted with the route parameter this is base@route (e.g. gpt-image-2/text-to-image@ext); otherwise it is the name passed at creation |
route | string | Present only when the task was submitted with an explicit route parameter; echoes the submitted value |
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 |
storage | string | Effective storage tier of the outputs: temp, persistent, or static. Always present; defaults to temp. The storage list calls the same state storage_tier |
storage_downgraded | string | Present only when a requested persistent tier fell back to temp. Value is insufficient (balance at or below zero) or cap_exceeded (over the storage cap); storage then reports temp |
error | object | Present only when status == fail, shaped { code, message } |
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
| 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).
The top-level storage field is the tier that actually took effect (temp / persistent / static; static marks built-in assets). The storage list reports the same tier per output as storage_tier (temporary / persistent only — static outputs are not listed there) — different field name, same state.
Success response (status = success)
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR",
"model": "happyhorse-1.0",
"status": "success",
"storage": "temp",
"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)
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1.0",
"status": "archiving",
"created": 1777282033,
"completed": 0
}
}
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.
404
Task does not exist or does not belong to the current account:
{
"code": 404,
"message": "task not found",
"data": null
}