Skip to content
English

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.

Authorization Bearer YOUR_API_KEY required

Account API key. Required on every request.

Content-Type application/json required

The request body is JSON.

model string required

Target HiAPI model name.

example happyhorse-1-0
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.

default final
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR"
}
}
  • taskId looks like tk-hiapi- + 26 chars, 35 chars total.
  • Returns on successful creation, without waiting for generation to finish.
{
"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.