API Documentation

Getting Started

Get Your API Key

To use the AI Photo Detect API, you need an API key. Your API key is used to authenticate all API requests and should be kept secure.

Your API key will have the format: apd_live_...

Authentication

Include your API key in the Authorization header for all API requests:

Authorization: Bearer apd_live_your_api_key_here

Limits

General Limits

  • File Size: Maximum 10MB per image
  • Supported Formats: PNG, JPG, JPEG, GIF, WebP
  • Image Dimensions: Minimum 100x100px, Maximum 4096x4096px
  • Rate Limiting: 100 requests per 15 minutes per API key
  • API Key Expiration: API keys expire after 1 year
  • Maximum API Keys: 10 active (non-expired) keys per user

Per-Plan Limits

PlanPriceChecks/MonthExtra Check PriceFeatures
Free (14-day trial)$0/month100 images-history
Starter$25/month1,000 images$0.015+ spending alerts
Basic$99/month10,000 images$0.010+ better support
Pro$299/month100,000 images$0.005+ spending alerts and caps, monitoring, premium support
EnterpriseCustomUnlimitedN/A+ SSO, audit log

API Reference

POST /v1/detect

Single endpoint for image detection. Supports both URL-based and file upload methods. Can process multiple detection services in one request.

Method 1: Image URL (JSON)

Endpoint

https://api.aiphotodetect.com/v1/detect

Request

curl -X POST "https://api.aiphotodetect.com/v1/detect" \
-H "Authorization: Bearer apd_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"services": "ai-photo-detect,self-harm,nudity",
"url": "https://example.com/image.jpg"
}'

Response (200 OK)

{
"success": true,
"services": {
"ai-photo-detect": {
"isAiGenerated": true,
"confidenceScore": 85.5,
"provider": "hf-api-da6-frid"
},
"self-harm": {
"detected": false
},
"nudity": {
"detected": true
}
},
"photo": {
"id": "cm56abc123xyz",
"status": "COMPLETED"
},
"processingTimeMs": 1250
}

Method 2: File Upload (Multipart)

Endpoint

https://api.aiphotodetect.com/v1/detect

Request

curl -X POST "https://api.aiphotodetect.com/v1/detect" \
-H "Authorization: Bearer apd_live_your_api_key_here" \
-F "services=ai-photo-detect,self-harm,nudity" \
-F "file=@/path/to/image.jpg"

Response (200 OK)

{
"success": true,
"services": {
"ai-photo-detect": {
"isAiGenerated": false,
"confidenceScore": 12.3,
"provider": "hf-api-da6-frid"
},
"self-harm": {
"detected": true
},
"nudity": {
"detected": false
}
},
"photo": {
"id": "cm57def456ghi",
"status": "COMPLETED"
},
"processingTimeMs": 2150
}

Available Services

  • ai-photo-detect - AI-generated image detection (default)
  • self-harm - Self-harm content detection (coming soon)
  • nudity - Nudity content detection (coming soon)

Note: You can request one or more services by separating them with commas.

Error Responses

400 Bad Request

{
"statusCode": 400,
"error": "Bad Request",
"message": "Invalid services: unknown-service. Available: ai-photo-detect,self-harm,nudity"
}

401 Unauthorized

{
"statusCode": 401,
"error": "Unauthorized",
"message": "Invalid or missing API key"
}

GET /v1/history

Retrieve paginated list of your detection history.

Endpoint

https://api.aiphotodetect.com/v1/history?page=1&perPage=50

Request Headers

Authorization: Bearer apd_live_your_api_key_here

Response (200 OK)

{
"data": [
{
"requestId": "cm57xyz789abc",
"result": 92,
"processed": "2025-12-31 23:59:59"
}
],
"meta": {
"pagination": {
"currentPage": 1,
"perPage": 50,
"totalRecords": 150,
"totalPages": 3,
"hasNextPage": true,
"hasPreviousPage": false
}
}
}

GET /v1/history/:requestId

Retrieve detailed information about a specific detection result.

Endpoint

https://api.aiphotodetect.com/v1/history/cm57xyz789abc

Request Headers

Authorization: Bearer apd_live_your_api_key_here

Response (200 OK)

{
"data": {
"requestId": "cm57xyz789abc",
"result": 92,
"processed": "2025-12-31 23:59:59",
"details": {
"isAiGenerated": false,
"confidenceScore": 0.92,
"detectionModel": "hf-api-da6-frid",
"processingTimeMs": 1250,
"analyzedAt": "2024-01-15T10:31:30.000Z",
"photo": {
"id": "cm56abc123xyz",
"originalFilename": "vacation-photo.jpg",
"fileSize": "2048576",
"mimeType": "image/jpeg",
"dimensions": {
"width": 1920,
"height": 1080
},
"status": "COMPLETED"
}
}
}
}

Code Examples for POST /v1/detection

Examples showing how to call the first endpoint to get a presigned S3 URL.

curl -X POST https://api.aiphotodetect.com/v1/detection \
-H "Authorization: Bearer apd_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"fileName": "vacation-photo.jpg",
"fileType": "image/jpeg",
"fileSize": 2048576
}'

Need Help?

• Visit your Dashboard to monitor your usage

• Contact support for Enterprise plan inquiries