Developer/API & keys

API & keys

Authenticate requests and integrate verification into your own workflows.

Authentication

All detection endpoints accept either a JWT (Authorization: Bearer <token>) or your API key (X-API-Key: <key>).

Sign in to view your API key
Interactive Swagger UI is available at <API_BASE>/docs.

Endpoints

MethodPathDescription
POST/api/auth/registerCreate an account → returns JWT + API key
POST/api/auth/loginLog in → returns JWT + API key
POST/api/detectUpload image/video, run 8-method pipeline
GET/api/results/{scan_id}Fetch results for an analysis
GET/api/historyAnalysis history (auth required)
GET/api/healthService health check

Run an analysis (curl)

Add ?sync=true to get the result in the response; otherwise poll /api/results/{scan_id}.

# Synchronous scan
curl -X POST "https://api.antideepfakeai.com/api/detect?sync=true" \
  -H "X-API-Key: adf_your_api_key_here" \
  -F "file=@/path/to/photo.jpg"

Asynchronous analysis + poll

# 1) Submit
SCAN=$(curl -s -X POST "https://api.antideepfakeai.com/api/detect" \
  -H "X-API-Key: adf_your_api_key_here" \
  -F "file=@/path/to/clip.mp4" | jq -r .scan_id)

# 2) Poll until status == "done"
curl -s "https://api.antideepfakeai.com/api/results/$SCAN" \
  -H "X-API-Key: adf_your_api_key_here" | jq

Example response

{
  "scan_id": "f1c2...",
  "status": "done",
  "filename": "photo.jpg",
  "media_type": "image",
  "file_sha256": "b9c4...",
  "score": 23.5,
  "fake_probability": 0.765,
  "verdict": "LIKELY FAKE",
  "verdict_confidence": 46.0,
  "evidence_grade": "strong",
  "recommended_action": "Escalate to manual forensic review.",
  "processing_time_sec": 1.8,
  "breakdown": [
    { "name": "face_forgery",     "score": 12.0, "status": "ok",       "fake_probability": 0.88, "summary": "..." },
    { "name": "frequency_analysis","score": 30.1, "status": "ok",       "fake_probability": 0.70, "summary": "..." },
    { "name": "gan_fingerprint",  "score": 18.0, "status": "ok",       "fake_probability": 0.82, "summary": "...", "details": {"predicted_source": "Stable Diffusion"} }
    /* ...core detectors plus optional premium_consensus... */
  ],
  "artifacts": { "report_json": "...", "report_pdf": "...", "heatmap": "...", "spectrum": "..." }
}

Python example

import requests

API = "https://api.antideepfakeai.com"
KEY = "adf_your_api_key_here"

with open("photo.jpg", "rb") as f:
    r = requests.post(
        f"{API}/api/detect?sync=true",
        headers={"X-API-Key": KEY},
        files={"file": f},
    )
result = r.json()
print(result["verdict"], result["score"])
for d in result["breakdown"]:
    print(d["name"], d["score"], d["status"])

Rate limits & formats

  • Max upload size: 100 MB (configurable server-side).
  • Images: JPEG, PNG, WebP, BMP. Videos: MP4, MOV, AVI, MKV, WebM.
  • Fair-use rate limits apply per API key; contact support for higher limits.
  • Videos are analyzed via frame sampling for fast turnaround.