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
| Code | Description | Common Causes |
|---|---|---|
| 200 | OK | Request processed successfully. |
| 400 | Bad Request | Invalid input, missing parameters, or content length exceeded. |
| 401 | Unauthorized | Missing or invalid API key. |
| 402 | Payment Required | Insufficient token balance. |
| 403 | Forbidden | Tier limits exceeded or feature not available in current plan. |
| 429 | Too Many Requests | Rate limit exceeded. |
| 500 | Internal Server Error | Server-side error. Please try again later. |