Image Moderation 2.0: Synchronous multi-service detection API

更新时间:
复制 MD 格式

This topic describes how to perform multi-service detection using the Image Moderation 2.0 API. You can pass multiple service parameters in a single API call to invoke multiple detection services at once.

API features

The Image Moderation Pro API identifies content in images that may violate content policies, disrupt community order, or degrade the user experience. It supports 60+ risk labels and 100+ risk control items. Use the rich risk labels and confidence scores from Content Moderation's Image Moderation Pro to further moderate images based on your platform's content policies or industry-specific requirements. For more information, see Introduction to Image Moderation Pro 2.0 and Billing.

Getting started

  1. Sign up for an Alibaba Cloud account: Sign up now and complete the registration.

  2. Activate Content Moderation on a pay-as-you-go basis: Ensure you have activated the service. Activation is free of charge. Once you make API calls, you are automatically billed for your usage. For more information, see Billing.You can also purchase a resource plan to cover your usage. Compared with the post-paid model, resource plans offer tiered discounts and are ideal for users with predictable or high usage.

  3. Create an AccessKey pair: Ensure you have created an AccessKey pair in RAM. If you use a RAM user's AccessKey, use your main account to grant the AliyunYundunGreenWebFullAccess permission to that RAM user. For more information, see RAM authorization.

  4. Integrate with your app: We recommend using an SDK to call the API. For detailed instructions, see Enhanced Image Moderation 2.0 SDK and Integration Guide.

Usage notes

Call this API to create an image content moderation task. To learn how to construct HTTP requests, see Make HTTP requests. For pre-configured requests, see Getting Started.

  • API operation: ImageBatchModeration

  • Supported regions and endpoints:

    Region

    Public endpoint

    Internal endpoint

    Supported services

    China (Shanghai)

    https://green-cip.cn-shanghai.aliyuncs.com

    https://green-cip-vpc.cn-shanghai.aliyuncs.com

    • baselineCheck

    • baselineCheck_pro

    • tonalityImprove

    • aigcCheck

    • profilePhotoCheck

    • postImageCheck

    • advertisingCheck

    • liveStreamCheck

    • aigcViolationDetection

    • baselineCheckByVL

    • postImageCheckByVL

    • adCheckByVL

    China (Hangzhou)

    https://green-cip.cn-hangzhou.aliyuncs.com

    https://green-cip-vpc.cn-hangzhou.aliyuncs.com

    • baselineCheck

    • baselineCheck_pro

    • tonalityImprove

    • aigcCheck

    • profilePhotoCheck

    • postImageCheck

    • advertisingCheck

    • liveStreamCheck

    • aigcViolationDetection

    • baselineCheckByVL

    • postImageCheckByVL

    China (Beijing)

    https://green-cip.cn-beijing.aliyuncs.com

    https://green-cip-vpc.cn-beijing.aliyuncs.com

    • baselineCheck

    • baselineCheck_pro

    • tonalityImprove

    • aigcCheck

    • profilePhotoCheck

    • postImageCheck

    • advertisingCheck

    • liveStreamCheck

    • aigcViolationDetection

    • baselineCheckByVL

    • postImageCheckByVL

    • adCheckByVL

    China (Shenzhen)

    https://green-cip.cn-shenzhen.aliyuncs.com

    https://green-cip-vpc.cn-shenzhen.aliyuncs.com

    • baselineCheck

    • baselineCheck_pro

    • tonalityImprove

    • aigcCheck

    • profilePhotoCheck

    • postImageCheck

    • advertisingCheck

    • liveStreamCheck

    • aigcViolationDetection

    • baselineCheckByVL

    • postImageCheckByVL

    China (Chengdu)

    https://green-cip.cn-chengdu.aliyuncs.com

    Not available

    • baselineCheck

    • baselineCheck_pro

    • tonalityImprove

    • aigcCheck

    • profilePhotoCheck

    • postImageCheck

    • advertisingCheck

    • liveStreamCheck

    • aigcViolationDetection

    • baselineCheckByVL

    • postImageCheckByVL

  • Billing:

    This is a billable operation. Billing applies only to successful requests that return an HTTP status code of 200. For billing details, see Billing.

  • Image requirements:

    • Supported image formats: PNG, JPG, JPEG, BMP, WEBP, TIFF, SVG, HEIC, GIF, and ICO. For HEIC images, the longest side must be less than 8,192 px. For GIF images, the system processes only the first frame. For ICO files, the system processes only the last image.

    • The image size cannot exceed 20 MB. The height or width cannot exceed 16,384 px, and the total number of pixels cannot exceed 167 million px. For best results, the image resolution should be at least 200 × 200 pixels. A lower resolution may affect the accuracy of the content moderation algorithm.

    • The image must download within 3 seconds. If the download takes longer than 3 seconds, the API returns a download timeout error.

