Detect and filter risky content in audio files and live streams using Qwen LLM, with support for 26 languages including Chinese dialects.
Overview
Voice Moderation (Large Model Edition) uses the Qwen LLM, fine-tuned for audio content risk detection. The following services are available:
The China-integrated service (audio_standard_cn) routes moderation requests through China mainland infrastructure. It is available to international site users at USD 3.50 per 1,000 minutes, with resource package support. Use this service when your business targets users in China mainland and requires compliance with local content moderation standards.
-
Audio and Video Media Detection_LLM Edition:
Moderates audio files. Uses the Qwen large model for enhanced speech recognition and risk detection. Supports 26 languages, including Chinese, English, Japanese, German, Korean, Russian, French, Portuguese, Arabic, Italian, Spanish, Hindi, Indonesian, Thai, Turkish, Ukrainian, Vietnamese, Czech, Danish, Filipino, Finnish, Icelandic, Malay, Norwegian, Polish, and Swedish.
-
Social & Entertainment Live Stream Detection_LLM Version:
Moderates live audio streams. Uses the Qwen large model for enhanced speech recognition and risk detection. Supports 26 languages, including Chinese, English, Japanese, German, Korean, Russian, French, Portuguese, Arabic, Italian, Spanish, Hindi, Indonesian, Thai, Turkish, Ukrainian, Vietnamese, Czech, Danish, Filipino, Finnish, Icelandic, Malay, Norwegian, Polish, and Swedish.
Service selection
|
Service |
Description |
Supported regions |
Typical scenarios |
|
Audio and Video Media Detection_LLM Edition (audio_detection_byllm_global) |
|
Singapore |
|
|
Social & Entertainment Live Stream Detection_LLM Version (live_detection_byllm_global) |
|
Singapore |
|
Billing
Voice Moderation (Large Model Edition) supports pay-as-you-go billing and resource packages.
Pay-as-you-go
Pay-as-you-go is the default billing method. You are billed based on actual usage, with no charges when the service is idle.
|
Billing item |
Service |
Unit price |
|
Voice Moderation Advanced (audio_advanced) |
|
USD 18 per 1,000 minutes Note
Billing is based on the total duration of processed audio. For example, processing 100 minutes of audio with Audio and Video Media Detection_LLM Edition costs USD 1.80. |
|
Voice Moderation (Large Model Edition) Standard (China-integrated) (audio_standard_cn) |
|
USD 3.50 per 1,000 minutes Note
Billing is based on the total duration of processed audio. For example, processing 100 minutes of audio with the China-integrated service costs USD 0.35. |
Content Moderation pay-as-you-go billing is settled every 24 hours. In the billing details, moderationType indicates the moderation type. View billing details.
Resource package deduction
For high or consistent moderation volume, purchase a resource package. Larger packages offer greater discounts, and multiple packages can be used simultaneously. Purchase Content Moderation V2.0 Resource Package.
|
Moderation type |
Deduction factor |
|
Voice Moderation Advanced (audio_advanced) |
Each minute of successfully processed audio deducts 60 units from your resource package. Note
For example, processing 1 minute of audio with a 100-unit package deducts 60 units, leaving 40 units. |
|
Voice Moderation (Large Model Edition) Standard (China-integrated) (audio_standard_cn) |
Each minute of successfully processed audio deducts 11.67 units from your resource package. Note
For example, processing 1 minute of audio with a 100-unit package deducts 11.67 units, leaving 88.33 units. |
Deductions apply to Voice Moderation (Large Model Edition) API usage first. When the package is exhausted, billing switches to pay-as-you-go. Monitor your balance in the Resource Package System and configure low-balance alerts.
Get started
Step 1: Activate the service
Go to the Voice ModerationVoice Moderation activation page to activate the service.
Pay-as-you-go billing applies by default — no charges when idle. Purchase a resource package for tiered discounts on high-volume usage.
Step 2: Grant permissions to a RAM user
Before calling the API, grant permissions to a RAM user. API calls require an AccessKey pair from your Alibaba Cloud account or a RAM user. For more information, see Obtain an AccessKey.
-
Log on to the RAM console using your Alibaba Cloud account or a RAM administrator account.
-
Create a RAM user. For more information, see Create a RAM user.
-
Attach the
AliyunYundunGreenWebFullAccesssystem policy to the RAM user. For more information, see Grant permissions to a RAM user. The RAM user can then call Content Moderation API operations.
Step 3: Install and integrate the SDK
Follow the Voice Moderation SDK and Integration Guide to install and integrate the SDK. The service is available in the following regions:
|
Region |
Public endpoint |
VPC endpoint |
Services |
|
Singapore |
green-cip.ap-southeast-1.aliyuncs.com |
green-cip-vpc.ap-southeast-1.aliyuncs.com |
audio_detection_byllm_global, live_detection_byllm_global |
Step 4: Adjust moderation rules (Optional)
In the Content Moderation console, configure detection rules, manage text moderation rules, clone services, set up custom dictionaries, view moderation logs, and monitor usage.
API reference
Usage notes
Submit audio content moderation tasks with this API. To construct HTTP requests, see Making native HTTP calls. For SDK usage, see the Voice Moderation SDK and integration guide.
-
APIs:
-
VoiceModeration: Submit an Voice Moderation task. -
VoiceModerationResult: Query moderation task results. -
VoiceModerationCancel: Cancel a moderation task.
-
-
Billing:
Paid API. Only requests returning HTTP status code 200 are billed. For more information, see Billing.
-
Service performance:
Service performance
Description
Audio file size
Supports audio files up to 500 MB.
Audio and video file formats
Supported audio file formats: MP3, WAV, AAC, WMA, OGG, M4A, and AMR.
Supported video file formats: AVI, FLV, MP4, MPG, ASF, WMV, MOV, RMVB, and RM.
Live audio stream
Supported protocols: RTMP, HLS, HTTP-FLV, and RTSP.
Queries per second (QPS)
100 QPS for task submission.
Concurrent streams
50 concurrent streams by default.
Submit a moderation task
Request parameters
|
Parameter |
Type |
Required |
Example value |
Description |
|
Service |
String |
Yes |
audio_detection_byllm_global |
The moderation service to call. Valid values:
|
|
ServiceParameters |
JSONString |
Yes |
The parameters required by the moderation service, formatted as a JSON string. For a description of each parameter, see ServiceParameters. |
Table 1. ServiceParameters
|
Parameter |
Type |
Required |
Example value |
Description |
|
url |
String |
Yes. You must provide the file by using one of the following three methods:
|
http://aliyundoc.com/test.mp3 |
The URL of the audio or video file to moderate. Public HTTP and HTTPS URLs are supported. |
|
ossBucketName |
String |
bucket_01 |
The name of the authorized OSS Note
To use an internal OSS URL, you must first use your Alibaba Cloud account (root account) to grant access on the Cloud Resource Access Authorization page. |
|
|
ossObjectName |
String |
20240307/07/28/test.mp3 |
The name of the object in the authorized OSS |
|
|
ossRegionId |
String |
cn-shanghai |
The |
|
|
callback |
String |
No |
http://aliyundoc.com |
The The
Note
Your callback endpoint must return an HTTP |
|
seed |
String |
No |
abc**** |
A random string used in the It can consist of letters, digits, and underscores (_), with a maximum length of 64 characters. You can customize this value to verify that Note
You must specify this parameter when you provide a callback URL. |
|
cryptType |
String |
No |
SHA256 |
When using a
|
|
liveId |
String |
No |
liveId1**** |
The unique identifier for the live audio stream. This parameter prevents duplicate moderation tasks for the same stream. When provided, the service checks for an existing active task using the composite key |
|
dataId |
String |
No |
voice20240307*** |
A custom identifier for the moderated content. Use this ID to uniquely identify your business data. It supports letters (case-insensitive), digits, underscores (_), hyphens (-), and periods (.), up to 64 characters. |
|
referer |
String |
No |
www.aliyun.com |
The |
Response parameters
|
Parameter |
Type |
Example value |
Description |
|
Code |
Integer |
200 |
The |
|
Data |
JSONObject |
{"TaskId": "AAAAA-BBBBB","DataId": "voice20240307***"} |
The response data. |
|
Message |
String |
OK |
The response message. |
|
RequestId |
String |
AAAAAA-BBBB-CCCCC-DDDD-EEEEEEEE**** |
The |
Examples
-
Request example
{
"Service": "audio_detection_byllm_global",
"ServiceParameters": {
"cryptType": "SHA256",
"seed": "abc***123",
"callback": "https://aliyun.com/callback",
"url": "http://aliyundoc.com/test.mp3"
}
}
-
Successful response example
{
"Code": 200,
"Data": {
"TaskId": "AAAAA-BBBBB",
"DataId": "voice20240307***"
},
"Message": "SUCCESS",
"RequestId": "AAAAAA-BBBB-CCCCC-DDDD-EEEEEEEE****"
}
Query task results
For an ongoing live stream moderation task, a query returns the most recent audio slices. After the task completes, the query returns all slices.
-
To query a moderation task, call the VoiceModerationResult operation.
-
Billing: This API is free of charge.
-
Query timing: Wait at least 30 seconds after submitting an asynchronous task before querying results. Results are retained for 24 hours and then automatically deleted.
QPS limit
This API supports up to 100 QPS per user. Excessive requests are throttled.
Request parameters
|
Parameter |
Type |
Required |
Example |
Description |
|
Service |
String |
Yes |
audio_detection_byllm |
The type of moderation service. |
|
ServiceParameters |
JSONString |
Yes |
The required service parameters, provided as a JSON string. For details, see ServiceParameters. |
Table 2. ServiceParameters
|
Parameter |
Type |
Required |
Example |
Description |
|
taskId |
String |
Yes |
AAAAA-BBBBB |
The ID of the task, returned upon task submission. |
Response parameters
|
Parameter |
Type |
Example |
Description |
|
Code |
Integer |
200 |
The status code. For more information, see Status codes. |
|
Data |
JSONObject |
The results of the audio content moderation. For more information, see Data. |
|
|
Message |
String |
OK |
The response message. |
|
RequestId |
String |
AAAAAA-BBBB-CCCCC-DDDD-EEEEEEEE**** |
The request ID. |
Table 3. Data
|
Parameter |
Type |
Example |
Description |
|
Url |
String |
https://aliyundoc.com/text.mp3 |
The URL of the moderated object. |
|
LiveId |
String |
liveId1**** |
The ID of the live audio stream (optional). |
|
DataId |
String |
voice20240307*** |
The data ID of the moderated object (optional). |
|
RiskLevel |
String |
high |
The combined risk level of all audio slices. Valid values are:
Note
Remediate high-risk content immediately. Manually review medium-risk content. For standard use cases, consider low-risk content safe. Review low-risk content only when high recall is required. |
|
SliceDetails |
JSONArray |
An array of objects with detailed results for each audio slice. For more information, see sliceDetails. |
Table 4. SliceDetails
|
Parameter |
Type |
Example |
Description |
|
StartTime |
Integer |
0 |
The start time of the sentence, in seconds. |
|
EndTime |
Integer |
4065 |
The end time of the sentence, in seconds. |
|
StartTimestamp |
Integer |
1678854649720 |
The start timestamp of the audio slice, in milliseconds. |
|
EndTimestamp |
Integer |
1678854649720 |
The end timestamp of the audio slice, in milliseconds. |
|
Text |
String |
Disgusting |
The text transcribed from the audio. |
|
Url |
String |
https://aliyundoc.com |
If the moderated content is from a live audio stream, this parameter provides a temporary URL to the corresponding audio segment. The URL is valid for 30 minutes. Save the content promptly if needed. |
|
RiskLevel |
String |
high |
The risk level of the audio slice. Valid values are:
|
|
Result |
JSONArray |
An array of objects that provides the moderation results. For more information, see Result. |
Table 5. Result
|
Parameter |
Type |
Example |
Description |
|
Label |
String |
political_entity |
The moderation label assigned to the content. The service may detect multiple labels. This includes labels from the text policy and labels specific to audio:
Note
By default, the detection of specified speaking and sexual sounds is disabled. To enable this feature, contact your account manager. |
|
Description |
String |
Suspected pornographic content |
A description of the Important
This field provides an explanation of the |
|
Confidence |
Float |
81.22 |
The confidence score, a value from 0 to 100 with up to two decimal places. Some labels do not have a confidence score. |
|
RiskLevel |
String |
high |
The risk level of the current label. Valid values are:
|
|
Riskwords |
String |
AA,BB,CC |
Detected risk words, separated by commas. This parameter is not returned for all labels. |
|
CustomizedHit |
JSONArray |
[{"LibName":"...","Keywords":"..."}] |
If a keyword from a custom library is detected, the |
|
RiskPositions |
JSONArray |
The positions of the detected risk words. For more information, see RiskPositions. |
Table 6. CustomizedHit
|
Parameter |
Type |
Example |
Description |
|
LibName |
String |
CustomLibrary1 |
The name of the custom library. |
|
Keywords |
String |
CustomKeyword1,CustomKeyword2 |
Detected custom keywords, separated by commas. |
Table 7. RiskPositions
|
Parameter |
Type |
Example |
Description |
|
RiskWord |
String |
AA |
The detected risk word. |
|
StartPos |
Integer |
10 |
The start position of the risk word. |
|
EndPos |
Integer |
12 |
The end position of the risk word. |
Examples
Request example
{
"Service": "audio_detection_byllm",
"ServiceParameters": {
"taskId": "AAAAA-BBBBB"
}
}
Successful response example
{
"Code": 200,
"Data": {
"DataId": "voice20240307***",
"LiveId": "liveId1****",
"RiskLevel": "high",
"SliceDetails": [
{
"StartTime": 0,
"EndTime": 4065,
"RiskLevel": "high",
"Result": [
{
"Label": "political_entity",
"Description": "Suspected political entity",
"Confidence": 100.0,
"RiskLevel": "high",
"RiskWords": "WordA,WordB",
"RiskPositions": [
{
"EndPos": 14,
"RiskWord": "WordA",
"StartPos": 16
}
]
}
],
"Text": "Content Moderation product test case",
"Url": "https://aliyundoc.com"
}
]
},
"Message": "OK",
"RequestId": "AAAAAA-BBBB-CCCCC-DDDD-EEEEEEEE****"
}
Cancel a moderation task
You can only cancel live stream moderation tasks. File-based moderation tasks cannot be canceled.
-
To cancel a moderation task, call the VoiceModerationCancel operation.
-
Billing: This API is free of charge.
Request parameters
|
Parameter |
Type |
Required |
Example value |
Description |
|
Service |
String |
Yes |
live_detection_byllm_global |
The moderation service type to cancel. Valid values:
|
|
ServiceParameters |
JSONString |
Yes |
The parameters for the moderation service, formatted as a JSON string. For details about each field, see ServiceParameters. |
Table 5. ServiceParameters
|
Parameter |
Type |
Required |
Example value |
Description |
|
taskId |
String |
Yes |
AAAAA-BBBBB |
The ID of the moderation task to cancel. |
Response parameters
|
Parameter |
Type |
Example value |
Description |
|
Code |
Integer |
200 |
The response status code. For more information, see Code description. |
|
Message |
String |
OK |
The response message. |
|
RequestId |
String |
AAAAAA-BBBB-CCCCC-DDDD-EEEEEEEE**** |
The unique ID of the request. |
Examples
-
Request example
{
"Service": "live_detection_byllm_global",
"ServiceParameters": {
"taskId": "AAAAA-BBBBB"
}
}
-
Successful response example
{
"Code": 200,
"Message": "OK",
"RequestId": "AAAAAA-BBBB-CCCCC-DDDD-EEEEEEEE****"
}
Callback message format
A callback message is a JSON object with the following fields:
|
Parameter |
Type |
Description |
|
checksum |
String |
A checksum generated by applying the SHA-256 algorithm to the concatenated string of The UID is your Alibaba Cloud account ID, which you can find in the Alibaba Cloud console. To prevent tampering, verify the message integrity upon receipt by generating a checksum with the same algorithm and comparing it with the received Note
The UID must be for your Alibaba Cloud account, not for a RAM user. |
|
taskId |
String |
The ID of the associated task. |
|
content |
String |
A JSON-formatted string containing the serialized detection results. You must parse this string to retrieve the JSON object. The format is identical to the response from a task result query. For more information, see Response Parameters. |
Status codes
The following table lists the status codes returned by the API. You are billed only for successful requests (code 200).
|
Code |
Description |
|
200 |
The request succeeded. |
|
280 |
Moderation is in progress. Query again later. |
|
400 |
A required parameter is missing or empty. |
|
401 |
An invalid parameter was provided. Check the value and try again. |
|
402 |
A parameter value exceeds the maximum length. |
|
403 |
The request rate exceeds the QPS limit. |
|
404 |
Failed to download the input file. Verify the URL and try again. |
|
405 |
The file download timed out. The file may be inaccessible. Verify the URL and network settings, then try again. |
|
406 |
The input file exceeds the size limit. |
|
407 |
The input file format is not supported. |
|
408 |
The account is not authorized to call this API. This may occur if the service is not activated, the account has overdue payments, or required permissions are missing. |
|
480 |
The number of concurrent requests exceeds the limit. |
|
500 |
An internal system error occurred. Try again later. |