API Documentation
Integrate AI image detection into your applications with our simple REST API. Detect AI-generated images programmatically.
https://api.isitai.comQuick Start
Get started with the Is It AI? API in three steps.
Get your API key
Create an account and generate an API secret from your API Keys page. Then authenticate to get a bearer token.
Make a request
Send an image URL to the detection endpoint.
# Detect an image by URL
curl -X POST "https://api.isitai.com/detect-img?image_url=https://example.com/image.jpg" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "accept: application/json"
Get results
Receive a detailed AI detection verdict with confidence scores.
{
"predicted_label": "AI",
"probability": 0.92,
"potential_method": "midjourney",
"method_probability": 0.85,
"NSFW": "False",
"NSFW_probability": 0.02
}
Authentication
The API uses JWT bearer tokens. Authenticate with your email and API secret to get a token, then include it in the Authorization header of every request.
Step 1: Get your API secret
Your API secret is available on your API Keys page. This is different from your account password — it is used exclusively for API authentication.
Step 2: Request an access token
POST your email and API secret to the /login endpoint to receive a JWT access token.
curl -X POST https://api.isitai.com/login \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "[email protected]&password=YOUR_API_SECRET"
{
"access_token": "eyJhbGciOiJIUzI1NiIs..."
}
Step 3: Use the token
Include the token in the Authorization header as a Bearer token on all subsequent requests.
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
/login again. You can also revoke a token early using the /revoke-token endpoint.
Endpoint Reference
All endpoints use the base URL https://api.isitai.com.
Authenticate and receive a JWT access token.
Headers
| Header | Value |
|---|---|
Content-Type | application/x-www-form-urlencoded |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Your account email address |
password | string | Yes | Your API secret (from the API Keys page) |
Response
{
"access_token": "eyJhbGciOiJIUzI1NiIs..."
}
Analyze an image for AI-generated content. Supports two modes: image URL (query parameter) or file upload (multipart form).
Headers
| Header | Value |
|---|---|
Authorization | Bearer YOUR_ACCESS_TOKEN |
accept | application/json |
Option A: Image URL
| Parameter | In | Type | Description |
|---|---|---|---|
image_url | query | string | URL of the image to analyze |
curl -X POST "https://api.isitai.com/detect-img?image_url=https://example.com/photo.jpg" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "accept: application/json"
Option B: File Upload
| Parameter | In | Type | Description |
|---|---|---|---|
file | body (multipart) | file | Image file to analyze |
curl -X POST https://api.isitai.com/detect-img \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "accept: application/json" \
-F "file=@/path/to/image.jpg"
Response
{
"predicted_label": "AI",
"probability": 0.92,
"potential_method": "midjourney",
"method_probability": 0.85,
"NSFW": "False",
"NSFW_probability": 0.02
}
Retrieve your current API usage count for the billing period.
Headers
| Header | Value |
|---|---|
Authorization | Bearer YOUR_ACCESS_TOKEN |
curl https://api.isitai.com/consumption/ \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
{
"consumption": 142
}
Revoke your current access token. After revocation, you will need to authenticate again via /login.
Headers
| Header | Value |
|---|---|
Authorization | Bearer YOUR_ACCESS_TOKEN |
curl -X POST https://api.isitai.com/revoke-token \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
{
"message": "Token revoked successfully"
}
Response Fields
The detection endpoint (/detect-img) returns the following fields.
| Field | Type | Description |
|---|---|---|
predicted_label |
string | "AI" or "Human" — the detection verdict |
probability |
number | Confidence score from 0 to 1 (e.g. 0.92 = 92% confidence) |
potential_method |
string | Suspected AI generation method (e.g. "midjourney", "stable_diffusion", "dall-e"). Present when label is "AI". |
method_probability |
number | Confidence score for the generation method (0 to 1) |
NSFW |
string | "True" or "False" — whether the image contains NSFW content |
NSFW_probability |
number | Confidence score for the NSFW classification (0 to 1) |
Error Handling
The API uses standard HTTP status codes. Errors include a JSON body with a message.
| Status | Meaning | Common Cause |
|---|---|---|
200 | Success | Request completed successfully |
401 | Unauthorized | Missing, invalid, or expired token |
422 | Unprocessable Entity | Invalid image URL, unsupported format, or image too large |
429 | Too Many Requests | Rate limit exceeded — wait and retry |
500 | Internal Server Error | Unexpected error on our side — retry or contact support |
Error Response Format
{
"detail": "Invalid or expired token"
}
Supported Formats & Limits
Image Types
- JPEG / JPG
- PNG
- WebP
- GIF (first frame)
Limits
- Max file size: 5 MB
- Rate limiting applies per account
- Quota based on your subscription plan
Best Practices
- Use images at least 256×256 px for best accuracy
- Avoid heavily compressed or cropped images
- Re-authenticate when you receive a 401 response
Code Examples
Full authentication + detection flow in popular languages.
Detect by Image URL
# 1. Get access token
TOKEN=$(curl -s -X POST https://api.isitai.com/login \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "[email protected]&password=YOUR_API_SECRET" \
| jq -r '.access_token')
# 2. Detect image
curl -X POST "https://api.isitai.com/detect-img?image_url=https://example.com/photo.jpg" \
-H "Authorization: Bearer $TOKEN" \
-H "accept: application/json"
import requests
# 1. Authenticate
auth = requests.post("https://api.isitai.com/login", data={
"email": "[email protected]",
"password": "YOUR_API_SECRET"
})
token = auth.json()["access_token"]
# 2. Detect by URL
response = requests.post(
"https://api.isitai.com/detect-img",
params={"image_url": "https://example.com/photo.jpg"},
headers={
"Authorization": f"Bearer {token}",
"accept": "application/json"
}
)
result = response.json()
print(f"Verdict: {result['predicted_label']} ({result['probability']:.0%} confidence)")
// 1. Authenticate
const authRes = await fetch("https://api.isitai.com/login", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: "[email protected]&password=YOUR_API_SECRET"
});
const { access_token } = await authRes.json();
// 2. Detect by URL
const imageUrl = encodeURIComponent("https://example.com/photo.jpg");
const res = await fetch(
`https://api.isitai.com/detect-img?image_url=${imageUrl}`,
{
method: "POST",
headers: {
"Authorization": `Bearer ${access_token}`,
"accept": "application/json"
}
}
);
const result = await res.json();
console.log(`Verdict: ${result.predicted_label} (${(result.probability * 100).toFixed(0)}% confidence)`);
Detect by File Upload
curl -X POST https://api.isitai.com/detect-img \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "accept: application/json" \
-F "file=@/path/to/image.jpg"
import requests
token = "YOUR_ACCESS_TOKEN"
with open("image.jpg", "rb") as f:
response = requests.post(
"https://api.isitai.com/detect-img",
headers={
"Authorization": f"Bearer {token}",
"accept": "application/json"
},
files={"file": f}
)
print(response.json())
import { readFileSync } from "fs";
const token = "YOUR_ACCESS_TOKEN";
const formData = new FormData();
formData.append("file", new Blob([readFileSync("image.jpg")]), "image.jpg");
const res = await fetch("https://api.isitai.com/detect-img", {
method: "POST",
headers: {
"Authorization": `Bearer ${token}`,
"accept": "application/json"
},
body: formData
});
console.log(await res.json());
API Pricing
API access is included with all subscription plans. Choose the plan that fits your usage needs.
View Plans & PricingStart Building with Is It AI?
Get your API token and integrate AI detection into your applications today.