QPS limits

The QPS limit for this API is 100 for a single user. API calls exceeding this limit will be rate-limited, which may impact your business. If you require a higher QPS for high-volume use cases or urgent scaling, contact your account manager.

Debug

Before integration, use Alibaba Cloud OpenAPI to debug the ImageBatchModeration API. You can find sample code and SDK dependencies to help you quickly understand the API's usage and parameters.

Important

The online debugging feature uses your logged-in account to call the content moderation API. API calls during debugging are counted toward your billable usage.

Request parameters

For information about the required common request parameters, see Common parameters.

The request body is a JSON object that contains the following fields:

Parameter

Type

Required

Example

Description

Service

String

Yes

baselineCheck,tonalityImprove

The detection services available for Image Moderation Enhancement. Valid values:

  • baselineCheckByVL: Image Moderation Service Based on LLMs

  • postImageCheckByVL: Image Moderation for Large and Small Model Integration

  • postImageCheckByVL_cb: Image Moderation for Large and Small Model Integration_For regions outside the Chinese mainland

  • baselineCheck: BaselineCheck

  • baselineCheck_pro: baselineCheck_pro

  • baselineCheck_cb: Common Baseline Moderation_For regions outside the Chinese mainland

  • tonalityImprove: TonalityImprove

  • tonalityImprove_cb: Content Governance Moderation_For regions outside the Chinese mainland

  • aigcCheck: AIGC Image Risk

  • aigcCheck_cb: AIGC Image Risk Detection (Outside Chinese Mainland)

  • profilePhotoCheck: Profile Photo Check

  • postImageCheck: Post Comment Image Moderation

  • advertisingCheck: Advertising Check

  • liveStreamCheck: Live Stream Check

  • riskDetection: Moderate Images for Malicious Content

  • riskDetection_cb: Moderate Images for Malicious Content (Outside Chinese Mainland)

Note

For the differences between services, see Service description. For AIGC-specific services, see AIGC-specific detection service. You can specify multiple services. Separate them with commas (,). For example, baselineCheck,tonalityImprove performs both the baseline check and Content Governance Detection.

ServiceParameters

JSONString

Yes

A collection of parameters for the content to be moderated. This parameter must be a JSON string. For more information about the fields in the string, see ServiceParameters.

Table 1. ServiceParameters

Parameter

Type

Required

Example

Description

imageUrl

String

Yes. Image Moderation Enhancement supports three methods for specifying an image. You must use one of the following methods:

  • To use an image URL for detection, specify the imageUrl parameter.

  • To use an image from an authorized OSS bucket for detection, you must specify ossBucketName, ossObjectName, and ossRegionId.

  • Upload a local image for detection. This method does not use your OSS storage space, and the uploaded file is stored for only 30 minutes. The SDK has a built-in feature for this purpose. For code examples, see Image Moderation Enhancement 2.0 SDK and integration guide.

https://img.alicdn.com/tfs/TB1U4r9AeH2gK0jSZJnXXaT1FXa-2880-480.png

The URL of the image to be moderated. The URL must be publicly accessible. The URL cannot exceed 2,048 characters in length.

Note

The URL cannot contain Chinese characters. You can specify only one URL per request.

ossBucketName

String

bucket_01

The name of the authorized OSS bucket.

Note

To use an internal OSS endpoint for an image, you must first use your Alibaba Cloud account to grant access on the cloud resource access authorization page.

ossObjectName

String

2022023/04/24/test.jpg

The name of the file in the authorized OSS bucket.

ossRegionId

String

cn-beijing

The region where the OSS bucket is located.

dataId

String

No

img123****

The unique identifier for the object to be moderated.

The data ID can contain letters, digits, underscores (_), hyphens (-), and periods (.), and cannot exceed 64 characters in length. This ID can be used to uniquely identify your business data.

referer

String

No

www.aliyun.com

The Referer request header. This is used for scenarios such as anti-hotlinking. The header cannot exceed 256 characters in length.

infoType

String

Yes

customImage,textInImage

