All Products
Search
Document Center

AI Guardrails:FAQ about the AI Guardrails API

Last Updated:Jun 08, 2026

Frequently asked questions about calling the AI Guardrails API, including moderation limits, SDK usage, and callback configuration.

Can multiple moderation results be returned each time an asynchronous operation of AI Guardrails is called?

No. Each asynchronous call returns only one moderation result.

How can I query the statistics on AI Guardrails API calls?

The Content Moderation console shows aggregated API call counts for image, video, text, moderation over the past year. View statistics.

Which operation can I call to moderate text?

Call the /green/text/scan operation to moderate text for violations.

How do I give feedback on the errors in text moderation results?

If text moderation results are inaccurate, call /green/text/feedback to report the error.

How do I view the descriptions of the parameters that are returned after an AI Guardrails operation is called?

Common response parameters and HTTP status codes are documented in Common parameters.

Can I include the signature information about an API request in the request body?

No. The signature must be in the Authorization header. We recommend using an AI Guardrails SDK (Java, Python, PHP, etc.) instead of signing manually. Common parameters and SDK overview.

Can URLs that link to undesirable content in text be detected during text moderation?

No. Text moderation detects only text-based violations, not URLs linking to undesirable content.

How long does it take to moderate content by calling an AI Guardrails operation?

Moderation duration varies by content type:

  • Images: ~300 ms per image, excluding download time.

  • Videos:

    • Video files: 1x to 6x playback speed, excluding download time. At 6x speed, a 6-minute video takes about 1 minute.

    • Video streams: Results are returned within 1s after each frame is captured.

  • Text: Results are returned within 50 ms.

Can I use Composer to download the AI Guardrails SDK for PHP?

Yes, provided your Composer supports PHP 5.3 or later. Installation.

Can I call the /green/text/scan operation to moderate English text in AI Guardrails?

Yes. /green/text/scan.

Can I call a video moderation operation to moderate a video whose size is larger than 2 GB in AI Guardrails?

The default single-video size limit is 200 MB. Contact technical support to raise it up to 2 GB. For videos larger than 2 GB, segment them before moderation. The default frame capture limit is 200 (maximum 3600). Set the maxFrames parameter for large videos. /green/video/asyncscan and /green/video/results.

What permissions do I need to call an AI Guardrails operation? How are the permissions granted?

Use a RAM user's AccessKey ID and AccessKey secret. The RAM user must be granted the required permissions first. Authorize a RAM user to call the AI Guardrails API.

What is the size limit of an image to be moderated in AI Guardrails?

Maximum: 20 MB file size, 30,000 pixels in height or width, and 0.25 billion total pixels. /green/image/scan.

What is a concurrency limit for calling AI Guardrails operations?

The concurrency limit is the total number of images, videos, or text entries that can be moderated simultaneously. This applies to both pay-as-you-go and subscription billing.

The following table describes the concurrency limits for calling AI Guardrails operations to moderate different types of objects.

Moderation object

Default concurrency limit

Unit

Description

Image

50

N/A

The maximum number of images that can be moderated per second.

Video

20

N/A

The maximum number of videos that can be moderated at the same time. Files and streams are not differentiated.

Text

100

N/A

The maximum number of text entries that can be moderated per second. Each text entry contains less than 200 characters.

Note
  • Moderation within the default concurrency limits is free. To increase limits, contact your sales manager. Higher limits incur extra charges.

  • Multi-scenario moderation of a single object counts as concurrency 1. For example, moderating one image for both pornography and terrorism consumes 1 concurrency slot.

Can I submit the internal URLs of objects for moderation?

No. Only publicly accessible URLs are supported. To prevent data leaks, set a short validity period (for example, 10 minutes) for public URLs.

How do I moderate images that exceed the size limit?

Compress images before submission. Resolution above 256 × 256 pixels has minimal impact on moderation results.

Can I create HTTP requests to call AI Guardrails operations?

Yes, but each request must be signed. We recommend using the official SDKs instead.

Can I use the AccessKey pair of a RAM user to call AI Guardrails operations?

  • Yes, for API version V20160621 or later. SDK overview.

  • No, versions prior to 20160621 do not support this. Using a RAM user's AccessKey with an older API version returns an AccessDenied error.

Does the AI Guardrails API provide call examples?

Yes. Call examples are in the SDK reference. SDK overview.

Note

Call examples are updated as the API evolves. Check the official documentation regularly.

Can I use the SDK for .NET to call AI Guardrails operations?

No. Use SDKs for other languages or create HTTP requests directly. SDK overview and Request syntax.

Can AI Guardrails moderate images in the GIF format?

Yes. Supported formats: PNG, JPG, JPEG, BMP, GIF, and WEBP. /green/image/scan.

Can I extend the maximum download duration from 3s to a longer period of time when I call an AI Guardrails operation?

No. If download errors occur frequently, verify that the image URL is accessible and responds within 3s. Use the endpoint nearest to your server region. Endpoints.

How many images can be moderated at most each time the /green/image/scan operation is called in AI Guardrails?

Up to 100 images per synchronous call. Your concurrency limit must be at least 100 to process that many. Default limits: 50 images/s, 100 text entries/s, 20 video and audio streams. Synchronous moderation and Pricing.

Can I call a single AI Guardrails operation to simultaneously moderate content in multiple scenarios, such as pornography detection and terrorist content detection?

Yes. Specify multiple scenes in the Scenes parameter, for example ["porn", "terrorism"]. You are billed per scene: total cost = (number of images) × (price per scene). Synchronous moderation and Pricing.

What domain names and ports are available for calling AI Guardrails operations?

Allow access to *.aliyuncs.com on ports 80 and 443 in your network security policy.

