AI Image Detection API for Developers
A deepfake detection API for developers is a programmatic REST interface that accepts image or video content and returns a structured forensic verdict — AI-generated, manipulated, or authentic — with a confidence score and per-layer evidence chain. The FauxLens developer API exposes our six-signal forensic pipeline via a simple POST endpoint, enabling content platforms, HR tools, and media companies to integrate AI image authentication directly into their application workflows.
REQUEST API ACCESSAPI Overview
The FauxLens AI image detection API provides programmatic access to our six-signal forensic detection engine via a RESTful interface. The primary endpoint accepts image files or image URLs and returns a structured JSON response containing the verdict, confidence score, suspected AI generator, and a per-layer evidence chain — all within an average of 3 seconds.
Authentication uses API key-based bearer tokens passed in the Authorization header. Each API key is scoped to an account and can optionally be restricted to specific IP address ranges for additional security. Rate limits are applied per API key: the default developer tier supports 60 requests per minute and 10,000 requests per month. Higher tiers support up to 600 requests per minute with burst capacity for traffic spikes. All rate limit responses include a Retry-After header indicating when requests can resume.
Supported input formats: JPEG, PNG, and WebP image files up to 25MB per request; MP4 and MOV video files up to 100MB per request. Both multipart form data (file upload) and JSON body with an image_url field are supported for image analysis. The API operates on the same zero-retention model as the web tool — no uploaded content is stored after analysis is complete. All traffic is encrypted in transit via TLS 1.3.
The API is available in two deployment models: the hosted multi-tenant API at api.fauxlens.com, and dedicated single-tenant instances for enterprise customers requiring data residency or network isolation. The OpenAPI specification, Postman collection, and code samples in Python, JavaScript, and Go are available to approved developers.
Sample API Response
The FauxLens API returns a consistent JSON envelope for all detection requests. Below is a representative response for an image that was identified as AI-generated by Midjourney.
The response structure:
"verdict": "AI-Generated", "confidence": 0.94, "suspected_model": "Midjourney v6", "processing_time_ms": 1847, "image_hash": "sha256:a3f8c2...", "evidence": [ { "layer": "gan_fingerprint", "status": "flagged", "label": "GAN Fingerprint Detected", "explanation": "Frequency-domain artifacts consistent with Midjourney v6 diffusion model denoising schedule detected at 0.89 confidence." }, { "layer": "prnu_analysis", "status": "flagged", "label": "No Camera Sensor Pattern", "explanation": "PRNU noise fingerprint absent. Image contains no coherent sensor noise pattern consistent with any known camera manufacturer." }, { "layer": "ela", "status": "warning", "label": "Uniform ELA Distribution", "explanation": "Error level analysis shows spatially uniform compression error distribution across the entire image — consistent with synthetic origin rather than a photographed scene." }, { "layer": "frequency_domain", "status": "flagged", "label": "Unnatural Spectral Signature", "explanation": "Fourier spectrum analysis reveals periodic artifacts at 64-pixel intervals in both horizontal and vertical axes — characteristic of latent diffusion model decoding." }, { "layer": "shadow_physics", "status": "warning", "label": "Shadow Inconsistency", "explanation": "Shadow direction vectors in lower-left quadrant are inconsistent with the apparent primary light source position." }, { "layer": "exif_metadata", "status": "flagged", "label": "No Camera EXIF", "explanation": "Image contains no EXIF metadata. No camera make, model, lens, or capture timestamp present." } ]
The verdict field contains one of three values: "AI-Generated", "Likely AI-Generated", or "Authentic". The confidence field is a float from 0.0 to 1.0. The suspected_model field is a string identifying the most likely AI generator, or null if the image is authentic or the generator cannot be determined. The image_hash is the SHA-256 of the submitted file, useful for deduplication and audit logging in your application.
Use Cases
The FauxLens API solves AI image authentication at scale across a growing range of application verticals.
Content moderation platforms integrate the API into their upload pipeline to automatically flag AI-generated images before they reach human review queues. Running the API call during upload — in parallel with virus scanning and NSFW classification — adds under 3 seconds of latency and dramatically reduces the volume of synthetic content that reaches moderators.
Dating and social platforms use the API to screen profile photos during account creation and again when users update their photos. A confidence threshold of 0.75 triggers a secondary review step rather than automatic rejection, minimizing false positives while catching the majority of synthetic profiles. Platforms running this check at signup have reported significant reductions in romance scam complaints from their user base.
Applicant tracking systems (ATS) used by HR teams in regulated industries trigger an API call when a candidate uploads a headshot photo, returning a result before the profile is routed to a recruiter. This integration follows the pattern used with other screening APIs — a webhook or synchronous call on the upload event, with the result stored as a candidate attribute in the ATS record.
E-commerce platforms use the API to verify product listing images, flagging AI-generated placeholder imagery that misrepresents actual products. Marketplaces report that AI-generated product photos often accompany fraudulent listings — catching them at upload prevents disputes and chargebacks.
Insurance claim processing workflows run the API against submitted damage photographs before routing claims to adjusters, automatically flagging high-confidence AI-generated images for senior review. This has materially reduced fraudulent claim payouts at insurers using automated screening.
News and media organizations embed API calls into their CMS intake workflow, automatically annotating received images with a confidence score before they reach photo editors. Images above a configurable threshold are held for mandatory editorial review before publication.
Integration Patterns and Code Examples
Three integration patterns cover the majority of real-world implementations.
Pattern 1 — cURL (baseline verification): curl -X POST https://api.fauxlens.com/v1/detect -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: multipart/form-data" -F "image=@/path/to/image.jpg"
Pattern 2 — Python with exponential backoff (production-grade): import requests, time, random
def analyze_image(filepath: str, api_key: str, max_retries: int = 3) -> dict: url = "https://api.fauxlens.com/v1/detect" headers = {"Authorization": f"Bearer {api_key}"} for attempt in range(max_retries): with open(filepath, "rb") as f: response = requests.post(url, headers=headers, files={"image": f}) if response.status_code == 200: return response.json() if response.status_code == 429: wait = (2 ** attempt) + random.uniform(0, 1) time.sleep(wait) continue response.raise_for_status() raise Exception("Max retries exceeded")
Pattern 3 — JavaScript/Node.js (upload pipeline integration): const FormData = require("form-data"); const fs = require("fs"); const fetch = require("node-fetch");
async function analyzeImage(filePath, apiKey) { const form = new FormData(); form.append("image", fs.createReadStream(filePath)); const response = await fetch("https://api.fauxlens.com/v1/detect", { method: "POST", headers: { Authorization: "Bearer " + apiKey, ...form.getHeaders() }, body: form, }); if (!response.ok) { const body = await response.json().catch(() => ({})); throw new Error("API error " + response.status + ": " + (body.error || response.statusText)); } return response.json(); }
For URL-based analysis (no file upload required), replace the multipart form body with a JSON body containing an image_url field: {"image_url": "https://example.com/photo.jpg"}. The API fetches and analyzes the image server-side. This is useful for analyzing images that are already publicly accessible without downloading them to your infrastructure first.
All production integrations should implement the Retry-After header from 429 responses, validate the image_hash in the response against your locally computed hash for audit purposes, and store the full evidence array alongside the verdict in your database for compliance and audit trail requirements.
Platform-Specific Integration Guides
Each platform type has established patterns for AI detection API integration that map cleanly to the FauxLens API.
Content moderation pipelines (following the Hive Moderation or Sightengine pattern): Trigger the FauxLens API call as a synchronous check in your upload handler before writing the file to permanent storage. Store the verdict and confidence score as attributes on your content object. Configure a threshold (typically 0.75 to 0.85 confidence for AI-generated) that routes the content to a human review queue rather than auto-publishing. For high-volume platforms, use the batch endpoint to process multiple images in a single request, reducing per-request overhead by up to 60% at scale.
Applicant tracking systems (Greenhouse, Lever, or custom ATS via webhook): Configure a webhook on the candidate photo upload event. The webhook payload includes the photo URL — pass this directly to the FauxLens URL-based detection endpoint. Write the returned verdict and confidence score back to the candidate record as a custom field. Route candidates with high-confidence synthetic photos to a flagged-for-review pipeline stage. Implement the check as non-blocking to avoid adding latency to the candidate upload experience; run it asynchronously and update the record when the result returns.
Social media platforms (upload webhook pattern): On any photo or video upload event, enqueue a background job that calls the FauxLens API with the uploaded file. The job writes the result back to the media record in your database. Surface the confidence score in your moderation dashboard as a column in the content review queue. For platforms with C2PA infrastructure, cross-reference FauxLens results with C2PA provenance data when both are available.
CMS systems (WordPress via plugin, Contentful via webhook): For WordPress, trigger the API call on the wp_handle_upload action hook, passing the file path to FauxLens and storing the result as post metadata attached to the media attachment. For Contentful, configure a publish webhook that fires on asset publication — call the FauxLens API with the asset URL and write the result back to the asset's metadata fields using the Contentful Management API. Low-confidence results (below 0.50) that are inconclusive should be logged for batch human review rather than triggering automatic actions.
Ready to verify an image?
Get API AccessFrequently Asked Questions
Learn More
The Science of Deception: How AI Detection Works
A comprehensive guide to the digital forensics behind Faux Lens. From Error Level Analysis (ELA) and JPEG compression artifacts to Photo Response Non-Uniformity (PRNU).
C2PA: The New Global Standard for Content Authenticity
Adobe, Microsoft, OpenAI, Sony, and the BBC have united behind a single open standard for proving media authenticity. C2PA embeds cryptographic provenance into images and videos. Here is what it means for the future of truth.
Detect while browsing — try the Chrome Extension
Right-click any image · 4 free detections · No account required