AI Detector API Endpoint Reference

Complete reference for every endpoint in the AI Detector API. Includes request/response schemas, example payloads, error codes, and rate limit details. New to the API? Start with the quickstart guide.

Base URL: https://aidetectorapi.com
Authentication: All endpoints require a Bearer token in the Authorization header. Get your free API key.
POST

/v1/detect

Analyze a single text for AI-generated content. Returns an overall score, per-sentence breakdown, and a confidence rating.

Request Body

FieldTypeRequiredDescription
textstringYesThe text to analyze. 10 – 50,000 characters.
languagestringNoISO 639-1 code. Auto-detected if omitted.

Response

FieldTypeDescription
scorenumberOverall AI probability, 0 (human) to 1 (AI).
labelstring"ai-generated" | "human-written" | "mixed"
sentencesarrayPer-sentence objects with text and score.
confidencestring"low" | "medium" | "high"
words_analyzednumberTotal words processed.

Example

Request
curl -X POST https://aidetectorapi.com/v1/detect \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "The quick brown fox jumps over the lazy dog. This sentence was generated by an AI model to demonstrate detection capabilities.",
    "language": "en"
  }'
Response — 200 OK
{
  "score": 0.94,
  "label": "ai-generated",
  "sentences": [
    { "text": "The quick brown fox jumps over the lazy dog.", "score": 0.12 },
    { "text": "This sentence was generated by an AI model to demonstrate detection capabilities.", "score": 0.97 }
  ],
  "confidence": "high",
  "words_analyzed": 21
}
POST

/v1/batch

Analyze multiple texts in a single request. Ideal for bulk content moderation, document processing, and high-volume workflows.

Request Body

FieldTypeRequiredDescription
textsstring[]YesArray of texts to analyze. Maximum 100 items.
webhook_urlstringNoURL to receive results when processing completes.

Response

FieldTypeDescription
batch_idstringUnique identifier for the batch job.
statusstringAlways "processing" on creation.
countnumberNumber of texts queued for analysis.
Note: Results are delivered via the configured webhook URL. You can also poll for results using GET /v1/batch/{batch_id}.

Example

Request
curl -X POST https://aidetectorapi.com/v1/batch \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "texts": [
      "First document to analyze...",
      "Second document to analyze...",
      "Third document to analyze..."
    ],
    "webhook_url": "https://yourapp.com/webhooks/ai-detect"
  }'
Response — 202 Accepted
{
  "batch_id": "batch_abc123def456",
  "status": "processing",
  "count": 3
}
GET

/v1/usage

Get current billing period usage for your API key. Use this to monitor consumption and avoid hitting plan limits.

Response

FieldTypeDescription
planstringCurrent plan name (e.g. "free", "pro", "enterprise").
requests_usednumberRequests consumed in the current period.
requests_limitnumberMaximum requests allowed in the current period.
period_startstringISO 8601 timestamp for the billing period start.
period_endstringISO 8601 timestamp for the billing period end.

Example

Request
curl https://aidetectorapi.com/v1/usage \
  -H "Authorization: Bearer YOUR_API_KEY"
Response — 200 OK
{
  "plan": "pro",
  "requests_used": 12847,
  "requests_limit": 50000,
  "period_start": "2026-02-01T00:00:00Z",
  "period_end": "2026-03-01T00:00:00Z"
}

Webhooks

Configure a webhook URL to receive batch processing results automatically. When a batch job completes, we send a POST request to your webhook URL with the results payload.

Webhook Payload

Webhook POST body
{
  "event": "batch.completed",
  "batch_id": "batch_abc123def456",
  "results": [
    {
      "index": 0,
      "score": 0.94,
      "label": "ai-generated",
      "confidence": "high",
      "words_analyzed": 142
    },
    {
      "index": 1,
      "score": 0.07,
      "label": "human-written",
      "confidence": "high",
      "words_analyzed": 89
    }
  ],
  "completed_at": "2026-02-26T14:30:00Z"
}

Signature Verification

Every webhook request includes an X-Signature-SHA256 header containing an HMAC-SHA256 signature of the request body. Verify it using your API key as the secret to ensure the request is authentic.

verify_signature.py
import hmac
import hashlib

def verify_webhook(payload: bytes, signature: str, secret: str) -> bool:
    expected = hmac.new(
        secret.encode(),
        payload,
        hashlib.sha256
    ).hexdigest()
    return hmac.compare_digest(expected, signature)

Error Codes

The API uses standard HTTP status codes. All error responses include a JSON body with error and message fields.

StatusErrorDescription
400Bad RequestInvalid request body, missing required fields, or text outside allowed length.
401UnauthorizedMissing or invalid API key in the Authorization header.
403ForbiddenYour API key does not have permission for this resource or action.
404Not FoundThe requested endpoint or resource does not exist.
429Rate Limit ExceededToo many requests. Back off and retry after the Retry-After header value.
500Internal Server ErrorAn unexpected error occurred. Try again or contact support if the issue persists.
Error response example — 401
{
  "error": "unauthorized",
  "message": "Invalid or missing API key. Include a valid Bearer token in the Authorization header."
}

Rate Limits

Rate limits are applied per API key on a per-minute sliding window. When you exceed the limit, the API returns a 429 status with a Retry-After header.

PlanRate LimitMonthly Requests
Free10 requests / minute1,000
Pro100 requests / minute50,000
EnterpriseCustomUnlimited

Need higher limits? View pricing plans or contact sales for enterprise options.

Ready to get started?

Sign up for a free API key and make your first detection request in minutes.