Error Response Format
When a generation fails, themessage field contains the error code:
Error Codes
| Code | Description | Solution |
|---|---|---|
INSUFFICIENT_CREDITS | Not enough balance | Top up your account |
MODERATION_FAILED | Content blocked by safety filters | Modify your prompt |
API_ERROR | External API error | Retry the request |
TASK_FAILED | Internal generation error | Retry the request |
TIMEOUT | Generation took too long | Retry with simpler prompt |
INVALID_IMAGE | Invalid input image | Check image format/encoding |
IMAGE_TOO_LARGE | Image exceeds 20MB limit | Compress the image |
UNSUPPORTED_IMAGE_FORMAT | Wrong image format | Use JPEG, PNG, or WEBP |
HTTP Status Codes
| Status | Description |
|---|---|
201 | Generation created successfully |
400 | Invalid request parameters |
401 | Invalid or missing API key |
402 | Insufficient credits |
404 | Generation not found |
500 | Internal server error |
Request Validation Errors
Invalid Model/Quality Combination
quality parameter only with model: "pro"
Invalid Prompt Length
Invalid Temperature
Automatic Refunds
When a generation fails, credits are automatically refunded to your account. No action required.
MODERATION_FAILEDAPI_ERRORTASK_FAILEDTIMEOUT
Check your transaction history in the dashboard to see refund details.