Error code
Request error
Non-2xx status code is returned when the request fails:
json
{
"error": {
"code": "invalid_request",
"message": "image must be an HTTP(S) URL or a base64-encoded image",
"request_id": "req_8fK2mQ9xZ1aB3cD5eF7g"
}
}Please use code for program judgment, message is only used for prompts.
| HTTP | code | description |
|---|---|---|
| 400 | invalid_request | Parameter error, template does not exist, image cannot be read |
| 401 | invalid_api_key | Key is invalid, disabled or expired |
| 402 | insufficient_balance | Insufficient points, task not created, see Billing and Points |
| 403 | forbidden | The IP is not in the whitelist, or the account has been disabled |
| 404 | not_found | Task does not exist |
| 422 | input_rejected | No clear face detected, or suspected to be a minor |
| 429 | rate_limited | Requests per minute exceeded |
| 429 | concurrency_limited | The number of ongoing tasks has reached the upper limit |
| 500 | internal_error | Server error |
| 503 | upstream_unavailable | The generation service is temporarily unavailable |
| 503 | moderation_unavailable | Review service is temporarily unavailable |
429, 500, and 503 can be retried later. For the rest, please check the request before submitting it.
Reason for task failure
When the task status is failed, error.code is:
| code | description |
|---|---|
generation_failed | Generation failed, you can try again or change the picture |
empty_output | No result returned, you can try again |
output_rejected | The result failed content review |
timeout | Not completed for more than 15 minutes |
