Documentation · API Reference

API Documentation

Everything you need to integrate AI detection into your application. REST API with JSON responses, SDKs for Python, Node.js, and Go, plus WebSocket support for streaming detection.

Quick Start

Get your API key from the pricing page. All API requests must include your key in the Authorization header. Here is a minimal example to detect AI content in a piece of text:

curl -X POST https://api.aidetector.ac/v1/detect   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"content": "Your text here", "type": "text"}'

Response:

{
  "id": "det_01HN3X5ZX8KXZG4WKPF6M7KQ2",
  "type": "text",
  "ai_probability": 0.87,
  "verdict": "likely_ai",
  "confidence": "high",
  "model_attribution": {
    "gpt4o": 0.62,
    "claude": 0.18,
    "gemini": 0.07
  },
  "signals": ["low_perplexity", "uniform_burstiness", "formulaic_transitions"],
  "processing_time_ms": 380,
  "content_hash": "sha256:8f14e45f..."
}

Authentication

All requests require a Bearer token in the Authorization header:

Authorization: Bearer YOUR_API_KEY

API keys are scoped to your account and carry all permissions assigned to your plan. Keep keys secure — do not commit them to version control. Rotate compromised keys immediately from your dashboard.

Endpoints

POST /v1/detect

The primary detection endpoint. Supports text, image URL, audio URL, and video URL inputs. Returns AI probability, verdict, model attribution, and detection signals.

Parameter Type Required Description
contentstring or URLYesText content (string) or URL to image/audio/video file
typeenumYes"text" | "image" | "audio" | "video"
model_attributionbooleanNoInclude per-model probability breakdown. Default: true
signalsbooleanNoInclude detection signal labels. Default: true
thresholdfloatNoCustom decision threshold (0.0–1.0). Default: 0.5

POST /v1/detect/batch

Batch endpoint for processing up to 100 items per request. Available on Professional and Enterprise plans. Each item in the batch is processed independently.

{
  "items": [
    {"id": "item_1", "content": "First text to check", "type": "text"},
    {"id": "item_2", "content": "Second text to check", "type": "text"}
  ]
}

GET /v1/usage

Returns current period API usage statistics: calls made, calls remaining, reset timestamp, and per-key breakdown for multi-key accounts.

SDKs

Python

pip install aidetector-python

from aidetector import AIDetector

client = AIDetector(api_key="YOUR_API_KEY")

result = client.detect(
    content="Text to analyze",
    content_type="text"
)

print(f"AI probability: {result.ai_probability}")
print(f"Verdict: {result.verdict}")
print(f"Model attribution: {result.model_attribution}")

Node.js

npm install @aidetector/node

import AIDetector from '@aidetector/node';

const client = new AIDetector({ apiKey: 'YOUR_API_KEY' });

const result = await client.detect({
  content: 'Text to analyze',
  type: 'text',
});

console.log(result.aiProbability);
console.log(result.verdict);

Rate Limits

Rate limits apply per API key:

PlanRequests/minuteRequests/dayBurst
Starter10010,000200 for 10s
Professional1,000100,0002,000 for 10s
EnterpriseCustomUnlimitedCustom

Rate limit responses return HTTP 429 with a Retry-After header indicating seconds until your rate limit window resets. Implement exponential backoff starting at the value of Retry-After.

Webhooks

Configure webhooks from your dashboard to receive real-time notifications when content is flagged above your configured threshold. Webhook payloads are signed with HMAC-SHA256 using your webhook secret.

// Verify webhook signature (Node.js)
const crypto = require('crypto');
const sig = req.headers['x-aidetector-signature'];
const expected = crypto
  .createHmac('sha256', webhookSecret)
  .update(rawBody)
  .digest('hex');
const isValid = crypto.timingSafeEqual(
  Buffer.from(sig), Buffer.from(expected)
);

Error Codes

CodeErrorDescription
400invalid_requestMissing or malformed request parameters
401unauthorizedInvalid or missing API key
403forbiddenPlan does not support this endpoint
413content_too_largeContent exceeds maximum size limit
422unprocessableContent could not be analyzed (too short, unsupported format)
429rate_limitedRate limit exceeded — see Retry-After header
503service_unavailableDetection service temporarily unavailable