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 |
|---|---|---|---|
| content | string or URL | Yes | Text content (string) or URL to image/audio/video file |
| type | enum | Yes | "text" | "image" | "audio" | "video" |
| model_attribution | boolean | No | Include per-model probability breakdown. Default: true |
| signals | boolean | No | Include detection signal labels. Default: true |
| threshold | float | No | Custom 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:
| Plan | Requests/minute | Requests/day | Burst |
|---|---|---|---|
| Starter | 100 | 10,000 | 200 for 10s |
| Professional | 1,000 | 100,000 | 2,000 for 10s |
| Enterprise | Custom | Unlimited | Custom |
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
| Code | Error | Description |
|---|---|---|
| 400 | invalid_request | Missing or malformed request parameters |
| 401 | unauthorized | Invalid or missing API key |
| 403 | forbidden | Plan does not support this endpoint |
| 413 | content_too_large | Content exceeds maximum size limit |
| 422 | unprocessable | Content could not be analyzed (too short, unsupported format) |
| 429 | rate_limited | Rate limit exceeded — see Retry-After header |
| 503 | service_unavailable | Detection service temporarily unavailable |