Skip to main content


This page introduces how to use Hive Visual Moderation API in Agora SDK to empower your app with accurate content moderation for live video streams.

Hive Visual Moderation API and Agora SDK work together as follows:

  1. When enableContentInspect is called, Agora SDK takes screenshots of the local user's video and uploads the screenshots to the Agora server.
  2. Agora server sends the screenshots to Hive Visual Moderation API.
  3. Hive returns the classification result of the local user's video to the callback URL specified in enableContentInspect.


Integrate Hive Visual Moderation API

1. Client-side: Enable content moderation

To use Hive Visual Moderation API in Agora SDK, you need to call the enableContentInspect method.

You can use the following sample code:

ContentInspectConfig config = new ContentInspectConfig();
config.extraInfo = "try Hive";
config.moduleCount = 1;
config.ContentWorkType = ContentInspectConfig.CONTENT_INSPECT_TYPE_WORK_DEVICE_CLOUD;
config.DeviceWorkType = ContentInspectConfig.CONTENT_INSPECT_DEVICE_AGORA;
config.modules[0].type = ContentInspectConfig.CONTENT_INSPECT_TYPE_MODERATION; // Be sure to set type as MODERATION
config.modules[0].vendor = ContentInspectConfig.CONTENT_INSPECT_VENDOR_HIVE; // Set Hive as the content moderation service provider
config.modules[0].callbackUrl = "Add your callback URL"; // Add the URL to receive the callbacks sent from Hive
config.modules[0].frequency = 2; // Set content moderation to run every 2 seconds
mRtcEngine.enableContentInspect(true, config);

2. Server-side: Receive HTTP response from Hive

After Agora server sends the screenshots to Hive, Hive returns the results to your callback URL in the form of an HTTP response. For full details, see Hive response formats.


Hive configuration email

Your email must include the following information:

AppIdAgora App ID
desc(Optional) Description of your project
callback_urlYour callback URL to receive classification results from Hive
moderation_upload_policySet it to one of the following:
  • Any combination of "porn", "sexy", and "neutral". For example: ["porn", "sexy"] means to save screenshots classified as "porn" or "sexy".
  • [""], which means do not save any screenshot. Agora does not recommend this option because you would not be able to verify the classification results.
  • oss_vendor(Optional) If moderation_upload_policy is not [""], set it to "aws" or "aliyun", and provide your OSS configuration (see below).

    OSS configuration

    • If your OSS provider is AWS:
      aws_oss_access_key_idAWS AccessKeyId
      aws_oss_access_key_secretAWS AccessKeySecret
      aws_oss_bucket_nameAWS bucket name. See Bucket
      aws_oss_endpointAWS endpoint. See Endpoint
      aws_oss_fileName_prefixBucket folder path prefix delimited by "/"
      aws_oss_regionAWS region. See Region
    • If your OSS provider is Aliyun:
      aliyun_oss_access_key_idAliyun AccessKeyId
      aliyun_oss_access_key_secreAliyun AccessKeySecret
      aliyun_oss_bucket_nameAliyun OSS bucket name. See Bucket
      aliyun_oss_endpointAliyun endpoint. See Endpoint
      aliyun_oss_fileName_prefixBucket folder path prefix delimited by "/"

    The following is an example of the configuration e-mail:

    Hive Extension Activation Request
    AppId: 12345678
    desc: Video conference moderation results
    moderation_upload_policy: ["porn", "sexy"]
    oss_vendor: aws
    aws_oss_access_key_id: 12345678
    aws_oss_access_key_secret: abcd123
    aws_oss_bucket_name: moderated-pictures
    aws_oss_region: cn-north-1
    aws_oss_fileName_prefix: compliance/content-moderation/

    Page Content