API Documentation

Two endpoints, one Bearer token, JSON responses. Everything you need to detect AI-generated text and images from your own backend.

Getting started

  1. 1Create an account and verify your email address. Verification is what releases the 1,000 free credits — an unverified account has none.
  2. 2Copy your API key from the dashboard. It is created automatically with the account.
  3. 3Send your first request. The whole integration is one POST with a Bearer header.

Base URL

https://www.wasitaigenerated.com/api/v1

Authentication

Every request must carry your API key as a Bearer token. There is no other auth scheme and no unauthenticated tier.

Authorization: Bearer YOUR_API_KEY

Keep the key server-side. It spends your credit balance, so anything that ships it to a browser or a mobile bundle is a billing hole. Proxy the call through your own backend instead.

Credits & limits

Usage is metered in credits. Credits are deducted before the detection runs, and subscribers on the unlimited plan are not charged per call.

EndpointCost1,000 free credits buy
/detect/text1 credit per word~1,000 words
/detect/image300 credits per image3 images
25,000
credits — $5 one-time
200,000
credits — $29 one-time
Unlimited
$299/month, no per-call cost

One-time credits never expire. There is no fixed requests-per-second limit today — your effective limit is your credit balance — but batch work should still be run sequentially or with modest concurrency rather than in a burst. See pricing for the full plan list.

POST/api/v1/detect/text

Detect AI-generated text from ChatGPT, GPT-4, Claude, Gemini and other language models. Returns a document-level verdict plus a score for every sentence.

Request body

FieldTypeNotes
contentstringRequired. The text to analyse.
textstringAccepted as an alias for content.
modestringOptional. "depth" returns a real score for every sentence (for highlighting). Omit for a document-level score only.
modelstringOptional. Defaults to "tropa-2". Pass "tropa-1" to pin the previous generation while you recalibrate thresholds. Same credit cost.

Example request

curl -X POST https://www.wasitaigenerated.com/api/v1/detect/text \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Your text content here..."
  }'

Response

{
  "isAI": true,
  "confidence": 0.92,
  "score": 92.3,
  "verdict": "ai",
  "model": "tropa-2",
  "patterns": ["AI patterns detected"],
  "analysis": {
    "likelihood": "AI-generated",
    "reasoning": "Overall AI score: 92.3%"
  },
  "sentences": [
    {
      "text": "The sentence that was analyzed.",
      "isAI": true,
      "confidence": 0.95,
      "scores": { "ai": 0.95, "human": 0.05 }
    }
  ],
  "humanizedHint": "possibly_humanized",
  "inputAnomalies": { "homoglyph": 13, "zero_width": 0, "exotic_space": 0, "fullwidth": 0, "variation_selector": 0 },
  "subclassProbs": { "human": 0.0, "ai": 0.71, "ai_edited": 0.02, "humanized": 0.27 }
}
  • isAI — document-level verdict (score > 50).
  • confidence — 0 to 1, how strongly the verdict holds.
  • score — calibrated 0–100 probability that the text is AI-generated.
  • verdict — the score in bands: human (< 40), uncertain (40–70), likely_ai (70–90), ai (≥ 90). Route to a human reviewer on uncertain rather than auto-flagging.
  • model — the detection model that produced the result.
  • sentences[] — per-sentence verdict and ai/human scores, for highlighting in your own UI. Real per-sentence values require mode: "depth".
  • humanizedHint — only present, with the value possibly_humanized, when the model attributes the AI signal mostly to humanizer post-processing. Absence means nothing: the signal is precise but fires on only ~40% of humanized texts, so never display a "not humanized" state.
  • inputAnomalies — only present when the text contained hidden characters (Cyrillic homoglyphs, zero-width characters, exotic spaces) that are commonly used to evade detectors. They were stripped before analysis.
  • subclassProbs — class distribution (human / ai / ai_edited / humanized). Diagnostic detail; may be absent when the fallback model served the request.

Cost: 1 credit per word. See the text detection API guide for integration patterns and worked examples.

POST/api/v1/detect/image

Detect AI-generated and synthetically manipulated images. Where the file still carries C2PA content credentials, the result is cryptographically verified rather than estimated.

Request

Send the image as multipart/form-data with the field name file.

  • Supported formats: PNG, JPG, JPEG, GIF, WebP
  • Maximum size: 10MB per request

Example request

curl -X POST https://www.wasitaigenerated.com/api/v1/detect/image \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@/path/to/image.jpg"

