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, // Task status code. 1 means succeeded, greater than 1 means processing, and less than 0 means failed.
        "state_detail": "Complete",
        "task_id": "5f461cfc-ec4b-446b-aa31-57afa8fb5256"
    }
}

HTTP Response Status Code

HTTP Response Status CodeDefinitions
200The request is successful
400

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
-17Processing failed because the prompt is invalid.
-16Processing failed because a third-party review detected prohibited content.
-15Processing failed due to insufficient resources.
-14Processing failed because the input image content does not meet the requirements.
-13Processing failed because the task was canceled due to an exception.
-11Processing failed because the result is empty.
-10Processing failed because internal review detected prohibited content.
-9Processing failed because the internal program failed during loop processing.
-8Processing timed out. The maximum processing time is 180 seconds.
-7

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

-5The image_url image exceeds the size limit (30MB).
-3The server failed to download your file. Please check if the URL of your source image is available.
-2Restoration completed, but uploading the result to OSS failed.
-1Restoration failed.
0Queued. The restoration task is waiting in the queue.
1Completed. Restoration succeeded.
2Preparing
3Waiting
4Processing. Restoration is in progress.
5Internally publishing the result.
6Processing. Internal loop processing is in progress.