All Products
Search
Document Center

AI Guardrails:Multi-language services in Text Moderation 2.0

Last Updated:Mar 31, 2026

Text Moderation 2.0 moderates user-generated text across 38 languages without requiring you to specify the language — the service detects it automatically. Compared to Text Moderation 1.0 (which supports 18 languages, requires manual language specification, and uses a single moderation model), Text Moderation 2.0 uses multiple models tuned for language and regional characteristics. It applies separate moderation policies tuned for international business, returns a translated English version of flagged content to support manual review, and supports multiple risk labels per request.

How it works

Submit text to the comment_multilingual_global service. Text Moderation 2.0 automatically identifies the language, applies the appropriate moderation model, and returns:

  • One or more risk labels (e.g., violence, profanity)

  • A subcategory label (riskTips) for precise classification

  • A risk level (high, medium, or low) with a handling recommendation

  • The detected language code

  • An English translation of the content for manual review

Supported languages

You do not need to specify a language code when submitting text. Text Moderation 2.0 automatically detects the language and applies the appropriate moderation model.

Text Moderation 2.0 supports 38 languages.

Language typeNameLanguage code
EnglishEnglishen
Simplified ChineseChinesezh
Traditional ChineseTraditional Chinesezh-tw
IndonesianIndonesianid
MalayMalayms
ThaiThaith
VietnameseVietnamesevi
TagalogTagalogtl
HindiHindihi
ArabicArabicar
TurkishTurkishtr
FrenchFrenchfr
GermanGermande
RussianRussianru
PortuguesePortuguesept
SpanishSpanishes
ItalianItalianit
DutchDutchnl
PolishPolishpl
JapaneseJapaneseja
KoreanKoreanko
UrduUrduur
UighurUighurug
BengaliBengalibn
PersianPersianfa
SwedishSwedishsv
DanishDanishda
NorwegianNorwegianno
IcelandicIcelandicis
FinnishFinnishfi
BelarusianBelarusianbe
LithuanianLithuanianlt
CzechCzechcs
SlovakSlovaksk
HungarianHungarianhu
GreekModern Greekel
RomanianRomanianro
IrishIrishga

Internationalization labels

Text Moderation 2.0 uses an internationalization labeling system designed for global business. If content contains multiple risk types, the service returns multiple labels simultaneously.2.0

Level-1 labels

LabelDescription
violenceViolence
contrabandContraband
sexualityPornography
profanityProfanity and abuse
pullinTrafficAdvertising content
regionalRegional hostility
C_customizedCustom library match

Subcategory labels

Subcategory labels (riskTips) provide finer-grained classification in xxx_yyy format. For example, contraband_Drugs indicates that the contraband content relates specifically to drugs.

Risk levels

The riskLevel field indicates the severity of detected content and the recommended action.

Risk levelBusiness meaningRecommended action
highContent is clearly harmful and violates policyBlock or remove the content immediately
mediumContent may violate policy and requires human judgmentRoute to manual review
lowContent has weak risk signals that may not warrant action aloneHandle when more risky content is detected

Content with no detected risk returns an empty Labels field — handle it based on your business requirements.

Billing

Text Moderation 2.0 uses pay-as-you-go billing. You are only charged for successful requests (HTTP status code 200). If the service is not called, no charge is made.

Moderation type 2.0ServiceUnit price

advanced text moderation (text_standard)

Multi-language detection for global business scenarios: comment_multilingual_global

USD 0.30 per 1,000 calls

Advanced text moderation (text_advanced)comment_multilingual_globalUSD 0.3 per 1,000 calls

Get started

Step 1: Activate the service

Open the service activation2.0 page to activate Text Moderation 2.0. After activation, the default billing method is pay-as-you-go.

Step 2: Grant permissions to a RAM user

Before calling API operations as a Resource Access Management (RAM) user, grant the user the required permissions.

  1. Log on to the RAM console as a RAM administrator.

  2. Create a RAM user. For details, see Create a RAM user.

  3. Grant the AliyunYundunGreenWebFullAccess system policy to the RAM user. For details, see Grant permissions to a RAM user.

After completing these steps, the RAM user can call the Content Moderation API. To authenticate API calls, create an AccessKey pair for the RAM user and include it in each request. For details, see Obtain an AccessKey pair.

Step 3: Install an SDK and call the API

The following table lists the supported regions and their endpoints. For SDK installation instructions and usage examples, see Text Moderation 2.0 SDKs and usage guide.

RegionPublic endpointInternal endpoint
Singaporegreen-cip.ap-southeast-1.aliyuncs.comgreen-cip-vpc.ap-southeast-1.aliyuncs.com
US (Virginia)green-cip.us-east-1.aliyuncs.comgreen-cip-vpc.us-east-1.aliyuncs.com
US (Silicon Valley)green-cip.us-west-1.aliyuncs.comN/A
UK (London)green-cip.eu-west-1.aliyuncs.comN/A
To get SDK sample code for other programming languages, use OpenAPI Explorer. OpenAPI Explorer dynamically generates sample code for each supported SDK.

