1
Get an API Key
Sign in at app.spoofsense.ai and create a key under Dashboard → API keys. Keys look like
sk_live_… and are shown once — SpoofSense stores only a hash, so copy your key before closing the dialog.Export it as an environment variable so the examples below work without modification:2
Run a Liveness Check
Send any face image to the liveness endpoint — as a multipart file upload, a base64-encoded JSON body, or a publicly accessible URL. The examples below use a multipart file upload, which is the simplest approach for server-side code.
3
Read the Decision
A successful request returns a JSON object like this:Act on
Response
decision — it is either "real" or "spoof" and is the field your application logic should branch on. The remaining fields support tuning and audit:genuine_score— the raw calibrated probability (0–1) that the face is genuine. Higher means more confident the image is real.threshold— the value currently applied to produce the decision (genuine_score > threshold). The default is0.5.spoof_type— populated whendecisionis"spoof", describing the attack category detected (e.g."printed_photo").nullwhen the check passes.latency_ms— server-side processing time in milliseconds.credits_remaining— how many detection credits remain on your account after this call.session_id/request_id— use these when contacting support or correlating logs.
4
Try Deepfake or Unified Detection
The request shape is identical — only the endpoint changes. To check for AI-generated or face-swapped imagery, call
/v1/deepfake_detection. To run both liveness and deepfake checks in a single round trip, call /v1/unified_detection:/v1/unified_detection runs both checks and returns decision: "real" only when every check passes. The response also includes a per-product checks object so you can see which individual check failed and by how much.Next Steps
Verify Live Users with SDKs
For onboarding or KYC flows, use our Web and Android SDKs to capture the selfie directly from the camera with injection-attack protection — no image upload code required on your end.
Tune Thresholds
Learn how to raise or lower the decision threshold to balance your false-accept and false-reject rates for your specific risk tolerance.
Authentication Guide
Everything about API key scopes, rotation, and best practices for keeping your credentials secure.
API Reference
Every endpoint, parameter, and response field — with an interactive try-it console.
