Create Task
POST
/v1/tasks Submit an async generation task. It returns a taskId immediately and does not wait for generation to finish; then poll Get Task Detail or wait for the terminal callback.
Headers
Section titled “Headers”Authorization Bearer YOUR_API_KEY required Account API key. Required on every request.
Content-Type application/json required The request body is JSON.
Request body
Section titled “Request body”model string required Target HiAPI model name.
input object required The model's business parameters; fields are defined per model.
callback object optional Terminal-notification config; omit to skip callbacks and poll yourself.
url string required Required when callback is present; HiAPI POSTs here when terminal. Must be a valid http(s) URL.
when string optional Currently only final — both success and fail fire a callback.
Success response (HTTP 200)
Section titled “Success response (HTTP 200)”{ "code": 200, "message": "success", "data": { "taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR" }}taskIdlooks liketk-hiapi-+ 26 chars, 35 chars total.- Returns on successful creation, without waiting for generation to finish.
Failure response
Section titled “Failure response”{ "code": 400, "message": "invalid request", "data": null, "error_code": "INVALID_REQUEST"}code is the HTTP status; error_code is the business error code (enum under status codes). When the platform is temporarily unavailable it may return HTTP 503 — retry later with backoff.