API Documentation

Reference for the AI Image Detector API: base URL, authentication, the detect endpoint, request parameters, response fields, error codes, and rate limits.

Last updated: 2026-07-16

The AI Image Detector API exposes a single endpoint that reports whether an image is AI-generated. It returns a verdict, a probability score, a confidence level, and an optional per-generator breakdown.

Base URL

All endpoints are served over HTTPS and versioned with a /v1 path prefix.

https://imagedetector.online/v1

Authentication

All requests require a paid account and an API key created in Settings → API Keys. Free accounts and unauthenticated guests cannot create API keys or call /v1 endpoints. Pass the key as a Bearer token in the Authorization header:

Authorization: Bearer sk_your_api_key
HeaderRequiredDescription
Authorizationyes*Bearer sk_your_api_key
x-api-keyyes*sk_your_api_key — alternative to the Authorization header

*Provide one of the two. Keys are shown only once at creation — store yours securely. A missing or invalid key returns 401 unauthorized.

Detect an image

POST /v1/image/detect

Send either a multipart file upload or a JSON body containing a public image URL.

Request parameters

ParameterInTypeRequiredDescription
imagemultipart/form-datafileyes*Image file to analyze (JPG, PNG, or WebP, up to 8 MB)
imageUrlapplication/jsonstringyes*Publicly reachable HTTP/HTTPS URL of the image

*Provide exactly one of image or imageUrl per request.

Example — file upload

curl -X POST https://imagedetector.online/v1/image/detect \
  -H "Authorization: Bearer sk_your_api_key" \
  -F "image=@/path/to/photo.jpg"
import requests

resp = requests.post(
    "https://imagedetector.online/v1/image/detect",
    headers={"Authorization": "Bearer sk_your_api_key"},
    files={"image": open("/path/to/photo.jpg", "rb")},
)
print(resp.json())
const form = new FormData();
form.append('image', fs.createReadStream('/path/to/photo.jpg'));

const resp = await fetch('https://imagedetector.online/v1/image/detect', {
  method: 'POST',
  headers: { Authorization: 'Bearer sk_your_api_key' },
  body: form,
});
const data = await resp.json();

Example — image URL

curl -X POST https://imagedetector.online/v1/image/detect \
  -H "Authorization: Bearer sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"imageUrl": "https://example.com/photo.jpg"}'

Input constraints

ConstraintValue
FormatsJPG, PNG, WebP
Max size8 MB
URL accessMust be publicly reachable over HTTP/HTTPS

Response

A successful request returns 200 OK with a JSON body.

{
  "verdict": "likely_ai",
  "ai_score": 0.87,
  "confidence": "high",
  "source_breakdown": []
}
FieldTypeDescription
verdictstringlikely_ai, likely_human, or uncertain
ai_scorenumberProbability the image is AI-generated, from 0 to 1
confidencestringlow, medium, or high
source_breakdownarrayReserved for future per-generator scores; currently always []

Each successful detection costs 1 credit, drawn from the same balance as the web tool.

Errors

Errors return a JSON body with a machine-readable error code, a human-readable message, and a standard HTTP status.

{ "error": "insufficient_credits", "message": "Insufficient credits" }
StatuserrorMeaning
400bad_requestMissing or invalid image, URL, or format
401unauthorizedMissing or invalid API key
402insufficient_creditsOut of credits — upgrade your plan
403paid_plan_requiredAPI access requires a paid plan
429too_many_requestsRate limit exceeded — retry after backoff
503unavailableDetection provider not configured
500detection_failedUnexpected provider error

Rate limits

Requests are rate limited per API key to a maximum of 1 request per second. Exceeding this returns 429 too_many_requests with a Retry-After header (in seconds) indicating how long to wait before retrying.

HTTP/1.1 429 Too Many Requests
Retry-After: 1

Implement exponential backoff on 429 responses. Need higher throughput? See pricing or contact us about Enterprise limits.