Task Management
Query Task Status
GET /v1/tasks/ — Query the status, progress, and final result of an asynchronous task
GET
Query Task Status
The core query endpoint for asynchronous tasks. After submitting a task (
POST /v1/tasks) and receiving a task_id, poll this endpoint until status: completed to retrieve the final result.
Example Request
Example Responses (By Stage)
Response Fields
string
Unique task ID (returned at submission)
string
Task status:
queued— Submitted, waiting to be processedprocessing— In progress; theprogressfield indicates progress (percentage string)completed— Done;resultcontains the generated outputfailed— Failed;errorcontains the error detailscancelled— Cancelled (onlyqueuedtasks can be cancelled)
string
Action type, identical to the value submitted (generate / edit / image2video, etc.)
string
Model ID used (group_name)
string
Progress as a percentage string (for example
"30%", "100%"). It may be an empty string right after queuing; terminal states (completed / failed) report "100%".
Note that the submit response carries progress as the integer 0, while the status response carries a string — do not parse it as a number.integer
Creation time (Unix timestamp in seconds)
integer
Completion time (Unix timestamp in seconds). Only present in completed / failed / cancelled states
integer
Actual quota charged for the task. Only present in terminal states
(completed / failed / cancelled). Success = settled amount; failed/cancelled
with automatic refund =
0. Use this field for reconciliation.object
Error details. Only present in the failed state:
message— Error descriptioncode— structured error code. Common values:upstream_unavailable(retryable),upstream_bad_request(rejected by upstream),upstream_rate_limited,task_failed(other failures)
object
Generation result. Only present in the completed state. Depending on the task’s media type, the key is
images / videos / audios (an array). Each item contains:url—string[]array (always an array, even with a single element)expires_at— Unix timestamp in seconds; when the artifact is deleted. Counted as 7 days from the moment the task finished, so it is the same value however many times you query; after it passes, object storage deletes the file
object
Convenience action links so clients don’t have to assemble URLs:
get— Current query endpointcancel— Cancel-task endpoint
Polling Recommendations
- Polling interval: every 2–5 seconds
- Maximum wait time: 5-minute timeout recommended (videos may take longer)
- Display
progressto show real-time progress to users - Prefer Webhooks: set
callback_urlat submission to receive a push on completion and skip polling
Error Codes
Related Documentation
- Submit Task —
POST /v1/tasks - Cancel Task —
POST /v1/tasks/{task_id}/cancel - Task System