Skip to main content

Prerequisites

Before you begin, you’ll need:

Installation

pip install veri-sdk

Your First Detection

1

Initialize the client

Create a client with your API key:
from veri import VeriClient

client = VeriClient(api_key="your-api-key")
2

Detect an image

Pass an image to the detect method:
# From a file
result = client.detect(open("suspect_image.jpg", "rb"))

# From bytes
with open("suspect_image.jpg", "rb") as f:
    result = client.detect(f.read())

# From a URL
result = client.detect_url("https://example.com/image.jpg")
3

Interpret the results

The detection result contains:
print(f"Detection ID: {result.id}")
print(f"Is AI-generated: {result.is_fake}")
print(f"Confidence: {result.confidence:.1%}")
print(f"Processing time: {result.processing_time_ms}ms")

# Model-specific scores
for score in result.model_scores:
    print(f"  {score.model}: {score.score:.1%}")

Understanding Results

FieldDescription
is_fake / isFaketrue if the image is likely AI-generated
confidenceOverall confidence score (0-1)
model_scores / modelScoresIndividual scores from each detection model
cachedWhether the result came from cache
processing_time_ms / processingTimeMsTotal inference time
A confidence of 0.5 is the default threshold. Scores above 0.5 indicate the image is likely AI-generated.

Next Steps