All Products
Search
Document Center

ID Verification:FACE_DEEPFAKE

Last Updated:Dec 11, 2025

The deepfake detection API operations, DeepfakeDetectIntl and DeepfakeDetectIntlStream, analyze face images or videos. They identify risks such as AI-generated faces, deepfake face swaps, template attacks, and presentation attacks. The operations return risk tags and confidence scores.

API information

The deepfake detection service analyzes face images or videos to identify potential deepfake risks. The service provides the following two API operations to support different data submission methods:

DeepfakeDetectIntlStream

You can upload image or video data directly as a file stream. This method is designed for processing local files.

  • Request method: HTTPS POST

  • This API is subject to an exclusive queries per second (QPS) limit. For more information, see ID Verification server-side API QPS limits.

  • Endpoints:

    Note

    An internal network is a private communication network for Alibaba Cloud products within the same region. If your application server is deployed in an Alibaba Cloud region, you can use the VPC endpoint to access the ID Verification service for a more secure and stable network connection.

    Singapore

    • Public endpoint: cloudauth-intl.ap-southeast-1.aliyuncs.com

    • VPC endpoint: cloudauth-intl-vpc.ap-southeast-1.aliyuncs.com

DeepfakeDetectIntl

You can submit image or video data using a public URL or a Base64 string.

  • Request method: HTTPS POST

  • This API is subject to an exclusive queries per second (QPS) limit. For more information, see ID Verification server-side API QPS limits.

  • Endpoints:

    Note

    An internal network is a private communication network for Alibaba Cloud products within the same region. If your application server is deployed in an Alibaba Cloud region, you can use the VPC endpoint to access the ID Verification service for a more secure and stable network connection.

    Singapore

    • Public endpoint: cloudauth-intl.ap-southeast-1.aliyuncs.com

    • VPC endpoint: cloudauth-intl-vpc.ap-southeast-1.aliyuncs.com

Online debugging and integration

Note

Before you debug and integrate, read Use OpenAPI Explorer to debug and integrate server-side API operations. This document explains how to call API operations on the OpenAPI platform and how to obtain the SDK and its sample code.

Image and video requirements

Note

The following requirements for images and videos apply to both the DeepfakeDetectIntlStream and DeepfakeDetectIntl API operations.

The deepfake detection algorithm analyzes data from multiple dimensions, such as business, device, and behavior. This algorithm is ideal for scenarios where you use a face detection SDK and want to enhance the detection of forged faces. To ensure stable model performance, submit images or videos of a face captured by a front-facing camera at a normal angle. The images and videos must also meet the following requirements:

Images

  • Image format: JPG, JPEG.

  • Image size: 50 KB to 100 KB is recommended. The maximum size is 10 MB. For images larger than 1 MB, upload them using a URL.

  • Image resolution: The recommended resolution is 640 × 480 pixels (height × width). The maximum resolution is 1920 × 1080 pixels (height × width). The height must be greater than the width. Scale the shorter side to 720 pixels and use a compression ratio of 0.8.

  • Image quality: The image must be clear and have normal exposure. The face must not be too dark, too bright, or have halos.

  • Faces in image: If an image contains multiple faces, the system detects the largest face by default.

Videos

  • Video format: MP4, MOV.

  • Video size: Must be larger than 100 KB. The maximum size is 10 MB. For videos larger than 1 MB, upload them using a URL.

  • Video length: 1 to 3 seconds.

  • Video resolution: The recommended resolution is 640 × 480 pixels (height × width).

  • Video frame rate: 8 frames per second (fps) or higher.

Note

For videos, the service extracts 8 frames by default for model processing. This is for performance reasons related to the Qwen large model. To ensure detection accuracy, avoid submitting invalid videos.

Request parameters

Name

Type

Required

Description

Example

ProductCode

string

Yes

The product to integrate.

Set the value to FACE_DEEPFAKE.

FACE_DEEPFAKE

SceneCode

string

Yes

A custom authentication scenario ID. You can use this ID to query related records in the console.

The ID must be a 10-character string that contains letters, digits, and underscores (_).

1234567890

MerchantBizId

string

Yes

A unique identifier for the merchant request. It must be a 32-character alphanumeric string.

The first few characters are a custom abbreviation for the merchant. The middle part can contain a time period. The last part can be a random or an incremental sequence.

e0c34a77f5ac40a5aa5e6ed20c******

FaceInputType

string

No

The input type of the face material.

  • IMAGE (default): A face image.

  • VIDEO: A face video.

    Note

    Video processing takes a long time. Set the timeout period to more than 3 seconds.

IMAGE

FaceUrl

string

No

  • DeepfakeDetectIntl: Submit data using FaceUrl or FaceBase64. You must specify one of them.

  • DeepfakeDetectIntlStream: Submit data using FaceUrl, FaceBase64, or FaceFile. You must specify one of them.

The URL of the face image or video.

https://cn-shanghai-aliyun-cloudauth-xxxxxx.oss-cn-shanghai.aliyuncs.com/verify/xxxxx/xxxxx.jpeg

FaceBase64

string

The Base64-encoded face image. For videos, upload them using a URL.

/9j/4AAQSkZJRgABAQAASxxxxxxx

FaceFile

string

The file stream of the face image or video.

Response parameters

Name

Type

Description

Example

RequestId

String

The request ID.

8FC3D6AC-9FED-4311-8DA7-C4BF47D9****

Code

String

Return codes.

Success

Message

String

The detailed description of the response code.

success

ResultObject

Result

String

The risk result:

  • 0: Low risk

  • 1: High risk

  • 2: Suspicious

1

RiskTag

String

The risk tag. Multiple tags are separated by commas (,), and include the following:

  • SuspectDeepForgery: Suspected deepfake

  • SuspectPSFace: Suspected synthetic attack

  • SuspectTemple: Suspected template attack

  • SuspectRemake: Suspected presentation attack

SuspectDeepForgery

RiskScore

Map

A map of risk scores. The corresponding tag is returned when a risk is detected.

{
 "SuspectPSFace": "0.9796",
 "SuspectRemake": "0.0000",
 "SuspectDeepForgery": "0.9500",
 "SuspectTemple":"0.9500"
 }

Return codes

HTTP status code

Code

Message

200

Success

Request successful.

400

MissingParameter

Parameter cannot be empty.

InvalidParameter

Invalid parameter.

TransactionIdInvalid

Invalid Transaction ID.

403

Forbidden.RAMUserAccessDenied

You need to grant the RAM user the AliyunAntCloudAuthFullAccess permission. For more information, see Authorize RAM users to access the service.

Forbidden.AccountAccessDenied

Ensure that you have activated ID verification and your account has no overdue payment.

Throttling.Api

API request is blocked due to throttling.

404

ProcessNotCompleted

The entire authentication process is not completed.

500

InternalError

Internal system error. Provide feedback to engineers for troubleshooting.