Domain name for API request: faceid.intl.tencentcloudapi.com.
Based on multimodal AI large model algorithms, this API provides anti-attack detection capabilities for face images and videos. It can effectively identify highly realistic AIGC face swaps, high-definition recaptures, batch black-market attacks, watermarks, and other attack traces, enhancing the anti-counterfeiting security capabilities for images and videos.
A maximum of 5 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: DetectAIFakeFaces. |
| Version | Yes | String | Common Params. The value used for this API: 2018-03-01. |
| Region | No | String | Common Params. This parameter is not required. |
| FaceInput | No | String | Pass in the face image or face video to be detected (currently only single-face detection is supported), encoded in Base64. If both video and image are available in your scenario, we recommend using video for detection. For better detection results, note the following restrictions and recommendations for input data:
If you do not use Encryption for encrypted transmission, this field is required. |
| FaceInputType | No | Integer | Type of the input.
If you do not use Encryption for encrypted transmission, this field is required. |
| Encryption | No | Encryption | Whether to encrypt the entire request body.
|
| EncryptedBody | No | String | Encrypted ciphertext.
|
| ExtraRiskInfo | No | ExtraRiskInfo | Carries the risk control context of this request at one time, that is, "who, where, and from which IP the request is initiated". |
| Parameter Name | Type | Description |
|---|---|---|
| AttackRiskLevel | String | Detection result for the input image/video, indicating whether a face attack exists.
It is recommended to block requests when the returned value is High, and allow requests when the value is Mid or Low, to better balance security and pass rate. |
| AttackRiskDetailList | Array of AttackRiskDetail | List of detected suspected attack traces. Returned only when AttackRiskLevel is High or Mid.
|
| ExtraInfo | ExtraInfo | Returns additional information, including details of the matched template. |
| ExtraRiskResult | ExtraRiskResult | Independent container for additional risk conclusions, indicating whether the additional risk check is trustworthy and whether any issues are found. |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
POST / HTTP/1.1
Host: faceid.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DetectAIFakeFaces
<Common request parameters>
{
"FaceInputType": 1,
"FaceInput": "VBORw0KGgoAAAANSUhEUgAAAkYAAAI9CAYAAADfOLduAAABQ2lDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSCwoyGFhYGDIzSspCnJ3UoiIjFJgf87AziDBwMcgwqCQmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsgsz5I1BWZcn/xff7Y4dPvimWmY6lEAV0pqcTKQ/gPEyckFRSUMDIwJQLZyeUkBiN0CZIsUAR0FZM8AsdMh7DUgdhKEfQCsJiTIGci+AmQLJGckpgDZT4BsnSQk8XQkNtReEOD0CFBwNTI3LiTgVpJBSWpFCYh2zi+oLMpMzyhRcASGUKqCZ16yno6CkYGRMQMDKLwhqj/fAIcjoxgHQqzwKgODhTyQ8RQhlniBgWH3OgYG4Z8IMWUDBgYeoGn7/AsSixLhDmD8xlKcZmwEYXNvZ2Bgnfb//+dwBgZ2TQaGv9f///+9/f//v8sYGJhvMTAc+AYADqxgzYM88zoAAAA4ZVhJZk1NACoAAAAIAAGHaQAEAAAAAQAAABoAAAAAAAKgAgAEAAAAAQAAAkagAwAEAAAAAQAAAj0AAAAAi/M5dAAAQABJREFUeAHsvWd35EiSbYsIRlCkViW6pmq6Wry71vz/fzEf3n2fpufd"
}
{
"Response": {
"AttackRiskDetailList": [
{
"Type": "SuspectedWatermark"
}
],
"AttackRiskLevel": "High",
"RequestId": "2dd93e6f-5121-4bac-8c64-d6ad646663d2"
}
}
Example of a full-body encrypted request
POST / HTTP/1.1
Host: faceid.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DetectAIFakeFaces
<Common request parameters>
{
"Encryption": {
"Algorithm": "AES-256-CBC",
"EncryptList": [
"EncryptionBody"
],
"CiphertextBlob": "qwRTgn+52FAvnfrGL1oPBsXG4FLBd42YRw",
"Iv": "vqfsaEOpGJESA=="
},
"EncryptedBody": "v32onREKL6bk6WHOGFEjE2M6kvqybGCVTjlm"
}
{
"Response": {
"AttackRiskDetailList": [
{
"Type": "SuspectedWatermark"
}
],
"AttackRiskLevel": "High",
"RequestId": "2dd93e6f-5121-4bac-8c64-d6ad646663d2"
}
}
Image decoding failed
POST / HTTP/1.1
Host: faceid.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DetectAIFakeFaces
<Common request parameters>
{
"FaceInputType": 2,
"FaceInput": "AAAAHGZ0eXBtcDQyAAAAAWlzb21tcDQxbXA0MgAADXNtb292AAAAbG12aGQAAAAA2qNvttqjb7cAAB9AAACYFgABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAJ/XRyYWsAAABcdGtoZAAAAAHao2+22qNvtwAAAAEAAAAAAACYFgAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAADwAAAAtAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAmBYAAAAUAAEAAAAACXVtZGlhAAAAIG1kaGQAAAAA2qNvttqjb7cAAAJYAAALaFXEAAAAAAAxaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAENvcmUgTWVkaWEgVmlkZW8AAAAJHG1pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQ"
}
{
"Response": {
"Error": {
"Code": "FailedOperation.ImageDecodeFailed",
"Message": "Image decoding failed."
},
"RequestId": "0e77ad29-ad65-4901-9efc-b49a6e0a357b"
}
}
POST / HTTP/1.1
Host: faceid.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DetectAIFakeFaces
<Common request parameters>
{
"FaceInputType": 1,
"FaceInput": "data:image/*peg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aH*wgJC4n**Is**wcKDcpLDAxNDQ0Hyc5PTgy*C******2wBDAQkJCQwLDBgN*Rg*I**h*jI**jIyMjIyMjIyMjIyMjIyMjI*Mj*yM*IyMjIyMjIy*jIy*jI*M***MjI*MjIyMjL/wAARCAMAAwAD**IAAhEBAxEB/8*AHw*A*QU*AQ*BAQEA**A*AAAAAAECAwQFBgcICQoL/8QA*RA*Ag*DAwIE*wUF*AQAAA*9AQI*AA***R*hMU**E1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQ",
"ExtraRiskInfo": {
"Latitude": "1.3048",
"Longitude": "103.8318",
"Ip": "106.55.202.186"
}
}
{
"Response": {
"AttackRiskDetailList": [],
"AttackRiskLevel": "Mid",
"ExtraInfo": {},
"ExtraRiskResult": {
"BlackListResult": [],
"RiskDetailList": [
{
"Type": "IpLocationMismatch"
}
],
"RiskLevel": "High",
"Status": "Completed"
},
"RequestId": "5738fb6b-da7d-417f-af4d-947914e7bdc2"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| FailedOperation.CoveredFace | The face in the image is occluded. Upload an image with an unobstructed face. |
| FailedOperation.DetectEngineSystemError | Service engine call failed. Try again. |
| FailedOperation.ImageDecodeFailed | Image decoding failed. |
| FailedOperation.IncompleteFace | Full face not detected. Upload an image with a full face. |
| FailedOperation.PoorImageQuality | The image quality is too poor. Check the image quality. |
| FailedOperation.UnKnown | Internal unknown error. |
| FailedOperation.VideoDecodeFailed | Video decoding error. |
| FailedOperation.VideoDurationExceeded | The video duration is too long. The maximum supported video duration for this API is 20 seconds. |
| InvalidParameter | Parameter error. |
| InvalidParameterValue | Parameter value error. |
| RequestLimitExceeded | The number of requests exceeds the frequency limit. |
| UnauthorizedOperation.Arrears | The account is in arrears. |
| UnauthorizedOperation.ChargeStatusException | The billing status is abnormal. |
| UnauthorizedOperation.Nonactivated | The service is not activated. |
피드백