Liveness and Face Match
Verify a returning user by matching a fresh liveness video against a previously enrolled portrait.
- Enroll a reference portrait and match it against live selfie frames
- Send v2 JSON with
reference_portrait_b64plus liveness video - Gate onboarding on
face_matchandlivenessscores
Time to complete: ~10 minutes
Prerequisites
SAGEA_API_KEYset in your environment asBearerauth.- Read Send your first API request to create a key.
- Read How Helios works to understand liveness and anti-spoofing.
- Test assets:
front.jpg,liveness.mp4(MP4 or MOV or WebM, 3 to 10s), andportrait.jpg(enrolled face).
Step 1: Prepare the portrait and liveness video
Use a clean enrolled portrait and a fresh 3 to 10 second selfie video with one face, good light, and no filters.
Trim or compress to 720p if the video is near the 50MB limit.
Step 2: Send v2 with a reference portrait
POST https://api.sagea.space/helios/kyc/v2 accepts reference_portrait_b64 for 1 to 1 face comparison against liveness frames.
Helios compares the enrolled portrait to frames sampled from the video and returns face_match plus liveness with anti-spoofing.
Step 3: Gate on face match and liveness
Branch on decision, then apply score thresholds for step-up or retry logic.
A strong match looks like face_match 0.93 and liveness 0.99. A low face match with high liveness usually means the wrong person, not a spoof.
Verify
A successful run returns HTTP 200 with scores for face_match and liveness and a decision. If it fails, check below.
| Error | Cause | Fix |
|---|---|---|
401 Unauthorized | API key missing or invalid | Confirm echo $SAGEA_API_KEY is set and retry |
400 missing_artifact | Video or portrait field absent | Include liveness_video_b64 and reference_portrait_b64 |
413 Payload Too Large | Video exceeds about 50MB | Compress to 720p and trim to range 3 to 10s |
422 spoof_detected | Screen replay or printed face detected | Recapture a live video with motion and no filters |
