Skip to main content
All errors return specific codes in the message field or detail field for programmatic handling.

Error Categories

Issues caused by invalid requests or insufficient resources.
HTTP Status: 402 Payment RequiredDescription: Not enough credits to complete the requestSolution: Add more credits to your account
{
  "detail": "INSUFFICIENT_CREDITS"
}
HTTP Status: 404 Not FoundDescription: Task with specified UUID does not existSolution: Verify the task UUID is correct
{
  "detail": "Task not found"
}
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
Solution: Check parameter values and types
{
  "detail": "Validation error: images format invalid"
}
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)
{
  "detail": "Invalid image format"
}

Complete Error Reference

INSUFFICIENT_CREDITS
User Error
Not enough credits to complete the request (HTTP 402)
OPENAI_DECLINED
System Error
OpenAI service declined the request (HTTP 500, automatic refund attempted)
Maintenance
System Error
Service is temporarily unavailable for maintenance (HTTP 503)

HTTP Status Code Reference

201
Created
Generation created successfully
200
OK
Request successful
400
Bad Request
Invalid parameters, image format, or request format
401
Unauthorized
Invalid or missing API key
402
Payment Required
Insufficient credits
404
Not Found
Task not found
422
Validation Error
Invalid input format or missing required fields
500
Internal Server Error
Server-side error (OPENAI_DECLINED or other)
503
Service Unavailable
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
Always handle errors programmatically using the error codes, not human-readable messages.