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

  1. Generate API keys in your dashboard
  2. Use the Test key (fsec_test_...) to integrate — returns mock data, no tokens charged
  3. Subscribe to a plan to get Live tokens
  4. Switch to the Live key (fsec_live_...) for real analysis

Available Endpoints

MethodEndpointDescription
POST/api/v1/detectAnalyze a photo or video
GET/api/v1/usageGet current usage stats
GET/api/v1/keysGet 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

KeyPrefixBehavior
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.
Tip: Use your Test key during development. The response format is identical to Live — only the scores are mocked. Switch to Live when you're ready for production.

POST /api/v1/detect

Analyze a photo or video for AI-generated content.

Request

Content-Type: multipart/form-data

FieldTypeRequiredDescription
filebinaryYesImage 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

FieldTypeDescription
idstringUnique check ID
media_typestringphoto or video
ai_scorefloatFinal AI probability (0.0 — 1.0)
verdictstringAI, Uncertain, or Real
confidenceintConfidence percentage (0 — 100)
breakdownobjectIndividual scores per analyzer. -1 = skipped/unavailable
tokens_usedintTokens charged (1 photo, 3 video)
tokens_remainingintRemaining tokens in billing period

Verdicts

VerdictScore RangeMeaning
AI≥ 0.55Likely AI-generated
Uncertain0.35 — 0.55Inconclusive
Real< 0.35Likely 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

PlanTokens/moRate LimitPrice
Starter1,00060 req/min$29/mo
Pro5,000150 req/min$99/mo
Business25,000300 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

HTTPCodeDescription
400invalid_requestExpected multipart/form-data
400no_fileNo file field in request
400invalid_fileCorrupted or unsupported file
401invalid_api_keyAPI key is invalid or missing
403account_blockedAccount has been suspended
413file_too_largeFile exceeds size limit
429rate_limitToo many requests
429token_limitInsufficient API tokens
500analysis_failedInternal analysis error

Rate Limits

Rate limits are applied per API key using a 60-second sliding window.

Limits by Plan

Key TypeLimit
Test key30 req/min
Starter60 req/min
Pro150 req/min
Business300 req/min

Response Headers

Every API response includes rate limit headers:

HeaderDescription
X-RateLimit-LimitMax requests per minute
X-RateLimit-RemainingRemaining requests in window
X-RateLimit-ResetUnix timestamp when window resets
429 Too Many Requests: Wait until the 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"