POST /v1/liveness_detection, POST /v1/deepfake_detection, and POST /v1/unified_detection — accept the same image in four interchangeable forms. Pick whichever fits your stack; the server treats them identically once decoded.
Formats
- Multipart file
- Base64 JSON
- Image URL
- Raw bytes
file is canonical; image is accepted as an alias.Requirements and behavior
- Formats: JPEG, PNG, WebP, GIF, BMP — anything a standard image decoder reads. Undecodable input returns
422 INVALID_IMAGE. - Size limit: 10 MB, enforced on the decoded payload and on URL downloads alike. Requests over the limit return
413 IMAGE_TOO_LARGE. - Orientation: EXIF rotation is applied automatically before detection, so portrait captures from phones are always analyzed correctly.
- One clear face: the image must contain a detectable face, large enough to analyze. Missing or distant faces return
422 FACE_NOT_DETECTEDor422 FACE_TOO_SMALL. - Lighting: heavily backlit captures are rejected with
422 IMAGE_BACKLITrather than scored unreliably — prompt the user to retake with light on the face, not behind it.
Don’t downscale or re-encode before sending. Resolution is load-bearing for deepfake detection — send the original capture. Failed input validation (any 4xx) is never charged.
Threshold overrides
All input forms accept an optional per-request threshold (JSON body or multipart field):- Single endpoints (
/v1/liveness_detection,/v1/deepfake_detection): use thethresholdfield — a number in[0, 1]. - Unified endpoint (
/v1/unified_detection): use thethresholdsobject, e.g.{"face_liveness": 0.6, "deepfake": 0.4}(JSON body only). A plainthresholdapplies to both checks.
400 INVALID_THRESHOLD. See Thresholds & scores for when and how to tune.