Integration guides
Error handling
Error codes
Check HTTP status and body. code=0 means the request succeeded; generation succeeds only when data.status=COMPLETED. FAILED is still possible with code=0.
0Request accepted or data returned successfully.
40000JSON body, task params, files, or URLs are invalid.
40100Missing or invalid authentication context.
40300Rate limit exceeded. Retry later.
41001Unsupported task type.
41002Daily usage limit reached.
41003The prompt is missing or invalid.
41004Task not found or not accessible to the key’s owner.
41005The task can no longer be cancelled.
41006Poll /tasks/get for status. /tasks/get_result returns code 41006 before completion; after failure it can return code=0 with status=FAILED.
41007The style ID is invalid.
41008The requested number of outputs exceeds the limit.
41009Removing the watermark requires a subscription.
41010Changing visibility or copy protection requires a subscription.
41011The task cannot be deleted.
41012The model configuration changed or the model version is unavailable. Reload the model list and retry.
41013The Idempotency-Key was already used for a different task type.
42002The API key or user does not have enough available credits to freeze the task cost.
46001The request was blocked by abuse protection.
46002Too many tasks running at the same time. Wait for some to finish.
50000Internal server error. Retry later.
51001Creation failed. Check the inputs and available balance; record code/message for diagnosis before retrying.