How do I call a video moderation operation in AI Guardrails to moderate a video in ApsaraVideo VOD?

The Video Moderation API does not accept a VideoID from ApsaraVideo VOD directly. Instead, capture frames and upload the image sequence, or provide an accessible video URL. Asynchronous moderation.

Can AI Guardrails moderate M3U8 video files?

No. Supported video formats: AVI, FLV, MP4, MPG, ASF, WMV, MOV, WMA, RMVB, RM, FLASH, and TS. /green/video/asyncscan and /green/video/results.

How long does an asynchronous task for video moderation take?

Duration varies by content type (excluding download time):

  • Video files: 1x to 6x playback speed. At 6x, a 6-minute video takes about 1 minute.

  • Video streams: Results are returned within 1s after each frame is captured.

Can I call AI Guardrails operations in a region of the United States to moderate videos?

Yes. Endpoints.

What are the differences between the /green/video/syncscan and /green/video/asyncscan operations in AI Guardrails?

The /green/video/syncscan operation requires you to submit pre-captured frames. The /green/video/asyncscan operation accepts a video URL directly.

The /green/video/asyncscan operation supports both video files and streams. You can submit captured frames or a video URL. Results are not returned in real time — set the callback parameter or poll with /green/video/results. /green/video/syncscan and /green/video/asyncscan and /green/video/results.

Can I set the callback parameter in an API request for asynchronous image moderation that is implemented by using the AI Guardrails SDK for Java?

Yes. Image moderation.

What does the bizType parameter specify in AI Guardrails?

The bizType parameter specifies a business scenario, which maps to a moderation policy. Create custom scenarios matching your requirements, then specify the scenario in API requests to apply the corresponding policy. Customize policies for machine-assisted moderation.

What is the purpose of associating a text library with multiple business scenarios in AI Guardrails?

Associate a custom text or image library with a business scenario so it only applies when that scenario is specified in API requests. If no scenario is specified, all enabled libraries are used. Manage custom text libraries.

Why is the value of the checksum parameter in the callback notification different from the calculated value after I call the /green/video/asyncscan operation?

The checksum is a SHA-256 hash of <UID> + <Seed> + <Content>. UID is your Alibaba Cloud account ID (found in the console). When your server receives a callback, recompute the hash and verify it against the received checksum to detect tampering. Enable callback notifications.

Why is no dataId returned after I call the /green/text/scan operation in AI Guardrails?

If you include the DataId parameter in your text moderation request, the API response includes the corresponding DataId. For more information, see Synchronous text moderation.

Why are different labels returned for the same image in single-scenario moderation and multi-scenario moderation?

This typically happens because single-scenario and multi-scenario configurations differ. Contact algorithm engineers to check for configuration conflicts, or moderate the image in each scenario separately. /green/image/scan and Image moderation.

Why is the context parameter not returned in text moderation results?

The context parameter returns risky terms that triggered the match. If the text was flagged by other policies such as algorithm models or text patterns, this parameter is not returned. /green/text/scan.

Why is the filteredContent parameter returned but the context parameter not returned in text moderation results?

The FilteredContent field shows the moderated text with any detected terms replaced by asterisks (*). This field is returned if the text matches custom keywords or a similarity-based algorithm. The Context field, which contains the specific risky terms, is returned only when a keyword is matched. It is not returned if the content is flagged by an algorithm model or a similarity policy. For more information, see Synchronous text moderation.

Why do text moderation results contain no emojis?

AI Guardrails cannot recognize emojis. Emoji characters are filtered out in returned moderation results.

Do the accuracy and recall rate of synchronous image moderation differ from those of asynchronous image moderation in AI Guardrails?

No. Both have the same moderation effects — they differ only in the calling method (synchronous vs. asynchronous).

Why am I unable to download the ClientUploader utility class that is used to moderate local files and binary files for the AI Guardrails SDK for Java?

Download the ClientUploader utility class and import it into your project. Installation.

Why does the aliyunsdkcore library fail to be installed for the AI Guardrails SDK for Python 3.5.4 and 3.8.8?

Use a mainstream Python 3.x version. If installation still fails, download the aliyunsdkcore library manually and import it into your project. Installation.

How do I install the aliyunsdkgreenextension utility class of the AI Guardrails SDK for Python?

Download the aliyunsdkgreenextension utility class and import it into your project. Installation.

Import the utility class:

from aliyunsdkgreenextension.request.extension import HttpContentHelper

Can a custom term library in AI Guardrails contain terms in languages other than English?

No. Custom term libraries support only English letters and digits.

How long is the validity period of an OSS URL for an image or a video that is uploaded from a local machine to OSS for content moderation?

The OSS URL is valid for 1 hour.

How am I charged for moderating a live video stream in AI Guardrails?

Billing is based on the number of captured frames. Divide the stream duration by the capture interval to calculate the frame count.

Example: a 1-hour stream with a 5-second capture interval produces 3,600 ÷ 5 = 720 frames. You are charged for 720 frames.

How are the moderation results of a live stream returned to the callback URL in AI Guardrails?

Results are returned individually each time a violation is detected. After moderation completes, the overall results are returned.

Why does my callback URL still receive data after AI Guardrails stops moderating a live stream?

After the moderation task stops, your callback URL may still receive data briefly due to latency.

Does a task for moderating a live stream stop if the live stream is interrupted or unavailable after the task is submitted?

If the stream is interrupted or unavailable, AI Guardrails retries three times at minimum 10-second intervals. If the stream is still unavailable after 30 seconds, the task stops.

When is the status code 200 returned in live stream moderation?

Status 200 is returned when moderation succeeds or when the stream ends/is interrupted. Status 280 indicates the stream is still being moderated.