This topic lists frequently asked questions (FAQ) about Content Moderation API.

How long does Content Moderation API implement moderation?

The amount of time it takes to complete moderation varies with the moderation object.
  • Images: An image takes about 300 milliseconds to moderate, excluding the download time.
  • Videos:
    • Video files: A video file can be moderated at about one to six times the playback speed, excluding the download time. For example, a six-minute video takes one minute to moderate.
    • Video streams: The amount of time it takes to moderate video streams varies with the frame rate. Moderation results are returned within a second of the frame being captured.
  • Text: Moderation results are returned within 50 milliseconds.

Does Content Moderation API impose a concurrency limit?

Note The concurrency limit specifies the total number of images, videos, or text entries that can be moderated at the same time. This limit applies to both pay-as-you-go and subscription plans.
Yes. The following table describes the concurrency limits imposed by Content Moderation API on different types of moderation 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 Stream The maximum number of videos that can be moderated at the same time. Files and streams are not differentiated.
Text 100 Entry The maximum number of text entries that can be moderated per second. Each text entry contains less than 200 characters.
Note
  • Images, videos, or text entries moderated within the default concurrency limit are free of charge. To raise the default concurrency limit, submit a ticket. You will incur charges if you raise the default concurrency limit.
  • By default, if an object is moderated in multiple scenarios simultaneously, it is recorded as a single object. For example, if you request the pornography detection and terrorist content moderation for an image at the same time, it is calculated as a single operation.

Can I change the subscription plan of Content Moderation?

Yes. You can only upgrade your subscription plan. You can upgrade your subscription plan in the User Center console. For more information, see Subscription plan.

What is the difference between synchronous moderation and asynchronous moderation?

  • If you use synchronous moderation, the moderation results are returned in real time. Synchronous moderation is a common method to moderate images and text. After you initiate a synchronous moderation task, you must wait for the server to return results before proceeding with other business logic.
  • If you use asynchronous moderation, moderation results are not returned in real time. You must poll the moderation results or configure a callback notification to obtain asynchronous moderation results from the server. Asynchronous moderation is a common method to moderate videos and audio clips. After you initiate an asynchronous moderation task, you can proceed with other business logic without the need to wait for results from the server.

Can I retain evidence of unsafe objects after moderation?

Yes. You can determine whether to save the moderation results locally or to the cloud. Manual operations are required to retain the moderation results.

How do I moderate local images, video files, audio files, or binary video streams that do not have public URLs?

We recommend that you use OSS. You can store local files in buckets, obtain public URLs of the files, and then submit these URLs for moderation. For more information, see What is OSS?

Can I submit the internal URLs of objects for moderation?

No. Only public URLs are supported for moderation. If you worry about the risks of data leaks, we recommend that you set a short validity duration for the public URLs, such as ten minutes.

How do I moderate images that exceed the size limit?

We recommend that you compress source images before you submit them for moderation. When the resolution of an image is greater than 256 × 256, the resolution has little effect on the moderation result.

Can I create an HTTP request to call Content Moderation API?

Yes. You can create your own HTTP request to call Content Moderation API. However, you must sign the request, which is a tedious operation. We recommend that you use the SDK provided on the Alibaba Cloud official website to call the API.

Can I use the AccessKey pair of a RAM user to call Content Moderation API?

  • Yes. You can use the AccessKey pair of a RAM user to call Content Moderation API version 20160621 and later. For more information about required dependencies, see t17589.dita#reference_nh1_nkq_w2b.
  • You cannot use the AccessKey pair of a RAM user to call Content Moderation API versions earlier than 20160621. Otherwise, an "AccessDenied" error will be returned.

Does Content Moderation API provide call examples?

Yes. Content Moderation API provides call examples. You can download the examples in SDK Reference. For more information, see SDK overview.
Note The version date of a call example changes as the API is upgraded. We recommend that you check the official documentation on a regular basis.

What do I do if the "AlgorithmTimeOut" error is returned when I use synchronous OCR?

The "AlgorithmTimeOut" error is returned because the moderation timed out. OCR is a time-consuming process. When you call a synchronous OCR operation, the system sets a timeout period of three seconds. We recommend that you call a synchronous OCR operation when your image contains a small amount of text. If your image contains a large amount of text, the OCR process is very likely to time out.

If your business requires you to process images that contain a large amount of text, we recommend that you call an asynchronous OCR operation. This way, the system retries the operation multiple times and optimizes the OCR process to avoid a timeout. For more information, see Detect text in images asynchronously.

What do I do if an error code 400 is returned with the message "the request is expired"?

Typically, the error code 400 is returned because the request parameters are incorrect. We recommend that you check whether the parameters in the API operation were passed correctly.

What do I do if the "Your using subaccount is not authorized" error message is returned after I have activated Content Moderation?

This error message is returned because the RAM user that initiated the request does not have the associated permissions. We recommend that you use an Alibaba Cloud account to grant related permissions to the RAM user. For more information, see RAM user authorization.

What do I do if the "Specified endpoint or uri is not valid" error message is returned during local testing?

This error message is returned because the corresponding language dependency is not specified or the version of aliyun-**-sdk-core is earlier than required. We recommend that you reference the sample code in SDK references. For more information, see SDK overview.

What do I do if the "SDK.ServerUnreachable: Speicified endpoint or uri is not valid" error message is returned when I use Content Moderation API on an ECS instance but no exceptions are reported in local testing?

This error message is returned because your Elastic Compute Service (ECS) instance is not connected to the Internet. Content Moderation API can be accessed only through the Internet. You can submit a ticket to the ECS service team for technical support.