Liveliness Detection
Determines whether a face is live or spoofed using AI-ForensiX anti-spoofing engine.
The Liveliness Detection API evaluates facial cues from a given frame to determine whether the user is live or spoofed.
It is used for preventing spoofing attacks such as printed photos, screen replays, or deepfake overlays.
🛠️ Endpoint
POST /v1/liveliness/detectRequest Body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
lastFrame | string | Yes | Base64-encoded frame of the user's face. |
isLive | boolean | Yes | Indicates whether the model predicts the face as live. |
confidence | number | Yes | Confidence score for liveliness classification. |
label | string | Yes | Prediction label - "REAL" or "FAKE". |
Example Request (cURL)
curl -X POST "https://forensiz.ai/detect" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"lastFrame": "<base64_string>",
"isLive": true,
"confidence": 0.98,
"label": "REAL"
}'Response Status Codes
| Status Code | Meaning |
|---|---|
| 200 OK | Liveliness assessment successful. |
| 400 Bad Request | Invalid JSON or missing fields. |
| 401 Unauthorized | Missing or invalid API key. |
| 403 Forbidden | Access denied. |
| 500 Internal Server Error | Unexpected server error. |