All AI Guardrails API responses are returned in JSON format and share a common set of response fields and error codes.
Common response parameters
Every API response includes the following fields.
| Name | Type | Description |
|---|---|---|
| Code | Integer | The error code. 2xx indicates success, 4xx indicates a client error, and 5xx indicates a server-side error. For the full list of codes and their meanings, see Common error codes. |
| Msg | String | A description of the error. |
| RequestId | String | The unique ID of the request. Use this ID to locate issues. |
| Data | Integer / String / JSONObject | The business response data returned by the API. This field may be empty if an error occurs. The value is typically a JSON object or array. |
Common error codes
| Code | Msg | Description |
|---|---|---|
| 200 | OK | The request succeeded. |
| 280 | PROCESSING | The task is still in progress. Wait a few seconds (for example, 5s) and query the result again. |
| 400 | BAD_REQUEST | The request is invalid. Check the request parameters and try again. |
401 | NOT_ALLOWED | The request failed. This is usually because an insecure URL for an image or video file was used. |
404 | NOT_FOUND | The content to be moderated was not found. This is usually because the image or video content cannot be downloaded. Confirm that the content is accessible over the Internet. |
| 404 | NOT_FOUND | The content to moderate was not found. The image or video cannot be downloaded. Make sure the content is accessible over the internet. |
403 | FORBIDDEN | The access request failed. This is usually because the URL of your image or video file is inaccessible. Confirm that the content is accessible over the Internet and that no hotlink protection policy is enabled. |
| 403 | FORBIDDEN | Access denied. The image or video URL is inaccessible. Make sure the content is accessible over the internet and that hotlink protection is not enabled. |
| 480 | DOWNLOAD_FAILED | Download failed. Make sure the content size and resolution (if any) are within the API limits. |
| 500 | GENERAL_ERROR | A temporary server-side error occurred. Retry the request. If the error persists, contact support through Online Service. |
| 503 | ServiceUnavailable | A system error occurred. Verify that the requested domain name is valid. If it is, contact support through Online Service and provide the case details. |
| 580 | DB_FAILED | A database operation failed. Retry the request. If the error persists, contact support through Online Service. |
| 581 | TIMEOUT | The request timed out. Retry the request. If the error persists, contact support through Online Service. |
| 585 | CACHE_FAILED | A cache error occurred. Retry the request. If the error persists, contact support through Online Service. |
| 586 | ALGO_FAILED | An algorithm error occurred. Contact support through Online Service. |
| 587 | MQ_FAILED | A middleware error occurred. Contact support through Online Service. |
| 588 | EXCEED_QUOTA | The request rate exceeds the quota. Default quotas: 50 images/s for image moderation, 20 ingest endpoints/s for video moderation, 20 ingest endpoints/s for audio moderation, 100 entries/s for text moderation, and 10 images/s for image OCR. To increase your quota, contact support through Online Service. |
| 589 | TOO_LARGE | The content is too large. Make sure the content is within the API limits and retry. If the error persists, contact support through Online Service. |
| 590 | BAD_FORMAT | The content format is invalid. Make sure the content is within the API limits. |
| 591 | CONNECTION_POOL_FULL | The connection pool is full. Contact support through Online Service. |
| 592 | DOWNLOAD_TIMEOUT | The download timed out. The download time limit is 3 seconds. Make sure the content size is within the API limits. |
| 594 | EXPIRED | The task expired. For example, the TaskId expired. |
| 595 | CATCH_FRAME_FAILED | Frame capture failed. Contact support through Online Service. |
| 596 | PERMISSION_DENY | Access is denied. Possible causes: the account is not authorized, has an overdue payment, has not activated the service, or has been disabled. Check the returned error description for details. |