The type of supplementary information to retrieve. Valid values:

  • customImage: Matches from your custom image library.

  • textInImage: Text content found in the image.

  • publicFigure: Matched public figures.

  • logoData: Matched logos.

You can specify multiple values. Separate them with commas (,), for example, customImage,textInImage. This returns matches from the custom image library and text found in the image.

Note

Public figure and logo information is returned only when using an advanced image moderation service. For more information, see Service description.

Response data

Parameter

Type

Example value

Description

RequestId

String

70ED13B0-BC22-576D-9CCF-1CC12FEAC477

The unique request ID generated by Alibaba Cloud. Use this ID to troubleshoot issues.

Data

Object

The image moderation results. For more information, see Data.

Code

Integer

200

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

Msg

String

OK

The response message.

Table 2. Data

Parameter

Type

Example value

Description

Result

Array

The moderation results, such as the overall risk label and confidence score. For more information, see Result.

RiskLevel

String

high

The risk level, determined by the configured score thresholds. Valid values:

  • high: high risk

  • medium: medium risk

  • low: low risk

  • none: no risk detected

Note

We recommend taking immediate action on high-risk content and manually reviewing medium-risk content. Process low-risk content only if a high recall rate is required. Otherwise, treat it the same as content with no detected risk. You can configure the score thresholds in the Content Moderation Console.

DataId

String

img123******

The data ID of the moderated object.

Note

Returns the value of the dataId request parameter, if provided.

Results

Array

The detailed moderation results for each service. For more information, see Results.

Table 3. Result

Parameter

Type

Example value

Description

Label

String

violent_explosion

The moderation label. An image can have multiple labels and scores. For a list of supported labels, see:

Note

For labels related to the Content Moderation LLM service, see the Risk Label Glossary for Content Moderation LLM Service.

Confidence

Float

81.22

The confidence score. A value from 0 to 100, accurate to two decimal places. Some labels do not have a confidence score. For more information, see Risk label definitions.

Description

String

Fireworks-related content

A description of the Label parameter.

Important

This parameter provides a human-readable description of the Label. For programmatic processing, use the Label parameter because this description is subject to change.

Table 4. Results

Parameter

Type

Example value

Description

Service

String

baselineCheck

The name of the moderation service used.

RiskLevel

String

high

The risk level, which is determined based on the configured score thresholds. Valid values:

  • high: high risk

  • medium: medium risk

  • low: low risk

  • none: no risk detected

Result

Array

The moderation results, including the risk labels and confidence scores. For more information, see Result.

Ext

Object

The extended information about the image. For more information, see Extended information.

Extended information

Table 5. Ext

Parameter

Type

Example value

Description

CustomImage

JSONArray

Information about matched custom image libraries. This parameter is returned if the image matches an entry in a custom library. For more information, see CustomImage.

TextInImage

Object

Text detected in the image. For more information, see TextInImage.

PublicFigure

JSONArray

Information about public figures recognized in the image. This parameter is returned if a public figure is recognized. For more information, see PublicFigure.

LogoData

JSONArray

Information about matched logos. For more information, see LogoData.

Table 6. CustomImage

Parameter

Type

Example value

Description

LibId

String

lib0001

The ID of the matched custom image library.

LibName

String

Custom Image Library A

The name of the matched custom image library.

ImageId

String

20240307

The ID of the matched custom image.

Table 7. TextInImage

Parameter

Type

Example value

Description

OcrResult

JSONArray

The information about each line of text recognized in the image. For more information, see OcrResult.

RiskWord

StringArray

[ "risk word 1",

"risk word 2"]

Risk fragments detected in the image text. This parameter is returned when a tii (text in image) label is matched.

CustomText

JSONArray

Information about matched custom text libraries. This parameter is returned if the text hits a custom text library. For more information, see CustomText.

Table 8. OcrResult

Parameter

Type

Example value

Description

Text

String

Recognized text line 1

The content of a line of text recognized in the image.

Table 9. CustomText

Parameter

Type

Example value

Description

LibId

String

test20240307

The ID of the matched custom text library.

LibName

String

Custom text library A

The name of the matched custom text library.

KeyWords

String

Keyword 1

The matched custom keywords.

Table 10. PublicFigure

Parameter

Type

Example value

Description

FigureName

String

John Doe

The name of the recognized public figure.

FigureId

String

xxx001

The ID of the recognized public figure.

Note

