Skip to main content

Error Response Format

When a generation fails, the message field contains the error code:
{
  "task_uuid": "ffd473d5-5bef-4e14-bf22-8d559be3c19f",
  "status": "failed",
  "prompt": "...",
  "result_image_url": null,
  "message": "MODERATION_FAILED"
}

Error Codes

CodeDescriptionSolution
INSUFFICIENT_CREDITSNot enough balanceTop up your account
MODERATION_FAILEDContent blocked by safety filtersModify your prompt
API_ERRORExternal API errorRetry the request
TASK_FAILEDInternal generation errorRetry the request
TIMEOUTGeneration took too longRetry with simpler prompt
INVALID_IMAGEInvalid input imageCheck image format/encoding
IMAGE_TOO_LARGEImage exceeds 20MB limitCompress the image
UNSUPPORTED_IMAGE_FORMATWrong image formatUse JPEG, PNG, or WEBP

HTTP Status Codes

StatusDescription
201Generation created successfully
400Invalid request parameters
401Invalid or missing API key
402Insufficient credits
404Generation not found
500Internal server error

Request Validation Errors

Invalid Model/Quality Combination

{
  "detail": "Quality 2k/4k is only available for Pro model"
}
Solution: Use quality parameter only with model: "pro"

Invalid Prompt Length

{
  "detail": [
    {
      "loc": ["body", "prompt"],
      "msg": "String should have at least 1 character",
      "type": "string_too_short"
    }
  ]
}
Solution: Provide a prompt between 1-4000 characters

Invalid Temperature

{
  "detail": [
    {
      "loc": ["body", "temperature"],
      "msg": "Input should be less than or equal to 1",
      "type": "less_than_equal"
    }
  ]
}
Solution: Use temperature between 0 and 1

Automatic Refunds

When a generation fails, credits are automatically refunded to your account. No action required.
Refunds are issued for:
  • MODERATION_FAILED
  • API_ERROR
  • TASK_FAILED
  • TIMEOUT
Check your transaction history in the dashboard to see refund details.