Status Task
Query the status of a generation task
Status Task
Query the status and results of a generation task.
Endpoint
Parameters
| Parameter | Location | Required | Description |
|---|---|---|---|
model | path | Yes | Model ID used for generation |
taskId | query | Yes | Task ID from submission response |
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer YOUR_API_KEY |
Response
Response Structure
Task States
| State | Description |
|---|---|
pending | Task received, waiting to be processed |
processing | Task is being processed by the AI model |
success | Generation completed successfully |
failed | Generation failed (see error details) |
Response Fields
| Field | Type | Description |
|---|---|---|
taskId | string | Task identifier |
state | string | Current task state |
resultJson | string | JSON string containing result URLs (on success) |
costTime | integer | Processing time in milliseconds |
createTime | integer | Task creation timestamp (Unix ms) |
completeTime | integer | Task completion timestamp (Unix ms) |
failCode | string | Error code (on failure) |
failMsg | string | Error message (on failure) |
State-Specific Responses
Pending / Processing
Success
Parsing resultJson:
Failed
Result URLs
The resultUrls array contains direct links to generated content:
Important: Result URLs expire after 24 hours. Download and store important outputs.
Examples
Polling Example
Error Responses
| Code | Description |
|---|---|
401 | Invalid or missing API key |
404 | Task not found |
429 | Rate limit exceeded |
See Errors for detailed error handling.