Reference
SDKs (Python & TypeScript)
First-party clients handle Bearer authentication, multipart serialization, automatic Idempotency-Key headers, and structured API exceptions.
Installation
pip install facecore
# or
uv add facecoreSync & Async Clients
Python provides both FaceCoreClient and AsyncFaceCoreClient backed by httpx.
from facecore.sdk import FaceCoreClient, FaceCoreAPIError
fc = FaceCoreClient(base_url="https://api.facecore.dev", api_key=os.environ["FACECORE_KEY"])
try:
res = fc.verify(selfie_bytes, id_bytes, profile="standard", capture_type="selfie_id")
if res["decision"] == "INCONCLUSIVE":
print("Ask user to recapture:", res["reasons"])
except FaceCoreAPIError as err:
print(err.status_code, err.code, err.retryable, err.request_id)Signing Liveness Capture Manifests
When submitting frames to /v1/liveness/sessions/{id}/submit, sign the ordered frame SHA-256 hashes, timestamps, and server nonce with HMAC-SHA256 using sign_capture_manifest.
sign_capture_manifest (Python)
from facecore.sdk import sign_capture_manifest
signature = sign_capture_manifest(
manifest_key=os.environ["FACECORE_MANIFEST_KEY"],
session_id=session["session_id"],
nonce=session["nonce"],
frames=[frame_1, frame_2],
timestamps_ms=[100, 950],
observed_actions=["turn_left", "blink"],
)Consent & Gallery Methods
Consent-first enrollment & 1:N search
consent = fc.create_consent(purpose="account_verification", policy_version="p-2026-01", evidence_ref="chk_842")
gallery = fc.create_gallery(name="kyc-onboarding", purpose="verification", retention_days=365)
subject = fc.enroll_subject(
gallery["gallery_id"],
consent_id=consent["consent_id"],
images=[enrol_bytes],
)
match = fc.identify_in_gallery(gallery["gallery_id"], probe_bytes, profile="standard")
fc.delete_subject(subject["subject_id"])