API Reference

Everything you need to integrate AI image detection into your app.

Getting Started

Get up and running with the AI Photo Detect API in just a few minutes.

1

Create an account

Sign up for a free account to get your API key.

2

Get your API key

Generate an API key from your dashboard.

3

Make your first request

Use the code examples in the POST /v1/detect section below to make your first detection request.

Authentication

All API requests require authentication using a Bearer token in the Authorization header.

Authorization: Bearer apd_live_your_api_key_here

API keys have the format: apd_live_... or apd_test_...

Use apd_test_... keys for development — they work identically but are tracked separately. Use apd_live_... keys in production.

POST/v1/detect

Analyze an image to detect if it was AI-generated. Supports both file upload (multipart) and URL submission (JSON).

Parameters

ParameterTypeRequiredDescription
fileFileRequired*Image file (multipart upload)
urlStringRequired*Image URL (JSON body)
servicesStringOptionalComma-separated list of services to run. Available: ai-photo-detect, age-estimate, detect-celebrities, detect-labels. Defaults to ai-photo-detect if omitted.

* Either file or url is required

Code Examples

File Upload (multipart/form-data)

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

URL Submission (application/json)

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",
"url": "https://example.com/image.jpg"
}'

Response

{
"success": true,
"services": {
"ai-photo-detect": {
"isAiGenerated": true,
"confidenceScore": 85.5,
"provider": "hf-api-da6-frid"
}
},
"photo": {
"id": "cm56abc123xyz",
"status": "COMPLETED"
},
"creditCost": 1,
"processingTimeMs": 1250
}

Service response examples

{
"services": {
"age-estimate": {
"faces": [
{
"ageRange": { "low": 25, "high": 35 },
"ageEstimate": 30,
"confidence": 98.4
}
]
}
}
}
{
"services": {
"detect-celebrities": {
"celebrities": [
{
"name": "Emma Watson",
"matchConfidence": 99.1,
"urls": ["www.imdb.com/name/nm0914612"]
}
]
}
}
}
{
"services": {
"detect-labels": {
"labels": [
{
"name": "Person",
"confidence": 99.8,
"categories": ["Person Description"]
}
]
}
}
}
GET/v1/history

Retrieve a paginated list of your operation history.

Query Parameters

ParameterTypeDefaultDescription
pageInteger1Page number
perPageInteger50Results per page (max 100)

Code Examples

curl "https://api.aiphotodetect.com/v1/history?page=1&perPage=50" \
-H "Authorization: Bearer apd_live_your_api_key_here"

Response

{
"data": [
{
"requestId": "req_wUKl0im7IZg4bCefnE",
"operationId": "op_QtLqxId519-4muCl_L",
"services": {
"ai-photo-detect": {
"isAiGenerated": false,
"confidenceScore": 0.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 operation result.

Code Examples

curl "https://api.aiphotodetect.com/v1/history/req_wUKl0im7IZg4bCefnE" \
-H "Authorization: Bearer apd_live_your_api_key_here"

Response

{
"data": {
"requestId": "req_wUKl0im7IZg4bCefnE",
"processed": "2025-12-31 23:59:59",
"services": {
"ai-photo-detect": {
"operationId": "op_QtLqxId519-4muCl_L",
"services": {
"isAiGenerated": false,
"confidenceScore": 0.92
},
"provider": "hf-api-da6-frid",
"processingTimeMs": 1250,
"analyzedAt": "2025-12-31T23:59:59.000Z"
}
},
"details": {
"photo": {
"id": "cm56abc123xyz",
"originalFilename": "vacation-photo.jpg",
"fileSize": "2048576",
"mimeType": "image/jpeg",
"status": "COMPLETED"
}
}
}
}

Limits & Pricing

General Limits

Max file size

10MB per image

Supported formats

PNG, JPG, JPEG, GIF, WebP

Rate limit

100 requests per 15 min

Image dimensions

100x100 to 4096x4096 px

Pricing Plans

PlanPriceIncludedOverage
Free$0/mo100 operations-
Starter$25/mo1,000 operations$0.015 per extra operation
Basic$99/mo10,000 operations$0.010 per extra operation
Pro$299/mo100,000 operations$0.005 per extra operation
EnterpriseCustomUnlimitedCustom

Usage Limits & Overage Policy

Free trial: Hard-capped at the plan's operation limit (100 operations). Once reached, operations are blocked until you upgrade.

Paid plans (Starter, Basic, Pro): Once 100% of your monthly usage is reached, you will be charged per extra operation at your plan's overage rate. By default, when you reach 200% of the original plan usage, operations will be rate-limited (HTTP 429) until the next payment period or until you upgrade your plan.

Email alerts: You will receive email notifications at 80%, 90%, and 100% of your monthly usage limit.

To request a higher overage cap for your plan, contact us at support@aiphotodetect.com.

Error Handling

The API uses standard HTTP status codes and returns errors in a consistent JSON format.

400Bad Request
{
"statusCode": 400,
"error": "Bad Request",
"message": "Invalid services: unknown-service. Available: ai-photo-detect,age-estimate,detect-celebrities,detect-labels"
}
401Unauthorized
{
"statusCode": 401,
"error": "Unauthorized",
"message": "Invalid or missing API key"
}
429Rate Limited (too many requests)
{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Rate limit exceeded. Please wait 15 minutes."
}
429Monthly Limit Exceeded
{
"statusCode": 429,
"error": "Usage Limit Exceeded",
"message": "Requests rate-limited because usage has reached 200% of your monthly limit for this period."
}

Need Help?

Visit your Dashboard to monitor usage

View Pricing plans and upgrade options

Email us at support@aiphotodetect.com for general support

Contact support for Enterprise plan inquiries