Error Response Format
When a task fails (status: "failed"), the response includes an error object:
Error Codes Overview
Client Errors (Fixable by User)
Client Errors (Fixable by User)
Server Errors (Retry Later)
Server Errors (Retry Later)
Error Code Details
content_policy_violation
Content Policy Violation
Your request was blocked by safety filters. This is the most common error type, covering the following scenarios:
generation_failed_no_content
Generation Failed
The model was unable to produce output for your request. While the request format was valid, the model could not generate a result during processing.
- Poor prompt quality: Description is too vague or contradictory for the model to understand
- Model capability limits: The prompt exceeds the model’s generation capabilities
- Upstream service issues: The underlying model service returned an empty result
- Protected content detection: The prompt or reference image may involve watermark removal or protected content (logos, trademarks, etc.)
invalid_parameters
Invalid Parameters
Request parameters do not meet model requirements.
image_processing_error
Image Processing Failed
The system could not process the input image.
- Image URL is inaccessible (authentication required, CDN restrictions, expired link)
- Image format is not supported (e.g., HEIC, AVIF)
- Image file is corrupted
- Network issues prevented image download
image_dimension_mismatch
Image Dimension Mismatch
The input image dimensions do not match the dimensions specified in the request. Common in image-to-video scenarios.
aspect_ratio=1280x720(16:9) requires a 1280x720 landscape imageaspect_ratio=720x1280(9:16) requires a 720x1280 portrait image
service_error
Service Error
An internal issue occurred in the upstream service. This is usually temporary — the system automatically switches to other available routes.
- Upstream model service temporarily unavailable
- Server overload / high traffic
- Maintenance in progress
- Network connection interrupted
generation_timeout
Generation Timeout
The task did not complete within the allowed time.
- High system load causing queue delays
- High task complexity (high resolution, long video, etc.)
- Slow upstream service response
quota_exceeded
Quota / Rate Limit Exceeded
Request frequency or concurrency limits have been exceeded.
- Too many requests sent in a short period (rate limiting)
- Multiple tasks processing simultaneously (concurrency limit)
- Account quota depleted
resource_exhausted
Resource Exhausted
Upstream service compute resources are temporarily depleted. Usually occurs during peak model usage periods.
resource_not_found
Resource Not Found
The requested task ID does not exist or has expired.
request_cancelled
Request Cancelled
The task was cancelled or interrupted during processing.
service_unavailable
Service Unavailable
An internal authentication or connection issue occurred. This error has been automatically logged and will typically be resolved quickly.
unknown_error
Unknown Error
An unclassified error. The system could not identify the specific error type.
Best Practices
Error Handling Example
Retryable vs Non-Retryable
Fix Request Before Retry
content_policy_violation— Modify contentinvalid_parameters— Fix parametersimage_processing_error— Use different imageimage_dimension_mismatch— Resize image
Safe to Retry Directly
generation_failed_no_content— Try different promptservice_error— Wait, then retrygeneration_timeout— Wait, then retryresource_exhausted— Auto-recoversquota_exceeded— Reduce frequency, then retry