Some public figures are identified by FigureName, while others are identified by FigureId. We recommend checking FigureName first; if it is empty, use FigureId.

Location

JSONArray

The location of the public figure. For more information, see Location.

Table 11. LogoData

Parameter

Type

Example value

Description

Logo

JSONArray

The logo information. For more information, see Logo.

Location

Object

The location of the logo. For more information, see Location.

Table 12. Logo

Parameter

Type

Example value

Description

Name

String

DingTalk

The name of the logo.

Label

String

logo_sns

The matched label.

Confidence

Float

88.18

The confidence score.

Table 13. Location

Parameter

Type

Example value

Description

X

Float

41

The x-coordinate (in pixels) of the upper-left corner of the region. The origin (0,0) is at the upper-left corner of the image.

Y

Float

84

The y-coordinate (in pixels) of the upper-left corner of the region. The origin (0,0) is at the upper-left corner of the image.

W

Float

83

The width of the region, in pixels.

H

Float

26

The height of the region, in pixels.

Examples

Sample request

{
    "Service": "baselineCheck,tonalityImprove",
    "ServiceParameters": {
        "imageUrl": "https://img.alicdn.com/tfs/TB1U4r9AeH2gK0jSZJnXXaT1FXa-2880-480.png",
        "dataId": "img123****"
    }
}

