API Reference

Verification (1:1)

1:1 Verification answers the question: "Are these two faces the same person?" It compares two face images (or one image against an enrolled face ID) and returns a similarity score between 0 and 1.

Use verification when you need to confirm that the person presenting themselves matches a known identity, for example re-authentication, document-to-selfie matching, or access control.

Compare two images

The simplest form: submit two face images and get back a similarity score. No collection or enrollment required.

curl -X POST https://api.livexface.com/api/v1/compare \
  -H "X-API-Key: YOUR_API_KEY" \
  -F "[email protected]" \
  -F "[email protected]"
JSON
{
  "success": true,
  "data": {
    "match": true,
    "confidence": 0.91,
    "thresholdUsed": 0.45
  }
}
Try it livePOST/compare
Parameters

The known face (identity to match against)

Click to upload: JPG, PNG, WebP

The face to verify against the reference

Click to upload: JPG, PNG, WebP

Verify against an enrolled face

Compare a probe image against a specific enrolled face ID in a collection. More efficient than comparing two raw images since the enrolled face reference is already stored.

curl -X POST https://api.livexface.com/api/v1/collections/COLLECTION_ID/verify \
  -H "X-API-Key: YOUR_API_KEY" \
  -F "[email protected]" \
  -F "face_id=dc3e7a57-22d5-4271-b707-213e49c8fe54"
JSON
{
  "success": true,
  "data": {
    "match": true,
    "confidence": 0.93,
    "thresholdUsed": 0.45,
    "faceId": "dc3e7a57-22d5-4271-b707-213e49c8fe54"
  }
}

Verify against a reference image

Instead of naming an enrolled face, you can send a second image and compare the two directly. Pass reference_image in place of face_id — the request needs one or the other.

Shell
POST /api/v1/collections/{collection_id}/verify
X-API-Key: lxf_a1b2c3d4_e5f6g7h8i9j0k1l2m3n4o5p6
Content-Type: multipart/form-data

image=@probe.jpg
reference_image=@enrolled.jpg

Response fields

FieldTypeDescription
matchbooleantrue when confidence reaches the threshold.
confidencefloatHow close the two faces are, 0.0–1.0.
thresholdUsedfloatThe threshold this request was judged against.
faceIdstringThe enrolled face the probe was compared with.

Choosing a threshold

The default threshold of 0.40 is calibrated against LFW: it accepts 96.99% of genuine pairs at a false-accept rate below 1e-5. You can override it per-request with the threshold parameter:

  • Balanced (0.40, default): Good for most identity verification use-cases.
  • High security (0.45–0.50): Fewer false accepts, at a real cost in false rejections — 0.50 drops acceptance of genuine pairs to 93.76%. Use for access control or financial verification.
  • Permissive (0.30–0.35): Catches more borderline matches. Suitable for photo deduplication or fuzzy matching.

Raising the threshold well above 0.50 buys almost nothing: the false-accept rate has already bottomed out by then, so the extra strictness only rejects genuine users. At 0.70 the API accepts just 41% of genuine pairs.

Shell
# Override threshold per request
image=@probe.jpg
face_id=dc3e7a57-22d5-4271-b707-213e49c8fe54
threshold=0.50

Try it live

Enter your API key, the collection ID, and the face ID you got back when you enrolled the face, then upload a probe image.

Try it livePOST/collections/{collection_id}/verify
Parameters

The face to verify

Click to upload: JPG, PNG, WebP

The UUID returned when the face was enrolled

Minimum confidence to count as a match