Skip to main content
The Fraud Detection API uses forensic AI to detect manipulated, altered, and AI-generated documents and images in real time.

Available Models

ModelUse CaseSupported File Types
documentDetects AI-generated or altered documents and IDs (bank statements, invoices, passports, driver licenses)jpg, jpeg, png, webp, pdf
objectDetects AI-generated or manipulated images (photos, claim evidence, receipts)jpg, jpeg, png, webp
Retrieve the full list of models programmatically:
curl https://api.deepxl.ai/v1/detection-models \
  -H "x-api-key: YOUR_API_KEY"

Analyzing a File

Submit a file for fraud detection via POST /v1/detection:
curl -X POST https://api.deepxl.ai/v1/detection \
  -H "x-api-key: YOUR_API_KEY" \
  -F "model=document" \
  -F "file=@invoice.pdf" \
  -F 'tags={"customerId":"9999","documentId":"INV-001"}'

Parameters

ParameterTypeRequiredDescription
modelstringYesdocument or object
filefileYesThe file to analyze (max 50 MB)
tagsstringNoJSON object with metadata key-value pairs
The maximum file size is 50 MB. Files exceeding this limit will be rejected with a 413 error.

Response Structure

A detection response contains the following fields:
{
  "result": {
    "detectionId": 42,
    "mediaType": "document",
    "fileType": "pdf",
    "fileName": "bank_statement.pdf",
    "fileSize": 245678,
    "timestamp": 1725795600,
    "timestampISO": "2024-09-08T10:00:00.000000",
    "model": "document",
    "modelVersion": "1.1.0",
    "likelihood": 85.2,
    "fraudSeverity": "high",
    "classification": "verified",
    "reasoning": [
      "Potential manipulation detected in text region",
      "Font inconsistencies found"
    ],
    "modelResults": {
      "technicalChecks": [
        {
          "type": "DOCUMENT_CLASSIFIER",
          "status": "PASS",
          "details": "Classified as bank statement",
          "likelihood": 0.02
        },
        {
          "type": "SEMANTIC_FRAUD",
          "status": "FAIL",
          "details": "Detected inconsistencies in text formatting",
          "likelihood": 0.85
        }
      ]
    },
    "tags": [
      { "name": "customerId", "value": "9999" },
      { "name": "documentId", "value": "INV-001" }
    ],
    "files": [
      {
        "category": "original_file",
        "fileName": "fd_42_bank_statement.pdf",
        "fileSize": 245678,
        "contentType": "application/pdf",
        "timestamp": 1725795600,
        "timestampISO": "2024-09-08T10:00:00.000000",
        "url": "https://api.deepxl.ai/v1/files/fd_42_bank_statement.pdf"
      },
      {
        "category": "heatmap",
        "fileName": "fd_42_heatmap_1.png",
        "fileSize": 45678,
        "contentType": "image/png",
        "timestamp": 1725795600,
        "timestampISO": "2024-09-08T10:00:00.000000",
        "url": "https://api.deepxl.ai/v1/files/fd_42_heatmap_1.png"
      }
    ]
  }
}

Field Reference

FieldTypeDescription
detectionIdintegerUnique identifier for the detection record
mediaTypestringMedia type category (image or document)
fileTypestringFile extension (jpeg, png, pdf, webp)
fileNamestringOriginal uploaded file name
fileSizeintegerFile size in bytes
timestampintegerUnix timestamp of the analysis
timestampISOstringISO 8601 timestamp of the analysis
modelstringModel used (document or object)
modelVersionstringVersion of the model used for analysis
likelihoodfloatFraud likelihood as a percentage (0–100)
fraudSeveritystringSeverity level: low, medium, or high
classificationstringQuality assessment: verified, unverified, or rejected
reasoningstring[]Natural-language explanations of the analysis findings
modelResultsobjectContains technicalChecks array with detailed check results
tagsobject[]Metadata tags attached to this detection
filesobject[]Associated files (original upload, heatmaps)

Understanding Results

Likelihood Score

The likelihood field is a 0–100% score indicating the probability of fraud or manipulation:
RangeSeverityInterpretation
0–29%lowNo significant indicators of manipulation
30–69%mediumSome indicators of manipulation detected
70–100%highStrong indicators of fraud detected

Classification

The classification field indicates the document quality assessment — whether the document passed all quality gates and could be properly analyzed. This is separate from the fraud result (likelihood / fraudSeverity).
ClassificationMeaning
verifiedDocument quality is good — passed all quality gates and was fully analyzed
unverifiedDocument quality is insufficient — image is blurry, corners are cut off, or semantic quality checks failed
rejectedDocument type is not supported, text content is insufficient, or multiple documents were submitted in a single file

Reasoning

