All Products
Search
Document Center

AI Guardrails:LLM Voice Moderation

Last Updated:Jun 08, 2026

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:

Note

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)

  • Uses the Qwen large language model.

  • Provides the highest accuracy for audio file moderation.

Singapore

  • Audio and video media, including general videos and audiobooks with diverse content types.

  • Powered by Qwen ASR, it accurately recognizes Chinese dialects (such as Cantonese and Sichuanese) and multiple languages (such as English, German, Korean, Japanese, Russian, French, Portuguese, and Vietnamese).

  • Powered by a large text moderation model, it accurately identifies ideological content, political sensitivity, and figurative expressions.

Social & Entertainment Live Stream Detection_LLM Version (live_detection_byllm_global)

  • Uses the Qwen large language model.

  • Provides the highest accuracy for live audio stream moderation.

Singapore

  • Social live streaming, typically featuring a single speaker with frequent background music.

  • The large model improves accuracy in complex audio environments, reducing interference from dialects, accents, and background noise.

  • The large text moderation model focuses on identifying sexually explicit content, abusive language, innuendo, and political sensitivity. It also detects periods of silence in the stream.

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)

  • Audio and Video Media Detection_LLM Edition: audio_detection_byllm_global

  • Social & Entertainment Live Stream Detection_LLM Version: live_detection_byllm_global

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)

  • Audio and Video Media Detection_LLM Edition: audio_detection_byllm_cn

  • Social & Entertainment Live Stream Detection_LLM Version: stream_detection_byllm_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.

Note

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.

  1. Log on to the RAM console using your Alibaba Cloud account or a RAM administrator account.

  2. Create a RAM user. For more information, see Create a RAM user.

  3. Attach the AliyunYundunGreenWebFullAccess system 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:

  • audio_detection_byllm_global: Audio and video moderation (LLM-based).

  • live_detection_byllm_global: Live audio stream moderation (LLM-based).

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:

  • Provide the URL of the file in the url parameter.

  • Provide the details of an OSS object in the ossBucketName, ossObjectName, and ossRegionId parameters.

  • Upload a local audio file. This method does not consume your OSS storage and the file is temporarily stored for 30 minutes. The SDK has a built-in feature for local file uploads. For code examples, see Voice Moderation SDK and Integration Guide.

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 bucket.

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 bucket.

ossRegionId

String

cn-shanghai

The region where the OSS bucket is located.

callback

String

No

http://aliyundoc.com

The callback URL where moderation results are sent. HTTP and HTTPS are supported. If you omit this parameter, you must use polling to retrieve the results.

The callback endpoint must support the POST method, UTF-8 encoded data, and the form parameters checksum and content.

Content Security sets the checksum and content parameters and sends the results to your callback endpoint as follows.

  • checksum: A string that is generated by applying the SHA256 algorithm to the concatenated string of UID + seed + content. The UID is your Alibaba Cloud account ID, which you can find in the Alibaba Cloud console. To prevent tampering, you can verify the push result by generating a string with the same algorithm and comparing it to the received checksum.

    Note

    The user UID must be the ID of your Alibaba Cloud account, not the ID of a RAM user.

  • content: A string in JSON format. You must parse the string to convert it back into a JSON object. For an example of the content result, see the response example for querying detection results.

Note

Your callback endpoint must return an HTTP status code of 200 after receiving a notification from Content Security to confirm receipt. Any other status code is considered a failure. If receipt fails, Content Security retries sending the notification up to 16 times. If all 16 retries fail, Content Security makes no further attempts. We recommend that you check the status of your callback endpoint.

seed

String

No

abc****

A random string used in the signature for the callback request.

It can consist of letters, digits, and underscores (_), with a maximum length of 64 characters. You can customize this value to verify that callback notifications originate from Content Security.

Note

You must specify this parameter when you provide a callback URL.

cryptType

String

No

SHA256

When using a callback, this parameter specifies the algorithm for generating the signature of the callback content. Content Security calculates a signature for the result (a concatenated string of user UID + seed + content) by using the specified algorithm and sends it to your callback URL. Valid values:

  • SHA256 (default): Uses the SHA256 encryption algorithm.

  • SM3: Uses the HMAC-SM3 algorithm. The result is a hexadecimal string that consists of lowercase letters and digits. For example, abc encrypted with SM3 returns 66c7f0f462eeedd9d1f2d46bdc10e4e24167c4875cf2f7a2297da02b8f4ba8e0.

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 uid+service+liveId. If found, it returns the existing taskId instead of creating a new task.

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 Referer request header. Used for purposes such as hotlink protection. The maximum length is 256 characters.

Response parameters

Parameter

Type

Example value

Description

Code

Integer

200

The status code. For more information, see Status Codes.

Data

JSONObject

{"TaskId": "AAAAA-BBBBB","DataId": "voice20240307***"}

The response data.

Message

String

OK

The response message.

RequestId

String

AAAAAA-BBBB-CCCCC-DDDD-EEEEEEEE****

The request ID.

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:

  • high: high-risk

  • medium: medium-risk

  • low: low-risk

  • none: no risk detected

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:

  • high: high-risk

  • medium: medium-risk

  • low: low-risk

  • none: no risk detected

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:

  • For text policy labels, see Risk Labels.

  • Audio-specific labels include:

    • specified_nontalk: silent audio

    • specified_speaking: specified speaking

    • sexual_sounds: sexual sounds

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 Label.

Important

This field provides an explanation of the Label and is subject to change. When processing results, use the Label value instead of this description.

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:

  • high: high-risk

  • medium: medium-risk

  • low: low-risk

  • none: no risk detected

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 Label is customized. This parameter returns the name of the custom library and the detected keywords. For more information, see CustomizedHit.

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:

  • live_detection_byllm_global: Live audio stream moderation (LLM-based).

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 uid + seed + content.

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 checksum value.

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.