API Response Status Codes
All API requests follow a unified response structure combining standard HTTP status codes with custom business status codes (code
field).
Response Example
json
{
"code": 200,
"result": {
"task_id": "d9opjevn1bd48r5czq",
"task_cost": 694
},
"message": {
"en": "Task created successfully"
}
}
Status Code Reference
Code | Description | Explanation |
---|---|---|
200 | OK | Generic success status |
400 | Bad Request | Invalid parameter format/structure |
401 | Unauthorized | Authentication required |
402 | Payment Required | Insufficient balance |
403 | Forbidden | Insufficient permissions |
404 | Not Found | Resource not available |
408 | Request Timeout | Server processing timeout |
429 | Too Many Requests | Rate limit exceeded |
Error Handling
For all API responses, please make sure to check the code field, not just the HTTP status code.
If code ≠ 200, refer to the message for detailed error information.
All status codes support internationalization, with built-in support for both English and Chinese messages.
Response Fields
Field | Type | Purpose |
---|---|---|
code | int | Business status code |
message | object | Human-readable error/prompt |
result | object | Primary data |