API reference

Usage notes

Service endpoint: https://green-cip.{region}.aliyuncs.com

Call the TextModeration operation to submit a text moderation task. For details on constructing HTTP requests, see Request syntax.

Billing: Only requests that return HTTP status code 200 are charged.

QPS limit: 100 calls per second per account. Requests that exceed this limit trigger throttling.

Request parameters

ParameterTypeRequiredExampleDescription
ServiceStringYescomment_multilingual_globalThe moderation service type. Valid value: comment_multilingual_global (multi-language moderation for international business)
ServiceParametersJSONStringYesThe moderation parameters as a JSON string. See the table below.

ServiceParameters fields

ParameterTypeRequiredExampleDescription
contentStringYesContent to be moderatedThe text to moderate. Maximum length: 600 characters.
accountIdStringNo10123****An account ID that uniquely identifies an account. If specified, returned in the response.
deviceIdStringNo20240307****A device ID that uniquely identifies a device. If specified, returned in the response.
deviceTokenStringNoMzQvo1d7scyZ3tl_RcJ******A device token obtained from the risk control SDK.

Response parameters

ParameterTypeExampleDescription
CodeInteger200HTTP status code. See Error codes.
DataJSONObjectModeration results. See the table below.
MessageStringOKResponse message.
RequestIdStringAAAAAA-BBBB-CCCCC-DDDD-EEEEEEEE****The request ID.

Data object fields

ParameterTypeExampleDescription
LabelsStringsexuality,profanityDetected risk labels, separated by commas. Empty if no risk is detected.
ReasonString{"riskLevel":"high",...}A JSON string with details about detected risks. See the fields below.
AccountIdString10123****Returned if accountId was specified in the request.
DeviceIdString20240307****Returned if deviceId was specified in the request.

Reason JSON fields

FieldDescription
riskLevelRisk level: high, medium, or low. See Risk levels.
riskTipsSubcategory label (e.g., sexuality_Suggestive).
riskWordsRisky words detected in the content.
customizedWordsWords matched from a custom library.
customizedLibsCustom libraries that were matched.
detectedLanguageDetected language code (e.g., en, ar).
translatedContentEnglish translation of the moderated content, to support manual review.

Examples

All examples use the comment_multilingual_global service. Replace accountId with your actual account ID.

Request

{
    "Service": "comment_multilingual_global",
    "ServiceParameters": {
        "content": "testing content",
        "accountId": "10123****",
        "dataId": "text0424****"
    }
}

Response: custom library and risky words both detected

{
    "Code": 200,
    "Data": {
        "Labels": "C_customized,profanity",
        "Reason": "{\"riskLevel\":\"high\",\"customizedWords\":\"HXXXXX\",\"detectedLanguage\":\"en\",\"riskTips\":\"sexuality_Suggestive\",\"riskWords\":\"pxxxxy\",\"translatedContent\":\"pxxxxy sxxxx,HXXXXX\",\"customizedLibs\":\"ZXXXXX\"}"
    },
    "Message": "OK",
    "RequestId": "AAAAAA-BBBB-CCCCC-DDDD-EEEEEEEE****"
}

Response: custom library only

{
    "Code": 200,
    "Data": {
        "Labels": "C_customized",
        "Reason": "{\"riskLevel\":\"high\",\"customizedWords\":\"HXXXXX\",\"detectedLanguage\":\"en\",\"translatedContent\":\"HXXXXX\",\"customizedLibs\":\"ZXXXXX\"}"
    },
    "Message": "OK",
    "RequestId": "AAAAAA-BBBB-CCCCC-DDDD-EEEEEEEE****"
}

Response: risky words only

{
    "Code": 200,
    "Data": {
        "Labels": "sexuality",
        "Reason": "{\"riskLevel\":\"high\",\"detectedLanguage\":\"ar\",\"riskTips\":\"sexuality_Suggestive\",\"riskWords\":\"pxxxxy\",\"translatedContent\":\"pxxxxy sxxxx\"}"
    },
    "Message": "OK",
    "RequestId": "AAAAAA-BBBB-CCCCC-DDDD-EEEEEEEE****"
}

Response: no risk detected

{
    "Code": 200,
    "Data": {
        "Labels": "",
        "Reason": "{\"detectedLanguage\":\"en\",\"translatedContent\":\"AXXXXXX\"}"
    },
    "Message": "OK",
    "RequestId": "AAAAAA-BBBB-CCCCC-DDDD-EEEEEEEE****"
}

Error codes

HTTP status codeError codeDescription
200OKRequest successful.
400BAD_REQUESTInvalid request. Check your request parameters.
407NOT_SUPPORTLanguage not identified or not supported.
408PERMISSION_DENYAccount not authorized, overdue, not activated, or banned.
500GENERAL_ERRORTemporary server error. Retry the request. If the error persists, submit a ticket.
581TIMEOUTRequest timed out. Retry the request. If the error persists, submit a ticket.
588EXCEED_QUOTAQPS limit exceeded.

What's next