Error Handling

Standard HTTP status codes and error response formats.

Error Response Format

When an error occurs, the API returns a JSON object with a message property describing the issue and a statusCode property.

{
  "message": "An error occurred during generation.",
  "statusCode": 500
}

Status Codes

CodeDescriptionCommon Causes
200OKRequest processed successfully.
400Bad RequestInvalid input, missing parameters, or content length exceeded.
401UnauthorizedMissing or invalid API key.
402Payment RequiredInsufficient token balance.
403ForbiddenTier limits exceeded or feature not available in current plan.
429Too Many RequestsRate limit exceeded.
500Internal Server ErrorServer-side error. Please try again later.