Documentation

Documentation

  • Conversation
  • Reader
  • Speech
  • Console
  • AI Agents
  • Languages iconEnglish
    • Tiếng Việt
    • Janpanese

›API

Overview

  • Driving License Recognition
  • ID Recognition
  • Passport Recognition
  • Facematch
  • Face Search
  • Reader
  • SDK eKYC
  • Liveness Detection

API

  • Driving Licence Recognition
  • ID Recognition
  • Passport Recognition
  • Face Search
  • Facematch
  • Liveness Detection

Tutorials

  • Driving License Recognition
  • ID Recognition
  • Passport Recognition
  • Face Search
  • Facematch
  • SDK eKYC
  • Liveness Detection

API

FPT.AI Reader - Liveness Detection

Input image requirement

For video

  • The input video does not exceed 10MB
  • The video has at least 25fps and the minimum resolution of 720p (HD) to ensure accuracy
  • There must be only 1 face in video
  • The face area must take up at least 30% the total video frame
  • The face must not out of frame during video
  • The face must not contain spotlight or be covered or in backlit condition or out of focus
  • The video must have frontal face
  • The video is 5-6 seconds long.

For attached image (to compare the face)

  • The image to be compared with video does not exceed 5MB and has the minimum resolution of 800x600.

  • The face area must take up at least 40% the total image

Standard image

1

Poor-quality image/video

  • Image with low quality or covered face
  • Video is blurry, made with low-quality camera

API Information

Request Url

POST https://api.fpt.ai/dmp/liveness/v3

Request Headers

ParameterRequestDefaultDescription
api_keyYesyour api_key (from console.fpt.ai)

Request Body

FormData containing the video and image to be checked

ParameterRequestValueDescription
videoYespath-to-video.mp4Video of customer’s face naturally moving
cmndNopath-to-id.pngImage to be compared with the straightest face in video

Sample Request

curl --location --request POST 'https://api.fpt.ai/dmp/liveness/v3' \
--header 'api-key: xxxxxxxx' \
--form 'video=@"/video.mp4"' \
--form 'cmnd=@"/face.jpg"'

Response

JSON

{
    "code": "200",
    "message": "request successful",
    "liveness": {
        "code": "200",
        "message": "liveness check successful",
        "is_live": "true",
        "spoof_prob": "0.0015",
        "need_to_review": "false",
        "is_deepfake": "false",
        "deepfake_prob": "0.0",
        "warning": "Resolution of video is too low. Please upload video with at least HD resolution to ensure accuracy"
    },
    "face_match": {
        "code": "200",
        "message": "face matching successful",
        "isMatch": "false",
        "similarity": "18.45",
        "warning": "N/A"
    }
}

Returned Information

FieldsDescription
codeCode/Error
is_liveVideo authentication result
is_deepfakeDeepfake detection result (deepfake result is returned incase low resolution input)
face_matchFace matching result
warningWarning when input quality may harm the accuracy

Code

CodeMeaning
200No error, see more results in the above fields
406Face quality is not good enough (covered, too dark/bright..)
408More than 1 face in the video
409No video uploaded/Wrong extension/Video is too short/Invalid input
410No face/Lost face in the video
411The face is too small
412The face is too blurry
413Video is still image
422No frontal face in video
423Face is out of frame during video

Sample Response: Success

{
    "code": "200",
    "message": "request successful",
    "liveness": {
        "code": "200",
        "message": "liveness check successful",
        "is_live": "true",
        "spoof_prob": "0.3587",
        "need_to_review": "false",
        "is_deepfake": "N/A",
        "deepfake_prob": "N/A",
        "warning": ""
    },
    "face_match": {
        "code": "200",
        "message": "face matching successful",
        "isMatch": "true",
        "similarity": "99.97",
        "warning": "N/A"
    }
}

Sample Response: Error

{
    "code": "407",
    "message": "No faces detected in document",
    "liveness": {
        "code": "200",
        "message": "liveness request successful",
        "is_live": "true",
        "spoof_prob": "0.3805",
        "need_to_review": "false",
        "is_deepfake": "N/A",
        "deepfake_prob": "N/A",
        "warning": ""
    },
    "face_match": {
        "code": "407",
        "message": "No faces detected in document",
        "isMatch": "N/A",
        "similarity": "N/A",
        "warning": "N/A"
    }
}

{
    "code": "413",
    "message": "Video may seem like image",
    "liveness": {
        "code": "413",
        "message": "Video may seem like image",
        "is_live": "false",
        "spoof_prob": "N/A",
        "need_to_review": "false",
        "is_deepfake": "N/A",
        "deepfake_prob": "N/A",
        "warning": ""
    },
    "face_match": {
        "code": "N/A",
        "message": "N/A",
        "isMatch": "N/A",
        "similarity": "N/A",
        "warning": "N/A"
    }
}

{
    "code": "409",
    "message": "Invalid upload image",
    "liveness": {
        "code": "409",
        "message": "Invalid upload image",
        "is_live": "N/A",
        "spoof_prob": "N/A",
        "need_to_review": "N/A",
        "is_deepfake": "N/A",
        "deepfake_prob": "N/A",
        "warning": "N/A"
    },
    "face_match": {
        "code": "409",
        "message": "Invalid upload image",
        "isMatch": "N/A",
        "similarity": "N/A",
        "warning": "N/A"
    }
}
← FacematchDriving License Recognition →
  • Input image requirement
    • For video
    • For attached image (to compare the face)
  • API Information
    • Request Url
    • Request Headers
    • Request Body
    • Sample Request
    • Response
Conversation
DocumentationAPI ReferenceTutorials (Video)
Reader
DocumentationAPI ReferenceTutorials
Speech
DocumentationAPI ReferenceTutorials
Copyright © 2025 FPT Corporation