Error Codes

The API uses standard HTTP status codes. Error responses include a JSON body with details when available.

HTTP Status Codes

200Success

Request accepted. For mutating endpoints, a task has been created.

{ "task_id": "..." }
400Bad Request

Validation failed. Check the errors array for specific field issues.

{ "errors": [{ "msg": "..." }] }
401Unauthorized

Invalid, missing, or revoked API key.

{}
402Payment Required

Your account doesn't have enough credits for this operation.

{ "errors": [{ "msg": "Insufficient credits" }] }
429Too Many Requests

You've exceeded the rate limit for your plan. Back off and retry.

{ "errors": [{ "msg": "Rate limit exceeded" }] }
500Internal Server Error

Something went wrong on our end. If this persists, contact support.

{}

Error Response Format

When the API returns a 400 error, the response includes an errors array with one or more error objects:

{
  "errors": [
    { "msg": "prompt is required" },
    { "msg": "aspect_ratio must be a valid ratio (e.g., 16:9)" }
  ]
}

Common Validation Errors

Error MessageCause
prompt is requiredMissing prompt field on /imagine or /shorten.
parent_task_id is requiredMissing parent task reference on action endpoints.
parent_task_id not foundThe referenced task doesn't exist or belongs to another account.
parent task is not finishedTrying to act on a task that hasn't completed yet.
index must be 1, 2, 3, or 4Invalid grid position on /upscale-1x or /variations.
image_urls must contain 2-5 URLsWrong number of images for /blend.
task_ids must contain 2-20 IDsWrong number of IDs for /fetch-many.

Rate Limits

Rate limits depend on your subscription plan. When you hit the limit, the API returns a429 status. Use exponential backoff when retrying.

PlanRate Limit
Basic5 concurrent tasks
Starter10 concurrent tasks
Growth25 concurrent tasks
EnterpriseCustom