To determine if the task is successful, a combination of HTTP Response Status Code and Task Status Code (the state field in the HTTP response message) is required.

Return Code Samples

    "status": 200,
    "data": {
        "completed_at": 1698387307,
        "created_at": 1698387304,
        "image": "yourimage",
        "processed_at": 1698387303,
        "progress": 100,
        "return_type": 1,
        "state": 1, // "state=1" refers to the task succeeds; and "state<0" refers to the task fails
        "state_detail": "Complete",
        "task_id": "5f461cfc-ec4b-446b-aa31-57afa8fb5256"

HTTP Response Status Code

HTTP Response Status CodeDefinitions
200The request is successful

Client side passed the wrong parameter. Please check if the parameter is missing or if the value is incorrect.

401Unauthorized API Key. Please check if the X-API-KEY is correct and if the service is enabled.
404The requested URL or resource does not exist. Please check if the URL or task_id is correct
413The uploaded file exceeded the allowed size. Please refer to the supported image size.
429The request frequency exceeds the QPS limit (the default QPS is 2). Please slow down the request rate or contact us to increase your QPS.
500Server side exception. Please contact the support.

Task Status Code

The task status code is the state field in the HTTP response message.

Task Status CodeDefinitions
-8Processing timeout. The processing time is limited to 30 seconds.

Invalid image file. For example: corrupted image, incorrect format, etc.

-5Image exceeds size (Up to 15MB).
-3The server failed to download your file. Please check if the URL of your source image is available.
-2The task has been completed, but the result image upload OSS fails.
-1Task fails
0Too many requests. Your task is in the queue.
1Task succeeds