AI GPT ImageAI GPT Image

Error Codes

Errors use the same response shape as successful requests.

{
  "code": 422,
  "msg": "model is not supported",
  "data": null
}

Common errors

HTTPCodeMessageMeaning
400400invalid requestThe JSON body or required query parameter is invalid
401401authentication failedAPI key is missing, invalid, or disabled
402402insufficient creditsThe user does not have enough credits
404404task not foundThe task does not exist or does not belong to the API key
422422validation errorThe model or input fields are not supported
429429rate limit exceededThe API key exceeded its tier limit
500500server errorInternal server or provider error

Handling retries

Use X-Request-ID when creating tasks. If your backend retries a request, the same request ID can return the existing task instead of creating a duplicate task.