Skip to main content

Response


Successful Response

Successful response from the status endpoint.

Status Check

Returns your API connection status.

{
"success": true,
"message": "API connection successful",
"data": {
"accountId": "string (UUID)",
"apiKeyId": "string (UUID)",
"apiKeyName": "string",
"timestamp": "string (ISO 8601)"
}
}

Account Info

Returns your account details including credits, email, and account ID.

{
"success": true,
"data": {
"account": {
"id": "string (UUID)",
"name": "string",
"email": "string",
"isPersonalAccount": "boolean",
"pictureUrl": "string (URL)",
"createdAt": "string (ISO 8601)"
},
"credits": {
"total": "integer",
"free": "integer",
"purchased": "integer",
"refunded": "integer",
"redeemed": "integer",
"bonus": "integer",
"affiliate": "integer"
},
"apiKey": {
"name": "string",
"prefix": "string",
"createdAt": "string (ISO 8601)"
}
}
}

List All Images

Returns an array of all your generated images with their status and details.

{
"success": true,
"data": {
"generations": [
{
"generationId": "string (UUID)",
"status": "string (succeeded|failed|processing|starting)",
"name": "string",
"prompt": "string",
"aspectRatio": "string",
"modelProvider": "string",
"outputNumber": "integer",
"outputSuccess": "integer",
"outputFailed": "integer",
"outputImages": ["string (URL)"],
"creditCost": "integer",
"createdAt": "string (ISO 8601)",
"isPublic": "boolean",
"predictTime": "number",
"totalTime": "number",
"imageInput": ["string (path)"]
}
],
"total": "integer",
"limit": "integer",
"offset": "integer"
}
}

Check Image Status

Returns the current status and output URLs for a specific generation.

{
"success": true,
"data": {
"generationId": "string (UUID)",
"status": "string (succeeded|failed|processing|starting)",
"name": "string",
"prompt": "string",
"aspectRatio": "string",
"modelProvider": "string",
"outputNumber": "integer",
"outputSuccess": "integer",
"outputFailed": "integer",
"currentImage": "integer",
"deletedImage": "integer",
"outputImages": ["string (URL)"],
"creditCost": "integer",
"failureReason": "string | null",
"predictTime": "number",
"totalTime": "number",
"createdAt": "string (ISO 8601)",
"isPublic": "boolean",
"imageInput": ["string (path)"]
}
}

Text-to-Image (No input image)

Returns generation ID and initial status after submitting a text-to-image request.

{
"success": true,
"data": {
"generationId": "string (UUID)",
"status": "string (starting)",
"creditCost": "integer"
}
}

Image-to-Image (Single image)

Returns generation ID and initial status after submitting an image-to-image request.

{
"success": true,
"data": {
"generationId": "string (UUID)",
"status": "string (starting)",
"creditCost": "integer"
}
}

Image-to-Image (Multi images)

Returns generation ID and initial status after submitting a multi-image reference request.

{
"success": true,
"data": {
"generationId": "string (UUID)",
"status": "string (starting)",
"creditCost": "integer"
}
}

Troubleshooting

Debugging

Every response includes an X-Request-ID header. Include this ID when contacting support for faster issue resolution.

Authentication Failed

HTTP 401 - Token is invalid or expired

{
"success": false,
"error": "AUTHENTICATION_FAILED",
"message": "Authentication failed."
}

Missing API Token

HTTP 401 - Authorization header not provided

{
"success": false,
"error": "MISSING_API_TOKEN",
"message": "Missing API token. Include it in Authorization header as \"Bearer YOUR_API_TOKEN\" or in X-API-Key header."
}

Invalid API Token

HTTP 401 - Token format is incorrect or not found

{
"success": false,
"error": "INVALID_API_TOKEN",
"message": "Invalid or expired API token."
}

Failed to Validate Token

HTTP 500 - Server error during token validation

{
"success": false,
"error": "FAILED_TO_VALIDATE_TOKEN",
"message": "Failed to validate API token."
}

Invalid JSON

HTTP 400 - Request body is not valid JSON

{
"success": false,
"error": "INVALID_JSON",
"message": "Request body must be valid JSON. Please check your request format."
}

Validation Error

HTTP 400 - Request parameters failed validation

{
"success": false,
"error": "VALIDATION_ERROR",
"message": "One or more request parameters are invalid. Please check the required fields."
}

Invalid Generation ID

HTTP 404 - Generation ID not found or doesn't belong to your account

{
"success": false,
"error": "INVALID_GENERATION_ID",
"message": "Invalid generation ID format. Must be a valid UUID."
}

