Integrate Face Verification into your application. All API endpoints use Bearer token authentication and return JSON responses.
All API requests require an API key sent via the Authorization header. API keys are generated from the customer dashboard after signing up.
Authorization: Bearer TREfvyour_api_key_here
Compare two face images and determine whether they depict the same person.
POST /api/v1/verify-face
multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
image1 | file | yes | First face image (JPEG, PNG, WebP) |
image2 | file | yes | Second face image (JPEG, PNG, WebP) |
{
"success": true,
"match": true,
"similarity": 0.94,
"confidence": "very_high",
"quality": {
"image1": "good",
"image2": "good"
},
"credits_used": 1,
"remaining_credits": 42,
"processing_time_ms": 245,
"request_id": "req_abc123def456"
}| Field | Type | Description |
|---|---|---|
match | boolean | true if faces belong to the same person |
similarity | float | Cosine similarity score (0.0 to 1.0) |
confidence | string | One of: very_high, high, possible, low |
credits_used | int | 1 if a valid decision was produced, 0 otherwise |
request_id | string | Unique identifier for this request |
Submit multiple image pairs in a single request.
POST /api/v1/batch/verify-face
multipart/form-data
| Field | Type | Description |
|---|---|---|
pairs_metadata | string (JSON) | Array of pair objects mapping IDs to image field names |
[
{
"id": "pair_1",
"image1_field": "pair_1_image1",
"image2_field": "pair_1_image2"
},
{
"id": "pair_2",
"image1_field": "pair_2_image1",
"image2_field": "pair_2_image2"
}
]{
"success": true,
"batch_id": "batch_abc123",
"total": 2,
"completed": 2,
"credits_used": 2,
"remaining_credits": 98,
"results": [
{
"id": "pair_1",
"success": true,
"match": true,
"similarity": 0.91,
"confidence": "very_high",
"credits_used": 1
},
{
"id": "pair_2",
"success": false,
"error": "NO_FACE_FOUND",
"credits_used": 0
}
]
}curl -X POST https://api.faceverify.io/api/v1/verify-face \ -H "Authorization: Bearer TREfvyour_api_key" \ -F "[email protected]" \ -F "image2=@id_photo.jpg"
import requests
url = "https://api.faceverify.io/api/v1/verify-face"
headers = {"Authorization": "Bearer TREfvyour_api_key"}
files = {
"image1": open("selfie.jpg", "rb"),
"image2": open("id_photo.jpg", "rb"),
}
resp = requests.post(url, headers=headers, files=files)
result = resp.json()
print("Match:", result["match"])
print("Similarity:", result["similarity"])
print("Confidence:", result["confidence"])const FormData = require("form-data");
const fs = require("fs");
const form = new FormData();
form.append("image1", fs.createReadStream("selfie.jpg"));
form.append("image2", fs.createReadStream("id_photo.jpg"));
const resp = await fetch(
"https://api.faceverify.io/api/v1/verify-face",
{
method: "POST",
headers: {
Authorization: "Bearer TREfvyour_api_key",
...form.getHeaders(),
},
body: form,
}
);
const result = await resp.json();
console.log("Match:", result.match);Choose a predefined scenario below to see how the API responds. Enter your API key to run a live test against the actual endpoint.
Two images of the same person. The API should return match: true with high similarity.
Image 1

Image 2

Expected response
{
"success": true,
"match": true,
"similarity": 0.94,
"confidence": "very_high",
"credits_used": 1,
"remaining_credits": 42,
"processing_time_ms": 245,
"request_id": "req_live_demo_001"
}Errors return a 4xx or 5xx status code with a JSON body.
| Code | HTTP Status | Description |
|---|---|---|
INVALID_IMAGE | 400 | Image could not be decoded or is corrupt |
IMAGE_TOO_LARGE | 400 | Image exceeds maximum file size (10 MB) |
NO_FACE_FOUND | 400 | No detectable face in the image |
MULTIPLE_FACES_FOUND | 400 | More than one face detected |
FACE_TOO_SMALL | 400 | Face region is too small for analysis |
INSUFFICIENT_CREDITS | 403 | Not enough credits for the request |
UNAUTHORIZED | 401 | Missing or invalid API key |
WEAK_PASSWORD | 422 | Password does not meet requirements |
EMAIL_EXISTS | 409 | Account with this email already exists |
INTERNAL_ERROR | 500 | Unexpected server error |
| Item | Value |
|---|---|
| Cost per verification | 1 credit |
| Cost per batch pair | 1 credit |
| Maximum image size | 10 MB |
| Accepted formats | JPEG, PNG, WebP |
| Maximum batch pairs | 50 pairs |
| Free signup credits | 10 credits |
Credits are only consumed when a valid match or no-match decision is produced. Failed validations (invalid image, no face found, etc.) do not cost credits.
Webhooks let you receive event notifications via HTTP callbacks. Configure them from the dashboard.
| Event | Description |
|---|---|
verification.completed | A face verification request completed |
batch.completed | A batch verification request completed |
credits.low | Credit balance fell below the threshold |
payment.completed | A credit purchase payment was verified |
Each webhook request includes an X-TRE Faceverify-Signature header containing an HMAC-SHA256 signature of the payload. Verify this signature using your webhook secret to confirm the request is genuine.
Ready to integrate? Here is the quick path: