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
| Header | Required | Description |
|---|---|---|
Authorization | yes* | Bearer sk_your_api_key |
x-api-key | yes* | 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
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
image | multipart/form-data | file | yes* | Image file to analyze (JPG, PNG, or WebP, up to 8 MB) |
imageUrl | application/json | string | yes* | 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
| Constraint | Value |
|---|---|
| Formats | JPG, PNG, WebP |
| Max size | 8 MB |
| URL access | Must 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": []
}
| Field | Type | Description |
|---|---|---|
verdict | string | likely_ai, likely_human, or uncertain |
ai_score | number | Probability the image is AI-generated, from 0 to 1 |
confidence | string | low, medium, or high |
source_breakdown | array | Reserved 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" }
| Status | error | Meaning |
|---|---|---|
400 | bad_request | Missing or invalid image, URL, or format |
401 | unauthorized | Missing or invalid API key |
402 | insufficient_credits | Out of credits — upgrade your plan |
403 | paid_plan_required | API access requires a paid plan |
429 | too_many_requests | Rate limit exceeded — retry after backoff |
503 | unavailable | Detection provider not configured |
500 | detection_failed | Unexpected 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.