Logo
APIDocumentation

API Reference

Base URL: https://api.aidetector.cx/v1

Introduction#

The AIDetector.cx REST API lets you integrate AI content detection directly into your application. Send text over HTTPS and receive a structured JSON response with AI probability scores, sentence-level analysis, model fingerprinting, and confidence metrics.

All endpoints use HTTPS. Request and response bodies are JSON. The base URL for all v1 endpoints is https://api.aidetector.cx/v1.

Documentation Preview. API endpoints are shown here as technical reference. Endpoints marked

Documentation Preview
are part of the planned API surface. Active Pro endpoints are available from your dashboard.

Quick Start#

Make your first detection call in under 5 minutes:

  1. Sign up or log in at aidetector.cx/signup
  2. Go to your API Dashboard and generate a key
  3. Replace YOUR_API_KEY in the examples below and send your first request

cURL

bash
Documentation Preview
curl -X POST https://api.aidetector.cx/v1/detect \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Your content to analyze here...",
    "include_sentences": true
  }'

JavaScript

javascript
Documentation Preview
const response = await fetch('https://api.aidetector.cx/v1/detect', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    text: 'Your content to analyze here...',
    include_sentences: true,
  }),
});

const data = await response.json();
console.log(data.data.ai_probability); // e.g. 0.92

Python

python
Documentation Preview
import requests

response = requests.post(
    'https://api.aidetector.cx/v1/detect',
    headers={
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json',
    },
    json={
        'text': 'Your content to analyze here...',
        'include_sentences': True,
    }
)

data = response.json()
print(data['data']['ai_probability'])  # e.g. 0.92

Authentication#

All requests must include your API key in the Authorization header as a Bearer token:

http
Authorization: Bearer YOUR_API_KEY

Requests without a valid key return 401 Unauthorized. Keys are tied to your account and plan quota. Never expose API keys in client-side code — always route through a backend or serverless function.

Generate API Key#

API keys are managed from your API Dashboard. You can create multiple named keys per integration, copy them once at creation, and revoke any key at any time.

API access requires an active Business or Enterprise plan. Requests draw from the account's shared monthly credit pool.

Open API Dashboard

POST /v1/detect#

Analyzes a single text for AI generation. Returns probability scores, model fingerprint, and optional sentence-level breakdown.

PropertyValue
MethodPOST
URLhttps://api.aidetector.cx/v1/detect
Content-Typeapplication/json
AuthBearer token (required)

Request Body#

FieldTypeRequiredDescription
textstring
Yes
The text content to analyze. Min 50 words.
include_sentencesboolean
No
Return per-sentence scores. Default: false.
languagestring
No
ISO 639-1 code. Default: auto-detected.

Response Schema#

Successful responses return HTTP 200 with the following structure:

json
{
  "success": true,
  "data": {
    "ai_probability": 0.92,
    "human_probability": 0.08,
    "confidence_score": 0.95,
    "detected_model": "ChatGPT",
    "sentence_analysis": [
      {
        "sentence": "Artificial intelligence has rapidly transformed...",
        "ai_probability": 0.89,
        "human_probability": 0.11
      }
    ]
  }
}
FieldTypeDescription
ai_probabilityfloatProbability the text is AI-generated. Range 0.0–1.0.
human_probabilityfloatComplement of ai_probability. Range 0.0–1.0.
confidence_scorefloatModel confidence in the prediction. Range 0.0–1.0.
detected_modelstringMost likely source AI model (e.g., "ChatGPT").
sentence_analysisarrayPer-sentence scores. Only present when include_sentences=true.

Sentence Analysis#

When include_sentences: true is set, the response includes a sentence_analysis array. Each element contains:

json
{
  "sentence": "The sentence text...",
  "ai_probability": 0.89,
  "human_probability": 0.11
}

POST /v1/batch#

Analyze up to 100 texts in a single request. Each item is processed independently. Available on Pro and Enterprise plans.

cURL

bash
Documentation Preview
curl -X POST https://api.aidetector.cx/v1/batch \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      { "id": "doc-1", "text": "First text to analyze..." },
      { "id": "doc-2", "text": "Second text to analyze..." }
    ]
  }'

JavaScript

javascript
Documentation Preview
const response = await fetch('https://api.aidetector.cx/v1/batch', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    items: [
      { id: 'doc-1', text: 'First text to analyze...' },
      { id: 'doc-2', text: 'Second text to analyze...' },
    ],
  }),
});

Error Codes#

Errors are returned as HTTP 4xx/5xx with a JSON body:

json
{
  "success": false,
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "You have exceeded your monthly request quota.",
    "retry_after": 86400
  }
}
HTTPCodeDescription
401UNAUTHORIZEDMissing or invalid API key.
403FORBIDDENYour plan does not have access to this endpoint.
422VALIDATION_ERRORRequest body failed validation (e.g., text too short).
429RATE_LIMIT_EXCEEDEDMonthly quota exhausted. Retry after reset.
500INTERNAL_ERRORServer-side error. Retry with exponential backoff.
503SERVICE_UNAVAILABLETemporary outage. Check status page.

Rate Limits#

Rate limit information is returned in response headers on every request:

http
X-RateLimit-Limit: 10000
X-RateLimit-Remaining: 9843
X-RateLimit-Reset: 1748736000
PlanRequests/MonthBatch SizeConcurrent
Free100—1
Pro10,0005010
EnterpriseCustom100Custom

Usage & Quotas#

Quotas reset on the first day of each calendar month (UTC). Each call to /v1/detect consumes one request regardless of text length. Batch requests consume one request per item in the array. Monitor your real-time usage in your API Dashboard.

SDKs#

Official SDKs are in active development. In the meantime, the REST API works directly from any HTTP client. Community libraries are available for Python, JavaScript, PHP, and Go — check our GitHub organisation once launched.

Python
Coming
JavaScript / TS
Coming
PHP
Coming
Ruby
Coming
Java
Coming
Go
Coming

FAQ#