NSFW Content Detected

HTTP 400 - Prompt or image contains inappropriate content

{
"success": false,
"error": "NSFW_CONTENT_DETECTED",
"message": "Your prompt contains content that violates our content policy. Please modify your prompt and try again."
}

Image Size Limit Exceeded

HTTP 400 - Reference image exceeds maximum file size (typically 10MB)

{
"success": false,
"error": "IMAGE_SIZE_LIMIT_EXCEEDED",
"message": "Total image size exceeds 20MB limit. Current total: 25.50MB."
}

Image Download Failed

HTTP 400 - Unable to download or process reference image from provided URL

{
"success": false,
"error": "IMAGE_DOWNLOAD_FAILED",
"message": "Could not download image from the provided URL. Please verify the URL is accessible and points to a valid image."
}

Insufficient Credits

HTTP 402 - Account does not have enough credits for this generation

{
"success": false,
"error": "INSUFFICIENT_CREDITS",
"message": "Not enough credits to complete this request. Required: 2 credits. Please add more credits to your account."
}

Account Not Found

HTTP 404 - Account associated with token not found

{
"success": false,
"error": "ACCOUNT_NOT_FOUND",
"message": "Account not found. Please verify your account ID."
}

Generation Not Found

HTTP 404 - Generation with specified ID does not exist

{
"success": false,
"error": "GENERATION_NOT_FOUND",
"message": "Generation not found or access denied."
}

Rate Limit Error

HTTP 429 - Too many requests, please slow down and retry after reset time

{
"success": false,
"error": "RATE_LIMIT_ERROR",
"message": "You can create up to 10 generations per minute. Please wait and try again."
}

Concurrent Generation Error

HTTP 429 - Maximum concurrent generations reached (1 max)

{
"success": false,
"error": "CONCURRENT_GENERATION_ERROR",
"message": "You already have a generation in progress. Please wait for it to complete."
}

Fetch Failed

HTTP 500 - Failed to fetch data from external service

{
"success": false,
"error": "FETCH_FAILED",
"message": "Failed to fetch images. Please try again."
}

Image Upload Failed

HTTP 500 - Failed to upload generated images to storage

{
"success": false,
"error": "IMAGE_UPLOAD_FAILED",
"message": "Failed to process image 1. Please ensure the image is valid and accessible."
}

Generation Update Failed

HTTP 500 - Failed to update generation status in database

{
"success": false,
"error": "GENERATION_UPDATE_FAILED",
"message": "Could not update the generation record. Please try again or contact support if the issue persists."
}

Generation Init Failed

HTTP 500 - Failed to initialize generation in database

{
"success": false,
"error": "GENERATION_INIT_FAILED",
"message": "Could not initialize your generation request. Please try again."
}

Credit Processing Failed

HTTP 500 - Failed to process credit deduction from account

{
"success": false,
"error": "CREDIT_PROCESSING_FAILED",
"message": "Could not process credit payment. Please try again or contact support."
}

Generation Start Failed

HTTP 500 - Failed to start generation process on AI service

{
"success": false,
"error": "GENERATION_START_FAILED",
"message": "Failed to start image generation. Your credits have been refunded. Please try again."
}

Internal Server Error

HTTP 500 - Unexpected server error, contact support with error details

{
"success": false,
"error": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred. Please try again or contact support if the issue persists."
}

Common Issues and Solutions

How to Fix Authentication Issues

Your API token is invalid or missing.

  • Check token is in Authorization header
  • Verify token format: Bearer YOUR_TOKEN
  • Create a new token if expired
  • Check for extra whitespace in token

How to Fix NSFW Content Issues

Your prompt or image triggered safety filters.

  • Rephrase prompt to be less explicit
  • Use different reference images
  • Review content policy guidelines
  • Remove suggestive keywords

How to Fix Insufficient Credits

Your account needs more credits.

  • Check credit balance via /account
  • Purchase credits in dashboard
  • Reduce num_outputs parameter
  • Use cheaper models for testing

How to Fix Rate Limit Issues

You've exceeded rate limits.

  • Check X-RateLimit-Reset header
  • Implement exponential backoff
  • Wait for current generation to complete (only 1 concurrent allowed)
  • Reduce request frequency (max 10 per 60 seconds)

Generation Stuck in "processing"

Generation taking too long.

  • Generations automatically cancel after 50 seconds
  • You will receive a full refund for canceled generations
  • Use the "Fix stuck images" button in your dashboard to check and resolve stuck generations
  • Contact support if issues persist