Face Comparison
Compares first_image with second_image and returns a
similarity score plus bounding boxes.
A scored comparison (SUCCESS) and billed detection outcomes
(FACE_NOT_FOUND, FIRST_FACE_NOT_FOUND, SECOND_FACE_NOT_FOUND,
MULTIPLE_FACES_DETECTED) are billed (pricing=PAID). Validation
errors and service failures are not billed (pricing=FREE).
This feature must be enabled on your account. If it is not, the
API returns UNAUTHORIZED.
Outcomes
| Result | Response |
|---|---|
| Faces compared | code=SUCCESS, data.first_face / data.second_face bounding boxes, data.similarity, pricing=PAID |
| No face / multiple faces | code is the vendor detection code, pricing=PAID (no data) |
| Face quality rejected by vendor | code=CLIENT_ERROR, pricing=FREE |
| Temporary service issue | code=SERVER_ERROR, pricing=FREE |
Invalid images or request_id | code=CLIENT_ERROR, pricing=FREE |
Same request_id with different images | code=DUPLICATE_REFERENCE, pricing=FREE |
| Missing token, feature not enabled, or IP not allowlisted | code=UNAUTHORIZED, pricing=FREE |
| Prepaid balance too low | code=INSUFFICIENT_BALANCE, pricing=FREE |
Images
JPEG and PNG only, 5 MB or smaller per file. Send them either as:
application/json—first_imageandsecond_imageare raw base64 (no line breaks, nodata:image/…prefix)multipart/form-data—request_idas a text field,first_imageandsecond_imageas file parts (the same field names)
Do not mix the two encodings in one request.
Idempotency
Use a unique request_id for each new comparison (UUID v4 is
recommended). Repeating the same request_id with the same
images returns the original result and is billed once — unless
the previous attempt did not complete, in which case the
comparison runs again. Different images with the same
request_id return DUPLICATE_REFERENCE.
Authorizations
Access token from POST /api/v1/kyc/auth/get-auth-token.
Valid for one hour.
Body
Your unique reference for this comparison. Use a new UUID for each new check. Sending the same key with the same images returns the original result and is billed once.
"TXN-20260727-001"
First image (typically a selfie) as raw base64 (JPEG or PNG).
No line breaks and no data:image/… prefix. Maximum 5 MB
after decoding.
"/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAg..."
Second image (typically an ID-card portrait) as raw base64
(JPEG or PNG). No line breaks and no data:image/… prefix.
Maximum 5 MB after decoding.
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="
Response
Comparison finished and billed (pricing=PAID).
SUCCESS includes data (boxes + similarity). Detection
codes (FACE_NOT_FOUND and related) have no data.
- Option 1
- Option 2
A scored comparison finished. Bounding boxes and similarity are in data.
SUCCESS "SUCCESS"
Always OK. Use code, not this field, to branch.
OK "OK"
The request_id you sent.
"TXN-20260727-001"
A scored comparison is always billed.
PAID "PAID"