Response

{
  "isAI": true,
  "confidence": 0.99,
  "verified": true,
  "c2pa": {
    "vendor": "OpenAI",
    "generator": "ChatGPT",
    "generatorVersion": null,
    "softwareAgent": null,
    "issuer": "OpenAI",
    "signedAt": "2024-08-06T21:53:37+00:00",
    "signatureValid": true,
    "trusted": false,
    "validationState": "Valid",
    "validationCodes": ["signingCredential.untrusted"],
    "sourceType": "trainedAlgorithmicMedia",
    "isAI": true,
    "actions": ["c2pa.created"],
    "ingredients": 0,
    "manifestCount": 1
  },
  "provenance": {
    "platform": null,
    "watermarks": [],
    "signals": [],
    "confidence": "none"
  },
  "patterns": ["ai_verified", "c2pa_signed", "synthetic_artifacts"],
  "analysis": {
    "likelihood": "high",
    "reasoning": "AI-generated imagery detected with 99.0% confidence. Verified AI-generated: content credentials signed by ChatGPT (OpenAI) on 2024-08-06."
  },
  "detailed": {
    "scores": { "ai": 99.0, "human": 1.0 },
    "model": "v1.1"
  }
}
  • verified — when true, the image carries a C2PA content credential whose signature verifies and which declares the asset AI-generated. That is certainty, not a score, and it forces isAI: true regardless of the pixel model. When false, the verdict comes from model analysis of the pixels.
  • c2pa — the parsed content credential, or null when the file carries none. issuer is the X.509 certificate issuer and the one field that cannot be spoofed; vendor and generator are mapped from it and the manifest (OpenAI / ChatGPT, Google, Microsoft, Adobe, Leica, …). signatureValid is the cryptographic check; trusted additionally requires the issuer to be on a C2PA trust list and is currently always false.sourceType is trainedAlgorithmicMedia for AI output and digitalCapture for a signed camera photo — a valid manifest with isAI: false is evidence the image is real.
  • provenance — platform and watermark heuristics (non-cryptographic), with its own confidence of high / medium / low / none.
  • patterns — tags: ai_verified, c2pa_signed (valid manifest, AI or not), c2pa_invalid (signature fails), c2pa_marker (markers without a readable manifest), high_ai_confidence, synthetic_artifacts, human_generated.
  • confidence — 0 to 1 from the detection model.
  • detailed.scores — AI vs human probability as percentages.

Cost: 300 credits per image. See the image detection API guide for moderation patterns and thresholds.

Errors

Failures return a JSON body with an error field, and often a human-readable message.

400 Bad Request
Missing content for text, or missing/unsupported/oversized file for image.
401 Unauthorized
The Authorization header is missing, malformed, or the key is invalid.
402 Payment Required
Not enough credits. The body includes required and available so you can surface the shortfall.
403 Forbidden
Your subscription is website-only. Upgrade to Unlimited API + Website for API access.
413 Payload Too Large
The text or image exceeded the upstream size limit. Chunk the text or downscale the image.
500 Internal Server Error
Something failed on our side. Retry with exponential backoff; contact support if it persists.

Example: out of credits

{
  "error": "Insufficient credits",
  "message": "You need 300 credits for image detection. You have 120 credits remaining.",
  "required": 300,
  "available": 120
}

Best practices

Call it asynchronously

Detection takes real time on large payloads. Queue the call and update the record when it returns rather than blocking a user-facing request on it. Set a generous client timeout — 60s for text, 120s for images.

Treat the score as evidence, not a verdict

Detection is probabilistic. Heavily edited AI text reads as human, and some human writing is genuinely formulaic. Route flagged items to a person, show them the sentence-level breakdown, and let them decide. Auto-punishing on a confidence number produces complaints you cannot defend.

Prefer original files

Screenshots and re-encoded images lose signal, and screenshotting strips content credentials entirely — which is why an obviously synthetic screenshot can come back with verified: false. Send the original upload where you have it.

Chunk long documents

A very long body returns 413. Split it into sections of a few thousand words and aggregate. Longer text is more reliable than a couple of sentences — very short inputs simply do not carry enough signal.

Handle 402 explicitly

Credits are deducted per call, so a busy integration can run dry mid-batch. Catch 402, stop the batch, and alert someone — the response tells you exactly how short you were.

Support

Questions about integration, volume pricing, an SLA, or an endpoint you need that does not exist yet — write to us. Feature requests from real integrations get priority.