Liveness + deepfake in one call
Runs both checks on the same image. The overall decision is real only when every check passes its threshold; per-product outcomes are in checks. Costs 3 credits.
curl --request POST \
--url https://api.spoofsense.ai/v1/unified_detection \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": "<string>",
"image_url": "<string>",
"threshold": 0.5,
"thresholds": {}
}
'import requests
url = "https://api.spoofsense.ai/v1/unified_detection"
payload = {
"data": "<string>",
"image_url": "<string>",
"threshold": 0.5,
"thresholds": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: '<string>', image_url: '<string>', threshold: 0.5, thresholds: {}})
};
fetch('https://api.spoofsense.ai/v1/unified_detection', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.spoofsense.ai/v1/unified_detection",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => '<string>',
'image_url' => '<string>',
'threshold' => 0.5,
'thresholds' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.spoofsense.ai/v1/unified_detection"
payload := strings.NewReader("{\n \"data\": \"<string>\",\n \"image_url\": \"<string>\",\n \"threshold\": 0.5,\n \"thresholds\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.spoofsense.ai/v1/unified_detection")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": \"<string>\",\n \"image_url\": \"<string>\",\n \"threshold\": 0.5,\n \"thresholds\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spoofsense.ai/v1/unified_detection")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": \"<string>\",\n \"image_url\": \"<string>\",\n \"threshold\": 0.5,\n \"thresholds\": {}\n}"
response = http.request(request)
puts response.read_body{
"product": "unified",
"decision": "spoof",
"checks": {
"face_liveness": {
"decision": "real",
"genuine_score": 0.91,
"threshold": 0.5
},
"deepfake": {
"decision": "spoof",
"genuine_score": 0.31,
"threshold": 0.5
}
},
"latency_ms": 430,
"credits_remaining": 1235,
"session_id": {
"face_liveness": "d2f8c1e4a90b4f0f8f1f2a3b4c5d6e7f",
"deepfake": "a1b2c3d4e5f60718293a4b5c6d7e8f90"
},
"request_id": "11223344556677889900aabbccddeeff"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Provide 'data' (base64) or 'image_url'"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Missing, invalid, or revoked API key"
}
}{
"error": {
"code": "INSUFFICIENT_CREDITS",
"message": "Insufficient credits"
}
}{
"error": {
"code": "IMAGE_TOO_LARGE",
"message": "Image too large (max 10 MB)"
}
}{
"error": {
"code": "FACE_NOT_DETECTED",
"message": "No face found in the image"
}
}{
"error": {
"code": "UPSTREAM_ERROR",
"message": "Inference service unavailable"
}
}Authorizations
Your secret key (sk_live_…), server-side only. Also accepted as an x-api-key header.
Body
The image, in any supported form. Max 10 MB. EXIF orientation is applied automatically.
Base64-encoded image, or a full data URL. Alias: image.
http(s) URL we fetch server-side (10 s timeout). Alias: url. Provide either data or image_url.
Optional per-request decision threshold. Defaults to your org setting (0.5 unless changed).
0 <= x <= 1Unified only: per-product thresholds, e.g. {"face_liveness": 0.6, "deepfake": 0.4}.
Show child attributes
Show child attributes
Response
Scored checks
unified "real" only when every check passes its threshold.
real, spoof Per-product outcome.
Show child attributes
Show child attributes
Sum of per-model inference times.
One logged detection session per product.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.spoofsense.ai/v1/unified_detection \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": "<string>",
"image_url": "<string>",
"threshold": 0.5,
"thresholds": {}
}
'import requests
url = "https://api.spoofsense.ai/v1/unified_detection"
payload = {
"data": "<string>",
"image_url": "<string>",
"threshold": 0.5,
"thresholds": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: '<string>', image_url: '<string>', threshold: 0.5, thresholds: {}})
};
fetch('https://api.spoofsense.ai/v1/unified_detection', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.spoofsense.ai/v1/unified_detection",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => '<string>',
'image_url' => '<string>',
'threshold' => 0.5,
'thresholds' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.spoofsense.ai/v1/unified_detection"
payload := strings.NewReader("{\n \"data\": \"<string>\",\n \"image_url\": \"<string>\",\n \"threshold\": 0.5,\n \"thresholds\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.spoofsense.ai/v1/unified_detection")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": \"<string>\",\n \"image_url\": \"<string>\",\n \"threshold\": 0.5,\n \"thresholds\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spoofsense.ai/v1/unified_detection")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": \"<string>\",\n \"image_url\": \"<string>\",\n \"threshold\": 0.5,\n \"thresholds\": {}\n}"
response = http.request(request)
puts response.read_body{
"product": "unified",
"decision": "spoof",
"checks": {
"face_liveness": {
"decision": "real",
"genuine_score": 0.91,
"threshold": 0.5
},
"deepfake": {
"decision": "spoof",
"genuine_score": 0.31,
"threshold": 0.5
}
},
"latency_ms": 430,
"credits_remaining": 1235,
"session_id": {
"face_liveness": "d2f8c1e4a90b4f0f8f1f2a3b4c5d6e7f",
"deepfake": "a1b2c3d4e5f60718293a4b5c6d7e8f90"
},
"request_id": "11223344556677889900aabbccddeeff"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Provide 'data' (base64) or 'image_url'"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Missing, invalid, or revoked API key"
}
}{
"error": {
"code": "INSUFFICIENT_CREDITS",
"message": "Insufficient credits"
}
}{
"error": {
"code": "IMAGE_TOO_LARGE",
"message": "Image too large (max 10 MB)"
}
}{
"error": {
"code": "FACE_NOT_DETECTED",
"message": "No face found in the image"
}
}{
"error": {
"code": "UPSTREAM_ERROR",
"message": "Inference service unavailable"
}
}