The reasoning array contains natural-language explanations of the analysis findings. Each entry describes a specific observation or conclusion from the forensic analysis.

Technical Checks

The modelResults.technicalChecks array contains the individual forensic checks performed on the file. The number and type of checks varies depending on the model, file type, and document content. Each check object includes:
FieldTypeDescription
typestringCheck identifier
statusstringPASS, FAIL, WARNING, or NOT_PRESENT
detailsstringHuman-readable explanation of the check result
likelihoodfloatConfidence score for this specific check (0.0–1.0)

Status Values

StatusMeaning
PASSCheck passed — no issues found
FAILCheck failed — issue detected
WARNINGPotential concern — not conclusive but worth noting
NOT_PRESENTCheck could not be performed — required data was not available in the file

Document Model

The document model runs a multi-stage pipeline. First, a series of quality gates determine the classification (whether the document can be properly analyzed). Then, parallel fraud checks analyze the document for manipulation and determine the likelihood score. Additional checks may run depending on the file type and document category.

Object Model

The object model returns fraud detection results via the top-level likelihood, fraudSeverity, and reasoning fields. The technicalChecks array will be empty for the object model. When AI generation or manipulation is detected, a heatmap is included in the files array highlighting the suspicious regions.

Heatmaps

Both the document and object models can generate heatmap images that visually highlight the affected regions. Heatmaps make it easy to see exactly where tampering or AI generation was detected.

How Heatmaps Work

  • Heatmaps are PNG images overlaid on the original document or image
  • Document model: for multi-page PDFs, each page gets its own heatmap (fd_{id}_heatmap_1.png, fd_{id}_heatmap_2.png, etc.)
  • Object model: a single heatmap is generated per image (fd_{id}_heatmap_1.png)
  • Heatmaps are only generated when manipulation or AI generation is detected
  • They appear in the files array with category: "heatmap"

Retrieving Heatmaps

Heatmap URLs are included in the detection response under files:
{
  "files": [
    {
      "category": "original_file",
      "fileName": "fd_42_bank_statement.pdf",
      "url": "https://api.deepxl.ai/v1/files/fd_42_bank_statement.pdf"
    },
    {
      "category": "heatmap",
      "fileName": "fd_42_heatmap_1.png",
      "url": "https://api.deepxl.ai/v1/files/fd_42_heatmap_1.png"
    },
    {
      "category": "heatmap",
      "fileName": "fd_42_heatmap_2.png",
      "url": "https://api.deepxl.ai/v1/files/fd_42_heatmap_2.png"
    }
  ]
}
Download a heatmap using the file retrieval endpoint:
curl https://api.deepxl.ai/v1/files/fd_42_heatmap_1.png \
  -H "x-api-key: YOUR_API_KEY" \
  --output heatmap_page1.png

File Categories

CategoryDescription
original_fileThe file you originally uploaded
heatmapGenerated heatmap highlighting detected manipulation regions

Error Codes

StatusErrorDescription
400Bad RequestInvalid model name, invalid sort parameter, malformed JSON in tags, or invalid query parameters
401UnauthorizedMissing or invalid API key / Bearer token
404Not FoundDetection record not found
413Payload Too LargeFile exceeds the 50 MB maximum size
415Unsupported Media TypeFile type is not supported by the selected model
500Internal Server ErrorUnexpected server error — contact support if persistent
502Bad GatewayUpstream analysis service is temporarily unavailable — retry after a short delay

Tags and Filtering

Pass a JSON object in the tags parameter to attach metadata to your analysis:
{
  "customerId": "9999",
  "customerName": "Acme Corp",
  "documentId": "DOC-2024-001"
}
Filter your detection history by tags:
curl "https://api.deepxl.ai/v1/detection?tagFilter=customerId=9999" \
  -H "x-api-key: YOUR_API_KEY"

Browsing History

Retrieve paginated detection results with sorting and filtering:
curl "https://api.deepxl.ai/v1/detection?limit=25&offset=0&sortBy=createdOn&direction=desc" \
  -H "x-api-key: YOUR_API_KEY"

Query Parameters

ParameterTypeDescription
limitintegerNumber of results per page (default: 25)
offsetintegerNumber of results to skip
sortBystringField to sort by (see options below)
directionstringasc or desc
minLikelihoodfloatMinimum likelihood filter (0–100)
maxLikelihoodfloatMaximum likelihood filter (0–100)
fraudSeveritystringFilter by severity: low, medium, or high
classificationstringFilter by classification: verified, unverified, or rejected
tagFilterstringFilter by tag (format: key=value)
minTimestampintegerMinimum Unix timestamp
maxTimestampintegerMaximum Unix timestamp

Sort Options

fraudDetectionId, fileName, fileSize, fileType, model, likelihood, createdOn