Getting Started
The FakeSec API lets you detect AI-generated photos and videos programmatically. It uses 12 forensic analysis methods and 3 neural networks to produce a confidence score.
Base URL
https://fakesec.com/api/v1
Quick Start
- Generate API keys in your dashboard
- Use the Test key (
fsec_test_...) to integrate — returns mock data, no tokens charged - Subscribe to a plan to get Live tokens
- Switch to the Live key (
fsec_live_...) for real analysis
Available Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/detect | Analyze a photo or video |
| GET | /api/v1/usage | Get current usage stats |
| GET | /api/v1/keys | Get masked API keys |
Supported Formats
Photos
JPEG, PNG, WebP — max 15 MB
Cost: 1 token per photo
Videos
MP4, WebM, MOV, MKV — max 50 MB
Cost: 3 tokens per video
Authentication
All API requests require a Bearer token in the Authorization header.
Header Format
Authorization: Bearer fsec_live_your_api_key_here
Key Types
| Key | Prefix | Behavior |
|---|---|---|
| Live | fsec_live_ |
Real analysis. Deducts tokens. Requires an active plan. |
| Test | fsec_test_ |
Returns mock data. No tokens charged. Free for all users. Rate limited to 30 req/min. |
POST /api/v1/detect
Analyze a photo or video for AI-generated content.
Request
Content-Type: multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
file | binary | Yes | Image or video file |
Response — Success
{
"success": true,
"data": {
"id": "42",
"media_type": "photo",
"ai_score": 0.85,
"verdict": "AI",
"confidence": 85,
"breakdown": {
"ai_model_1": 0.92,
"ai_model_2": 0.88,
"ai_model_3": 0.79,
"fft": 0.65,
"noise": 0.71,
"pixel": 0.58,
"exif": -1,
"ela": 0.73,
"texture": 0.62,
"color": 0.45,
"benford": 0.38,
"edge": 0.55
},
"tokens_used": 1,
"tokens_remaining": 4999
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique check ID |
media_type | string | photo or video |
ai_score | float | Final AI probability (0.0 — 1.0) |
verdict | string | AI, Uncertain, or Real |
confidence | int | Confidence percentage (0 — 100) |
breakdown | object | Individual scores per analyzer. -1 = skipped/unavailable |
tokens_used | int | Tokens charged (1 photo, 3 video) |
tokens_remaining | int | Remaining tokens in billing period |
Verdicts
| Verdict | Score Range | Meaning |
|---|---|---|
| AI | ≥ 0.55 | Likely AI-generated |
| Uncertain | 0.35 — 0.55 | Inconclusive |
| Real | < 0.35 | Likely authentic |
Test Key Response
When using a test key, the response includes "test": true and returns fixed mock scores. No tokens are charged.
{
"success": true,
"test": true,
"data": {
"id": "test_a1b2c3d4e5f6",
"media_type": "photo",
"ai_score": 0.72,
"verdict": "AI",
"confidence": 72,
"breakdown": { ... },
"tokens_used": 0,
"tokens_remaining": 5000
}
}
GET /api/v1/usage
Get your current API plan and token usage.
Response
{
"success": true,
"data": {
"plan": "pro",
"tokens_limit": 5000,
"tokens_used": 1234,
"tokens_remaining": 3766,
"rate_limit": 150,
"billing_reset": "2026-03-22T00:00:00"
}
}
Plans
| Plan | Tokens/mo | Rate Limit | Price |
|---|---|---|---|
| Starter | 1,000 | 60 req/min | $29/mo |
| Pro | 5,000 | 150 req/min | $99/mo |
| Business | 25,000 | 300 req/min | $249/mo |
Errors
All errors return a consistent JSON format.
Error Format
{
"success": false,
"error": {
"code": "invalid_api_key",
"message": "Invalid API key"
}
}
Error Codes
| HTTP | Code | Description |
|---|---|---|
| 400 | invalid_request | Expected multipart/form-data |
| 400 | no_file | No file field in request |
| 400 | invalid_file | Corrupted or unsupported file |
| 401 | invalid_api_key | API key is invalid or missing |
| 403 | account_blocked | Account has been suspended |
| 413 | file_too_large | File exceeds size limit |
| 429 | rate_limit | Too many requests |
| 429 | token_limit | Insufficient API tokens |
| 500 | analysis_failed | Internal analysis error |
Rate Limits
Rate limits are applied per API key using a 60-second sliding window.
Limits by Plan
| Key Type | Limit |
|---|---|
| Test key | 30 req/min |
| Starter | 60 req/min |
| Pro | 150 req/min |
| Business | 300 req/min |
Response Headers
Every API response includes rate limit headers:
| Header | Description |
|---|---|
X-RateLimit-Limit | Max requests per minute |
X-RateLimit-Remaining | Remaining requests in window |
X-RateLimit-Reset | Unix timestamp when window resets |
X-RateLimit-Reset timestamp before retrying. The window is 60 seconds.
Code Examples
Copy-paste examples to get started quickly.
cURL
curl -X POST https://fakesec.com/api/v1/detect \ -H "Authorization: Bearer fsec_test_your_key_here" \ -F "[email protected]"
Python
import requests
API_KEY = "fsec_test_your_key_here"
resp = requests.post(
"https://fakesec.com/api/v1/detect",
headers={"Authorization": f"Bearer {API_KEY}"},
files={"file": open("photo.jpg", "rb")},
)
data = resp.json()
if data["success"]:
result = data["data"]
print(f"Verdict: {result['verdict']}")
print(f"AI Score: {result['ai_score']}")
print(f"Confidence: {result['confidence']}%")
else:
print(f"Error: {data['error']['message']}")
Node.js
const fs = require('fs');
const FormData = require('form-data');
const API_KEY = 'fsec_test_your_key_here';
const form = new FormData();
form.append('file', fs.createReadStream('photo.jpg'));
const resp = await fetch('https://fakesec.com/api/v1/detect', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
},
body: form,
});
const data = await resp.json();
if (data.success) {
console.log('Verdict:', data.data.verdict);
console.log('AI Score:', data.data.ai_score);
console.log('Confidence:', data.data.confidence + '%');
} else {
console.error('Error:', data.error.message);
}
Check Usage
curl https://fakesec.com/api/v1/usage \ -H "Authorization: Bearer fsec_live_your_key_here"