AI Forgery Detection API for credential images and transfer screenshots
When your business receives credential images or transfer screenshots, you may need to determine whether the images are forged or tampered with. Image Moderation Enhanced Edition 2.0 provides AI forgery detection capabilities to identify forged content in such images. This topic describes the forgery detection capabilities and integration methods for credential images and transfer screenshots.
Features
Credential image and transfer screenshot forgery detection comprehensively analyzes various image features and returns a judgment. The following two types are supported:
Credential image forgery detection: This service comprehensively judges credential images based on their features, watermarks, and logos, and returns the risk type and large model analysis result. Set the service parameter to
imageTamperDetector.
Transfer screenshot forgery detection: This service comprehensively judges transfer screenshots based on image information and features, and returns risk points and violation locations. Set the service parameter to
transferImageCheck.
Billing
The large model service of Image Moderation Enhanced Edition 2.0 supports two billing methods: pay-as-you-go and resource plan offset.
Pay-as-you-go
When you enable the Image Moderation Enhanced Edition 2.0 service, the default billing method is pay-as-you-go. Fees are settled based on actual usage on the same day. You are not charged if you do not call the service.
Moderation type (billable item) | Supported business scenario (service) | Unit price |
AI image forgery detection advanced ( | Credential image forgery detection: | 500 CNY per 10,000 calls. Note Each successful call to any service in the leftmost column is billed once. Billing is based on actual usage. For example, 100 calls to the Credential image forgery detection service are billed 5 CNY. |
File large model standard ( |
| 3,000 CNY per 10,000 calls. Note When the large model analysis feature is enabled, the usage of this billable item increases. Billing is based on actual usage. |
Content Moderation Enhanced Edition pay-as-you-go metering and billing frequency is once per hour. The moderationType field in the billing statement corresponds to the moderation type field above. For more information, see Billing Details.
Resource plan offset
If your moderation volume is large or relatively stable, we recommend that you purchase resource plans in advance. Larger resource plan specifications provide greater discounts, and you can purchase and use multiple plans together. For more information, see Purchase Image Moderation Enhanced Edition Offset Resource Plan.
This resource plan is used to offset Image Moderation Enhanced Edition usage and cannot be shared with Content Moderation 1.0 traffic plans. The offset coefficients are as follows:
Moderation type | Offset coefficient |
AI image forgery detection advanced ( | The offset coefficient is 66.67, which means that each successful API call offsets 66.67 calls from the resource plan capacity. |
File large model standard ( | The offset coefficient is 400, which means that each successful API call offsets 400 calls from the resource plan capacity. |
After purchase, usage generated by calling the Image Moderation Enhanced Edition API is preferentially offset against the resource plan. When the resource plan balance is insufficient, the Alibaba Cloud billing system automatically bills you on a pay-as-you-go basis. Monitor your resource plan balance and pay-as-you-go bills in a timely manner. You can configure balance alerts in the Resource Plan System of the Alibaba Cloud Expense Center.
Get started
Sign up for an Alibaba Cloud account: Register Now, and follow the prompts to complete your account registration.
Enable Content Moderation pay-as-you-go. Make sure that you have enabled the service. Enabling the service is free. After you start calling the API, the system bills you based on usage. For more information, see Billing. You can also purchase pay-as-you-go offset resource plans, which offer tiered offset discounts compared with postpaid billing. This option is suitable for users with predictable and large usage volumes.
Create an AccessKey. Make sure that you have created an AccessKey in RAM. If you use a sub-account AccessKey, you must grant the
AliyunYundunGreenWebFullAccesspermission to the sub-account by using your Alibaba Cloud account. For more information, see RAM Authorization.Develop and integrate: We recommend that you call the API by using an SDK. For more information, see Image Moderation Enhanced Edition SDK and Integration Guide.
Call the asynchronous detection API operation: Image Moderation Enhanced Edition asynchronous detection service includes the following two API operations:
ImageAsyncModeration: submits an image asynchronous moderation task.DescribeImageModerationResult: obtains the moderation task result.
Submit asynchronous detection task
API description
This API operation is used to create an image content detection task. For information about how to construct an HTTP request, see Native HTTP Calls; you can also use pre-constructed HTTP requests. For more information, see Integration Guide.
API operation:
ImageAsyncModerationSupported regions and endpoints:
Region | Public endpoint | VPC endpoint | Supported services |
China East 2 (Shanghai) |
|
| |
Billing information: This is a paid API operation. Only requests that return HTTP status code 200 are metered and billed. Other error codes are not billed. For more information about billing methods, see Billing.
Image requirements:
Images support the following formats: PNG, JPG, JPEG, BMP, WebP, TIFF, SVG, AVIF, HEIF (the longest side of this format must be less than 8,192 px), GIF (first frame only), and ICO (last frame only).
The image size must not exceed 10 MB. The height or width must not exceed 10,000 px, and the total number of pixels must not exceed 100 million px. We recommend that the image resolution be greater than 200 x 200 px. Low resolutions may affect the performance of the Content Moderation detection algorithm.
The image download timeout is 3 seconds. If the download takes longer than 3 seconds, a download timeout is returned.
Response parameters: Asynchronous detection tasks do not return detection results in real time. You must obtain detection results by callback or polling. Detection results are retained for up to 3 days.
Obtain detection results by callback: pass the callback request parameter when you submit an asynchronous detection task to automatically receive detection results.
Obtain detection results by polling: you do not need to pass the callback parameter when you submit an asynchronous detection task. After the task is submitted, call the result query API operation to obtain the detection result. Asynchronous detection is currently queued, and results are produced within 24 hours.
QPS limits
The per-user QPS limit for this API operation is 5 calls per second. Exceeding the limit may cause errors and affect your business. Call the API operation appropriately. If your business volume is large or you urgently need a higher QPS, contact your business manager.
Debugging
Before integration, you can also use Alibaba Cloud OpenAPI to debug online Image Moderation Enhanced Edition, view sample calling code and SDK dependency information, and easily understand how to use the API operation and its parameters.
The online debugging feature calls Content Moderation API operations by using the current logged-in account. The calls are counted toward the billable usage of the account.
Request parameters
For the common request parameters that must be included, see Common Parameters.
The request body is a JSON struct that contains the following fields:
Name | Type | Required | Example | Description |
Service | String | Yes | | The detection service supported by Image Moderation Enhanced Edition 2.0. Valid values:
|
ServiceParameters | JSONString | Yes | The parameter set related to the content detection object, in JSON string format. For the description of each string, see ServiceParameters. |
For the differences between services, see Service Description.
Table 1. ServiceParameters
Name | Type | Required | Example | Description |
imageUrl | String | Yes. Image Moderation Enhanced Edition supports three methods to pass images. Select one of the following: use an image URL for detection and pass imageUrl; use OSS authorization for detection and pass ossBucketName, ossObjectName, and ossRegionId at the same time; or use a local image for detection (no OSS storage space is occupied, and files are stored for only 30 minutes. The SDK has integrated the local image upload feature. For code examples, see Image Moderation Enhanced Edition SDK and Integration Guide). |
| The URL of the object to be detected. Make sure that the URL is accessible over the Internet and that the URL length does not exceed 2,048 characters. Note The URL cannot contain Chinese characters. Make sure that only one URL is passed in each request. |
ossBucketName | String | Required when OSS authorization is used. |
| The name of the authorized OSS bucket. Note Before you use an OSS image internal endpoint, you must use an Alibaba Cloud account (the main account) to visit the cloud resource access authorization page and complete |
ossObjectName | String | Required when OSS authorization is used. |
| The filename in the authorized OSS bucket. Note The original filename passed to OSS. Image parameter processing is not supported. If you want to add image processing parameters, use the imageUrl address. When the filename contains Chinese characters or spaces, pass it as is. URL encoding is not required. |
ossRegionId | String | Required when OSS authorization is used. |
| The region where the OSS bucket is located. |
dataId | String | No |
| The data ID of the object to be detected. It can contain uppercase and lowercase English letters, digits, underscores (_), hyphens (-), and periods ( |
callback | String | No |
| The URL to which detection result callbacks are sent. HTTP and HTTPS addresses are supported. If this field is empty, you must poll for detection results at regular intervals. The callback interface must support the POST method, UTF-8 encoded data, and the form parameters ReqId, Checksum, and Content. Content Moderation sets ReqId, Checksum, and Content according to the following rules and format and calls your callback interface to return detection results:
After your server-side callback interface receives a result pushed by Content Moderation, if HTTP status code 200 is returned, the reception is successful. All other HTTP status codes indicate reception failure. When reception fails, Content Moderation retries up to 3 times until the result is received successfully. If reception still fails after 3 retries, Content Moderation stops pushing. We recommend that you check the status of your callback interface. |
seed | String | No |
| A random string used for the signature in callback notification requests. It can contain English letters, digits, and underscores (_) and can be up to 64 characters in length. You can customize this parameter to verify that a callback notification is initiated by Alibaba Cloud Content Moderation when you receive it. Note This field must be provided when callback is used. |
cryptType | String | No |
| When callback notification is used, the algorithm used to encrypt the callback notification content. Content Moderation encrypts the returned result (a string concatenated from user uid + seed + content) by using the encryption algorithm that you specify and then sends it to your callback notification address. Valid values:
|
interval | Integer | No |
| The frame capture frequency. This parameter is dedicated to GIF and long image detection. Frames are captured from GIF images and long images only when this parameter is specified. A GIF image can be considered as an array of frames. intervalspecifies how many frames are skipped before one frame is captured for detection. Long images are classified as long vertical images and long horizontal images. For long vertical images (height greater than 400 px and height-to-width ratio greater than 2.5), the total number of images is calculated by rounding the height-to-width ratio, and the image is split accordingly. For long horizontal images (width greater than 400 px and width-to-height ratio greater than 2.5), the total number of images is calculated by rounding the width-to-height ratio, and the image is split accordingly. If this parameter is not specified, only the first frame of a GIF image is detected, and long images are detected after compression. Note intervalmust be used together with maxFrameNum. For example, set interval to 2 and maxFrameNum to 10. When detecting GIF images and long images, one image is detected every 2 frames, up to a maximum of 10 images. Billing is based on the actual number of detections. |
maxFrameNum | Integer | No |
| The maximum number of frames to capture. This parameter is dedicated to GIF and long image detection. The default value is 10, which means that up to 10 frames are captured. Valid values: 1 to 100. If |
llmExplain | bool | No |
| Specifies whether to enable the large model analysis feature. When this feature is enabled, large model analysis results are returned. Default value: true. Valid values: true (returned) and false (not returned). Important When this feature is enabled, billing increases. The billable item is |
referer | String | No |
| The referer request header, used in anti-leech scenarios. The length cannot exceed 256 characters. |
infoType | String | Yes |
| Specifies whether the returned results contain AIGC-related information. This parameter is required for forgery detection scenarios. Valid values: |
Response parameters
Name | Type | Example | Description | |
Code | Integer |
| The status code. For more information, see Code Description. | |
Msg | String |
| The response message for the request. | |
RequestId | String |
| The request ID. | |
Data | Object | The detection result. | ||
ReqId | String |
| The request ID, which can be used to query the moderation task result. | |
DataId | String |
| The data ID of the object to be detected. | |
Examples
Request example
{"Service":"imageTamperDetector","ServiceParameters":{"imageUrl":"https://img.alicdn.com/tfs/TB1Mq6ZmCslXu8jSZFuXXXg7FXa-1440-568.jpg","dataId":"img123******","interval":1,"maxFrameNum":50,"infoType":"aigcData"}}ServiceParameters is in JSON string format. For ease of reading, the preceding example displays it as an expanded JSON object. When you actually call the API operation, pass it as a JSON string.
Response example
{"Msg":"OK","Code":200,"RequestId":"ABCD1234-1234-1234-1234-1234XYZ","Data":{"ReqId":"ABCD1234-1234-1234-1234-1234XYZ","DataId":"img123******"}}Get detection task results
API description
API operation:
DescribeImageModerationResult, which is used to obtain the image moderation Enhanced Edition task result.Billing information: This API operation is free of charge.
Query timeout: We recommend that you set the query interval to 30 seconds (query the result 30 seconds after you submit the asynchronous detection task). The result is retained for up to 3 days. Otherwise, the result is automatically deleted.
QPS limits
The per-user QPS limit for this API operation is 100 calls per second. If the limit is exceeded, API calls are throttled, which may affect your business. Call the API operation appropriately.
Debugging
Before integration, you can also use Alibaba Cloud OpenAPI to debug online Get Image Moderation Enhanced Edition Task Result, view sample calling code and SDK dependency information, and easily understand how to use the API operation and its parameters.
Request parameters
Name | Type | Required | Example | Description |
ReqId | String | Yes |
| The request ID, which is the |
Response parameters
Name | Type | Example | Description |
RequestId | String |
| The ID of this request. Alibaba Cloud generates this unique identifier for the request, which can be used to troubleshoot and locate issues. |
Data | Object | The image content detection result. For more information, see Data. | |
Code | Integer |
| The status code. For more information, see Code Description. |
Msg | String |
| The response message for this request. |
Table 2. Data
Name | Type | Example | Description |
Result | Array | The risk labels, confidence scores, and other parameter results of image detection. For more information, see Result. | |
RiskLevel | String |
| The risk level, returned based on the configured high and low risk scores. Valid values:
Note We recommend that you directly handle high-risk content, manually review medium-risk content, and handle low-risk content only when high recall is required. For daily scenarios, low-risk content can be handled in the same way as no risk detected. You can configure risk scores in the Content Moderation console. |
DataId | String |
| The data ID of the object to be detected. Note If dataId is passed in the detection request parameters, the corresponding dataId is returned here. |
FrameNum | Integer |
| The total number of frames captured for the image. |
Frame | String | See the example below. | A JSON string of image frame capture information, containing the following fields: TempUrl: the temporary URL of the captured frame, valid for 5 minutes. Save the captured frame in a timely manner.Result: the risk labels, confidence scores, and other parameter results of image detection. For more information, see Result. RiskLevel: the overall risk level of the image. Credential image forgery detection fields:
Transfer screenshot forgery detection fields:
Note If the image is not split into frames, only the current image information is returned. If frames are captured from animated or long images, the information of each captured frame is returned. |
FrameThe Frame string, when parsed, is a JSON array. The structure of each element is as follows:
{"AigcData":{"Explain":"### User-facing comprehensive report...","AIGC":{"Label":"1","ContentProducer":"...","ProduceID":"...","ReservedCode1":"...","ReservedCode2":"","PropagateID":"","ContentPropagator":""},"riskArea":[{"Location":{"X":45,"Y":30,"W":100,"H":44},"Confidence":96.15}]},"Result":[{"Label":"tamper_aigc","RiskLevel":"high","Description":"..."}],"RiskLevel":"high"}Here, AIGC is returned only when the image is identified as AIGC-generated, and riskArea is returned only when a risky location box is detected.
Table 3. Result
Name | Type | Example | Description |
Label | String |
| The label returned after image content detection. Multiple labels and scores may be detected from the same image. Supported labels are described as follows: Credential image forgery detection labels:
Transfer screenshot labels:
|
Confidence | Float |
| The confidence score, ranging from 0 to 100 and rounded to two decimal places. Some labels do not have confidence scores. For more information, see Risk Label Definitions. |
Description | String |
| Description of the Label field. Important This field is an explanation of the Label field and may be changed. We recommend that you process the Label field when handling actual results. Do not base result handling on this field. |
Examples
Request example
{"ReqId":"ABCD1234-1234-1234-1234-123****"}Response example
Credential image forgery detection when risky content is detected, the response example is as follows:
{"Code":200,"Msg":"success","RequestId":"019FCABD-2035-1F8E-8E02-7BAA4012E078","Data":{"DataId":"faketamper-img-20260804","ReqId":"019FCABC-BC97-1FC0-A5F4-4773730CDE52","FrameNum":1,"RiskLevel":"high","Result":[{"Label":"tamper_has_meta","Confidence":100.0,"RiskLevel":"high","Description":"Image contains an AI-generated or synthetic implicit identifier"},{"Label":"tamper_aigc","Confidence":95.96,"RiskLevel":"high","Description":"Suspected AI-generated or synthetic content"},{"Label":"tamper_aips","Confidence":60.6,"RiskLevel":"medium","Description":"Suspected PS or AI-edited content"}],"Frame":"[{\"RiskLevel\":\"high\",\"Result\":[{\"Label\":\"tamper_has_meta\",\"Confidence\":100.0,\"RiskLevel\":\"high\",\"Description\":\"Image contains an AI-generated or synthetic implicit identifier\"},{\"Label\":\"tamper_aigc\",\"Confidence\":95.96,\"RiskLevel\":\"high\",\"Description\":\"Suspected AI-generated or synthetic content\"},{\"Label\":\"tamper_aips\",\"Confidence\":60.6,\"RiskLevel\":\"medium\",\"Description\":\"Suspected PS or AI-edited content\"}],\"AigcData\":{\"AIGC\":{\"Label\":\"AI-generated or synthetic content\",\"ContentProducer\":\"00119144030008867405X210001\",\"ProduceID\":\"tos-cn-i-tb4s082cfz/ad88d9b125694f57b2c72235e5c42af1\",\"ContentPropagator\":\"00119144030008867405X220001\",\"PropagateID\":\"tos-cn-i-tb4s082cfz/ad88d9b125694f57b2c72235e5c42af1\",\"ReservedCode1\":\"None\",\"ReservedCode2\":\"None\"},\"riskArea\":[{\"Location\":{\"X\":120,\"Y\":340,\"W\":260,\"H\":88},\"Confidence\":82.5}],\"Explain\":\"{\\\"Analysis status\\\":\\\"Normal\\\",\\\"Overall image assessment\\\":{\\\"Image subject\\\":\\\"A document titled 'Letter of Authorization' that contains body clauses and an official seal in the lower right corner. \\\",\\\"Clarity\\\":\\\"Clear\\\",\\\"Imaging condition\\\":\\\"Suspected scan\\\"},\\\"Image type recognition\\\":{\\\"ID document\\\":\\\"No\\\",\\\"Specific type\\\":\\\"Other screenshot\\\"},\\\"Recapture and photocopy analysis\\\":{\\\"Tool risk\\\":\\\"None\\\",\\\"Conclusion\\\":\\\"No clear evidence of recapture or photocopying\\\"},\\\"AIGC detection analysis\\\":{\\\"Tool risk\\\":\\\"High\\\",\\\"AI visible watermark\\\":{\\\"Exists\\\":\\\"No\\\"},\\\"Metadata AI identifier\\\":{\\\"exists\\\":\\\"Yes\\\",\\\"Identifier basis\\\":\\\"Metadata UserComment field contains product information: 'product':'dreamina'\\\"},\\\"Conclusion\\\":\\\"Confirmed AI-generated\\\"},\\\"Local editing analysis\\\":{\\\"Tool risk\\\":\\\"Low\\\",\\\"Location box status\\\":\\\"Exists\\\",\\\"Conclusion\\\":\\\"Suspected local editing area exists\\\"},\\\"Risk classification\\\":{\\\"Recapture and photocopy\\\":\\\"None\\\",\\\"AIGC\\\":\\\"High\\\",\\\"Local PS or AI editing\\\":\\\"Low\\\",\\\"Overall risk\\\":\\\"High\\\"},\\\"Final determination\\\":{\\\"Final conclusion\\\":\\\"Confirmed AI-generated\\\",\\\"AI-generated\\\":\\\"Yes\\\",\\\"Generation source\\\":\\\"Unknown source\\\",\\\"Key evidence\\\":[\\\"Metadata source_info is 'dreamina'\\\",\\\"AIGC detection score is as high as 0.959\\\",\\\"Text layout is overly perfect and lacks physical flaws of a real scanned document\\\"],\\\"Conclusion description\\\":\\\"Although this image appears to be a formal letter of authorization, the metadata contains a clear AI-generated tool identifier, and the AIGC detection score is in an extremely high risk range. Therefore, it is determined to be AI-generated synthetic content. \\\"},\\\"Actionable recommendations\\\":[\\\"This document is confirmed to be AI-generated and has no legal effect.\\\",\\\"Verify the original electronic file or request a photo of the original.\\\"]}\"}}]"}}Transfer screenshot forgery detection when risky content is detected, the response example is as follows:
{"Code":200,"Msg":"success","RequestId":"019FCABD-2035-1F8E-8E02-7BAA4012E078","Data":{"DataId":"faketamper-img-20260804","ReqId":"019FCABC-BC97-1FC0-A5F4-4773730CDE52","FrameNum":1,"RiskLevel":"high","Result":[{"Label":"risk_tamper","Confidence":100.0,"RiskLevel":"high","Description":"Image has tampering risk"}],"Frame":"[{\"AigcData\":{\"riskArea\":[{\"Description\":\"Payment date does not match the embedded date in the order number\",\"Location\":{\"H\":23,\"W\":269,\"X\":168,\"Y\":533}},{\"Description\":\"Payment date does not match the embedded date in the order number\",\"Location\":{\"H\":22,\"W\":328,\"X\":175,\"Y\":797}}]},\"Result\":[{\"Confidence\":100.0,\"Description\":\"Image has tampering risk\",\"Label\":\"risk_tamper\",\"RiskLevel\":\"high\"}],\"RiskLevel\":\"high\"}]"}}When the system does not detect risky content, the response example is as follows:
{"Msg":"success","Code":200,"Data":{"DataId":"img123****","Result":[{"Label":"nonLabel","Confidence":null,"Description":"No risk detected"}],"RiskLevel":"none","Frame":"[{\"Result\":[{\"Label\":\"nonLabel\"}],\"TempUrl\":\"http://www.aliyundoc.com/test1.jpg\"},{\"Result\":[{\"Label\":\"nonLabel\"}],\"TempUrl\":\"http://www.aliyundoc.com/test2.jpg\"}]","FrameNum":2},"RequestId":"ABCD1234-1234-1234-1234-123****"}When the image hits the configured moderation-exempt image library, the response example is as follows:
{"Msg":"success","Code":200,"Data":{"DataId":"img123****","Result":[{"Label":"nonLabel_lib","Confidence":99.66,"Description":"Hit moderation-exempt image library"}],"RiskLevel":"none","Frame":"[{\"Result\":[{\"Confidence\":99.66,\"Label\":\"nonLabel_lib\"}],\"TempUrl\":\"http://www.aliyundoc.com/test1.jpg\"},{\"Result\":[{\"Confidence\":81.18,\"Label\":\"nonLabel_lib\"}],\"TempUrl\":\"http://www.aliyundoc.com/test2.jpg\"}]","FrameNum":2},"RequestId":"ABCD1234-1234-1234-1234-123****"}The request and response examples in this document are formatted for ease of reading. Actual responses do not contain line breaks or indentation.
Code description
The following table describes the meaning of the code returned by the API operation. The system meters and bills only requests for which code 200 is returned. Other codes are not billed.
Code | Description |
200 | The request is successful. |
280 | The task is being detected. |
400 | Request parameters are empty. |
401 | Request parameters are invalid. |
402 | The request parameter length does not meet the API operation requirements. Check and modify the parameters. |
403 | The request exceeds the QPS limit. Check and adjust the concurrency. |
404 | An error occurred while downloading the image. Check the image or try again. |
405 | The image download timed out, possibly because the image is inaccessible. Check the image and try again. |
406 | The image is too large. Adjust the image size and try again. |
407 | The image format is not supported. Check the image and try again. |
408 | The account does not have permission to call the API operation. The account may not be activated, may be overdue, or may not be authorized to access the resource. |
500 | A system exception occurred. |