All errors return specific codes in the
message field or detail field for programmatic handling.Error Categories
- User Errors
- System Errors
Issues caused by invalid requests or insufficient resources.
INSUFFICIENT_CREDITS
INSUFFICIENT_CREDITS
HTTP Status: 402 Payment RequiredDescription: Not enough credits to complete the requestSolution: Add more credits to your account
Task Not Found
Task Not Found
HTTP Status: 404 Not FoundDescription: Task with specified UUID does not existSolution: Verify the task UUID is correct
Invalid Request
Invalid Request
HTTP Status: 400 Bad RequestDescription: Request parameters are invalid or missing required fieldsCommon causes:
- Prompt length outside 1-4000 characters
- More than 4 images provided
- Invalid image format
- Unsupported model
Invalid Image Format
Invalid Image Format
HTTP Status: 400 Bad RequestDescription: One or more images are not in valid formatSolution: Ensure images are:
- Valid HTTP/HTTPS URLs
- Base64 with proper MIME type prefix
- Base64 without prefix (decoded as JPEG)
Complete Error Reference
Not enough credits to complete the request (HTTP 402)
OpenAI service declined the request (HTTP 500, automatic refund attempted)
Service is temporarily unavailable for maintenance (HTTP 503)
HTTP Status Code Reference
Generation created successfully
Request successful
Invalid parameters, image format, or request format
Invalid or missing API key
Insufficient credits
Task not found
Invalid input format or missing required fields
Server-side error (OPENAI_DECLINED or other)
Service temporarily unavailable (Maintenance)
Common Issues & Solutions
Issue: “INSUFFICIENT_CREDITS”
Cause: Account balance is too low to complete the generation. Solution:- Add more credits to your account
- Check your current balance in the dashboard
Issue: “OPENAI_DECLINED”
Cause: OpenAI service rejected the request or internal error occurred. Solution:- Service automatically attempts refund
- Wait a few minutes and try again
- If issue persists, contact support with task_uuid
Issue: “Maintenance”
Cause: Service is temporarily disabled for maintenance. Solution:- Wait for maintenance to complete
- Check status page or announcements
- Retry after maintenance window
Issue: “Invalid image format”
Cause: Images provided in incorrect format. Solution:- Use valid HTTP/HTTPS URLs
- Or use Base64 with MIME prefix:
data:image/jpeg;base64,... - Or use plain Base64 (decoded as JPEG)
Issue: “More than 4 images”
Cause: Provided more than the maximum allowed images. Solution:- Limit images array to maximum of 4 elements
- Combine multiple images if needed