Skip to content

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

CodeDescriptionExplanation
200OKGeneric success status
400Bad RequestInvalid parameter format/structure
401UnauthorizedAuthentication required
402Payment RequiredInsufficient balance
403ForbiddenInsufficient permissions
404Not FoundResource not available
408Request TimeoutServer processing timeout
429Too Many RequestsRate 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

FieldTypePurpose
codeintBusiness status code
messageobjectHuman-readable error/prompt
resultobjectPrimary data