Response Format
Understanding API responses and task states
Response Format
All APIXO API responses follow a consistent JSON structure.
Response Structure
| Field | Type | Description |
|---|---|---|
code | integer | HTTP status code |
message | string | Human-readable status message |
data | object | Response payload (varies by endpoint) |
Task Submission Response
When you submit a generation task:
| Field | Type | Description |
|---|---|---|
taskId | string | Unique identifier for tracking the task |
Save the taskId to query status or debug issues later.
Task Status Response
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) |
Pending / Processing
Success
| Field | Type | Description |
|---|---|---|
taskId | string | Task identifier |
state | string | success |
resultJson | string | JSON string containing result URLs |
costTime | integer | Processing time in milliseconds |
createTime | integer | Task creation timestamp (Unix ms) |
completeTime | integer | Task completion timestamp (Unix ms) |
Parsing resultJson:
Failed
| Field | Type | Description |
|---|---|---|
failCode | string | Error code for programmatic handling |
failMsg | string | Human-readable error message |
Result URLs
The resultUrls array contains direct links to generated content:
Important: Result URLs expire after 24 hours. Download and store important outputs.
Polling Example
HTTP Status Codes
| Code | Meaning |
|---|---|
200 | Success |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid API key |
403 | Forbidden - Insufficient permissions |
404 | Not Found - Task or model not found |
429 | Too Many Requests - Rate limit exceeded |
500 | Server Error - Try again later |
See Error Codes for detailed error handling.