Sample response

  • If the system detects risk content:

    {
        "Msg": "OK",
        "Code": 200,
        "Data": {
            "DataId": "img123****",
            "RiskLevel": "high",
            "Result": [
                {
                    "Label": "violent_explosion",
                    "Confidence": 81.88,
                    "Description": "Fireworks-related content"
                },
                {
                    "Label": "sexual_partialNudity",
                    "Confidence": 98.18,
                    "Description": "Partial nudity or sexually suggestive content"
                },
                {
                    "Label": "pt_programCode",
                    "Confidence": 70.11,
                    "Description": "mini program code"
                }
            ],
            "Results": [
                {
                    "Result": [
                        {
                            "Label": "violent_explosion",
                            "Confidence": 81.88,
                            "Description": "Fireworks-related content"
                        },
                        {
                            "Label": "sexual_partialNudity",
                            "Confidence": 98.18,
                            "Description": "Partial nudity or sexually suggestive content"
                        }
                    ],
                    "RiskLevel": "high",
                    "Service": "baselineCheck"
                },
                {
                    "Result": [
                        {
                            "Label": "pt_programCode",
                            "Confidence": 70.11,
                            "Description": "mini program code"
                        }
                    ],
                    "RiskLevel": "high",
                    "Service": "tonalityImprove"
                }
            ]
        },
        "RequestId": "ABCD1234-2024-0307-8888-666ZHY"
    }
  • If the system detects no risk content:

    {
        "Msg": "OK",
        "Code": 200,
        "Data": {
            "DataId": "img123****",
            "RiskLevel": "none",
            "Result": [
                {
                    "Label": "nonLabel",
                    "Description": "No risks detected"
                }
            ],
            "Results": [
                {
                    "Result": [
                        {
                            "Label": "nonLabel",
                            "Description": "No risks detected"
                        }
                    ],
                    "RiskLevel": "none",
                    "Service": "baselineCheck"
                },
                {
                    "Result": [
                        {
                            "Label": "nonLabel",
                            "Description": "No risks detected"
                        }
                    ],
                    "RiskLevel": "none",
                    "Service": "tonalityImprove"
                }
            ]
        },
        "RequestId": "ABCD1234-2024-0307-8888-666ZHY"
    }
  • If the image is found in the image exemption library:

    {
        "Msg": "OK",
        "Code": 200,
        "Data": {
            "DataId": "img123****",
            "RiskLevel": "none",
            "Result": [
                {
                    "Label": "nonLabel_lib",
                    "Confidence": 83.18,
                    "Description": "Matched an image in the image exemption library"
                }
            ],
            "Results": [
                {
                    "Result": [
                        {
                            "Label": "nonLabel_lib",
                            "Confidence": 83.18,
                            "Description": "Matched an image in the image exemption library"
                        }
                    ],
                    "RiskLevel": "none",
                    "Service": "baselineCheck"
                },
                {
                    "Result": [
                        {
                            "Label": "nonLabel_lib",
                            "Confidence": 83.18,
                            "Description": "Matched an image in the image exemption library"
                        }
                    ],
                    "RiskLevel": "none",
                    "Service": "tonalityImprove"
                }
            ]
        },
        "RequestId": "ABCD1234-1234-1234-1234-1234XYZ"
    }
  • Additional information

    • If an image matches a custom image library:

    {
        "Msg": "OK",
        "Code": 200,
        "Data": {
            "DataId": "img123****",
            "RiskLevel": "high",
            "Result": [
                {
                    "Confidence": 100.0,
                    "Label": "pornographic_adultContent_lib",
                    "Description": "Adult content: Matched a custom image library"
                },
                {
                    "Label": "pt_programCode",
                    "Confidence": 70.11,
                    "Description": "mini program code"
                }
            ],
            "Results": [
                {
                    "Result": [
                        {
                            "Confidence": 100.0,
                            "Label": "pornographic_adultContent_lib",
                            "Description": "Adult content: Matched a custom image library"
                        }
                    ],
                    "Ext": {
                        "CustomImage": [
                            {
                                "ImageId": "12345",
                                "LibId": "TEST20240307",
                                "LibName": "Risk Image Library A"
                            }
                        ]
                    },
                    "RiskLevel": "high",
                    "Service": "baselineCheck"
                },
                {
                    "Result": [
                        {
                            "Label": "pt_programCode",
                            "Confidence": 70.11,
                            "Description": "mini program code"
                        }
                    ],
                    "RiskLevel": "high",
                    "Service": "tonalityImprove"
                }
            ]
        },
        "RequestId": "ABCD1234-2024-0307-8888-666ZHY"
    }
    • If text in an image matches a custom text library:

    {
        "Msg": "OK",
        "Code": 200,
        "Data": {
            "DataId": "img123****",
            "RiskLevel": "high",
            "Result": [
                {
                    "Confidence": 99.0,
                    "Label": "pornographic_adultContent_tii_lib",
                    "Description": "Text contains pornographic content: Matched a custom text library"
                },
                {
                    "Label": "pt_programCode",
                    "Confidence": 70.11,
                    "Description": "mini program code"
                }
            ],
            "Results": [
                {
                    "Result": [
                        {
                            "Confidence": 99.0,
                            "Label": "pornographic_adultContent_tii_lib",
                            "Description": "Text contains pornographic content: Matched a custom text library"
                        }
                    ],
                    "Ext": {
                        "TextInImage": {
                            "CustomText": [
                                {
                                    "KeyWords": "custom keyword 1",
                                    "LibId": "TEST20240307",
                                    "LibName": "Text Denylist A"
                                }
                            ],
                            "OcrResult": [
                                {
                                    "Text": "Text line 1"
                                },
                                {
                                    "Text": "Text line 2"
                                },
                                {
                                    "Text": "Text line 3 containing a custom keyword"
                                }
                            ],
                            "RiskWord": null
                        }
                    },
                    "RiskLevel": "high",
                    "Service": "baselineCheck"
                },
                {
                    "Result": [
                        {
                            "Label": "pt_programCode",
                            "Confidence": 70.11,
                            "Description": "mini program code"
                        }
                    ],
                    "RiskLevel": "high",
                    "Service": "tonalityImprove"
                }
            ]
        },
        "RequestId": "ABCD1234-2024-0307-8888-666ZHY"
    }
    • If the text in an image contains a violation:

    {
        "Msg": "OK",
        "Code": 200,
        "Data": {
            "DataId": "img123****",
            "RiskLevel": "high",
            "Result": [
                {
                    "Confidence": 89.15,
                    "Label": "political_politicalFigure_name_tii",
                    "Description": "Text contains the name of a political figure"
                },
                {
                    "Label": "pt_programCode",
                    "Confidence": 70.11,
                    "Description": "mini program code"
                }
            ],
            "Results": [
                {
                    "Result": [
                        {
                            "Confidence": 89.15,
                            "Label": "political_politicalFigure_name_tii",
                            "Description": "Text contains the name of a political figure"
                        }
                    ],
                    "Ext": {
                        "TextInImage": {
                            "CustomText": null,
                            "OcrResult": [
                                {
                                    "Text": "Text line 1"
                                },
                                {
                                    "Text": "Text line 2"
                                },
                                {
                                    "Text": "Text line 3 containing risk words"
                                }
                            ],
                            "RiskWord": [
                                "risk word 1"
                            ]
                        }
                    },
                    "RiskLevel": "high",
                    "Service": "baselineCheck"
                },
                {
                    "Result": [
                        {
                            "Label": "pt_programCode",
                            "Confidence": 70.11,
                            "Description": "mini program code"
                        }
                    ],
                    "RiskLevel": "high",
                    "Service": "tonalityImprove"
                }
            ]
        },
        "RequestId": "ABCD1234-2024-0307-8888-666ZHY"
    }
    • If logo data is detected:

    {
        "Msg": "OK",
        "Code": 200,
        "Data": {
            "DataId": "img123****",
            "RiskLevel": "high",
            "Result": [
                {
                    "Confidence": 96.15,
                    "Label": "pt_logotoSocialNetwork",
                    "Description": "Social media platform logo"
                },
                {
                    "Label": "pt_programCode",
                    "Confidence": 70.11,
                    "Description": "mini program code"
                }
            ],
            "Results": [
                {
                    "Result": [
                        {
                            "Confidence": 96.15,
                            "Label": "pt_logotoSocialNetwork",
                            "Description": "Social media platform logo"
                        }
                    ],
                    "Ext": {
                        "LogoData": [
                            {
                                "Location": {
                                    "H": 44,
                                    "W": 100,
                                    "X": 45,
                                    "Y": 30
                                },
                                "Logo": [
                                    {
                                        "Confidence": 96.15,
                                        "Label": "pt_logotoSocialNetwork",
                                        "Name": "CCTV"
                                    }
                                ]
                            }
                        ]
                    },
                    "RiskLevel": "high",
                    "Service": "baselineCheck"
                },
                {
                    "Result": [
                        {
                            "Label": "pt_programCode",
                            "Confidence": 70.11,
                            "Description": "mini program code"
                        }
                    ],
                    "RiskLevel": "high",
                    "Service": "tonalityImprove"
                }
            ]
        },
        "RequestId": "ABCD1234-2024-0307-8888-666ZHY"
    }
    • If a public figure is detected:

    {
        "Msg": "OK",
        "Code": 200,
        "Data": {
            "DataId": "img123****",
            "RiskLevel": "high",
            "Result": [
                {
                    "Confidence": 92.05,
                    "Label": "political_politicalFigure_3",
                    "Description": "Provincial or municipal government official"
                },
                {
                    "Label": "pt_programCode",
                    "Confidence": 70.11,
                    "Description": "mini program code"
                }
            ],
            "Results": [
                {
                    "Result": [
                        {
                            "Confidence": 92.05,
                            "Label": "political_politicalFigure_3",
                            "Description": "Provincial or municipal government official"
                        }
                    ],
                    "Ext": {
                        "PublicFigure": [
                            {
                                "FigureId": null,
                                "FigureName": "John Doe",
                                "Location": [
                                    {
                                        "H": 520,
                                        "W": 13,
                                        "X": 14,
                                        "Y": 999
                                    }
                                ]
                            }
                        ]
                    },
                    "RiskLevel": "high",
                    "Service": "baselineCheck"
                },
                {
                    "Result": [
                        {
                            "Label": "pt_programCode",
                            "Confidence": 70.11,
                            "Description": "mini program code"
                        }
                    ],
                    "RiskLevel": "high",
                    "Service": "tonalityImprove"
                }
            ]
        },
        "RequestId": "ABCD1234-2024-0307-8888-666ZHY"
    }
Note

The sample requests and responses are formatted for readability. Actual responses are not indented and do not have line breaks.

Risk tag definitions

See the Risk Tag Definition Table for descriptions of all risk tags. You can enable or disable each risk tag in the console. Some risk tags also let you configure a more granular detection scope. For detailed instructions, see the Console Operation Guide.

Note

We recommend storing the risk tags and confidence scores that the system returns. You can then use this data to prioritize tasks for manual review or labeling and to implement tiered content moderation policies.

Response codes

This table describes the API response codes. You are only billed for successful requests that return a 200 code.

Code

Description

200

The request was successful.

400

The request parameters are empty.

401

The request parameters are invalid.

402

A request parameter has an invalid length. Check the parameter and retry the request.

403

The request rate exceeds the QPS limit. Check and adjust your concurrency.

404

Failed to download the image due to an error or timeout. Verify the image URL and try again.

405

The image download timed out, possibly because the image is inaccessible. Check its access settings and try again.

406

The input image is too large. Reduce the image size and try again.

407

The input image format is not supported. Convert the image and try again.

408

Permission to call this API was denied. This can occur if the service is not activated, the account has an overdue payment, or the account lacks authorization.

500

A system error occurred.