Detect AI text

POSThttps://api.writehuman.ai/v1/detect

Scores text for AI authorship using the WriteHuman detector, for the document as a whole and optionally for each sentence. Requests are charged by the number of words submitted, as with humanize.

POST/v1/detect
curl https://api.writehuman.ai/v1/detect \  -H "Authorization: Bearer $WRITEHUMAN_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "text": "Artificial intelligence has rapidly transformed modern business. Many teams now depend on it every single day.",    "include_sentences": true  }'
200
{  "scanId": "20260609OMIOISUZ",  "version": "txtdetect-2026-05-14",  "versionID": "V1.1.1",  "ai_probability": 0.94,  "predicted_class": "ai",  "class_probabilities": { "ai": 0.94, "human": 0.04, "mixed": 0.02 },  "request_meta": { "doc_length": { "chars": 110, "tokens": 19 } },  "language": "English",  "sentences": [    { "text": "Artificial intelligence has rapidly transformed modern business.", "ai_prob": 0.97 },    { "text": "Many teams now depend on it every single day.", "ai_prob": 0.61 }  ]}

ai_probability ranges from 0 to 1, where 1 indicates AI-generated text. The scores returned by /v1/humanize use the inverse scale, where a higher value indicates more human-like text.

Request body#

A JSON object. Only text is required.

textstringrequired

The text to score. 10 to 100,000 characters, and subject to the same words-per-request limit as humanize.

languagestring

The language of text, by its English name, such as Spanish. Detected from the text if omitted. Non-English text is translated to English before it is scored.

and 40 more
include_sentencesboolean

Also returns a score for each sentence. Default: false.

Response#

A 200 response indicates that the text was scored and the words were charged.

scanIdstring | null

Identifier of this scan.

versionstring | null

Version of the detection model.

versionIDstring | null

Build of the detection model.

ai_probabilitynumber | null

The probability that the text is AI-generated, from 0 to 1, where 1 indicates AI-generated text.

This scale is the inverse of scores on /v1/humanize, where a higher value indicates more human-like text.

predicted_classstring | null

The overall classification: ai, human or mixed.

class_probabilitiesobject

The probability of each classification.

ainumber | null
The probability that the text is AI-generated.
humannumber | null
The probability that the text is human-written.
mixednumber | null
The probability that the text is a mix of both.
request_metaobject

The length of the scored text.

doc_length.charsinteger | null
Characters scored.
doc_length.tokensinteger | null
Tokens scored.
languagestring

The language specified in the request, or the detected language.

sentencesobject[]

Present only when the request set include_sentences: true. One entry per sentence, in order.

textstring | null
The sentence.
ai_probnumber | null
The probability that the sentence is AI-generated, from 0 to 1.

Behavior#

  • Shared limits. Detect requests count toward the same words-per-request limit and requests-per-minute limit as humanize requests. See Plans and limits.
  • Other languages. Non-English text is translated to English, and the translation is scored. The charge is based on the words submitted. In this case, sentences and request_meta describe the English translation, not the original text.
  • No content moderation. Detect is a read-only operation, so content that humanize would block can still be scored.
  • Humanize results are already scored. On Premium plans, each humanize result includes a score from the same detector. A separate detect request on that result is charged and returns equivalent information.
  • Detector unavailable. A 503 detector_unavailable response is not charged. Wait for the number of seconds given in Retry-After, then retry the request.

Errors#

The Errors page describes each code and indicates which errors can be retried.

401Missing or invalid API key.Show examples

Invalid API key

{  "error": "Invalid API key",  "code": "invalid_api_key"}

Missing Authorization header

{  "error": "Missing or invalid Authorization header",  "code": "missing_api_key"}
402No active subscription or insufficient word balance.Show examples

No active subscription

{  "error": "No active subscription",  "code": "no_subscription"}

Insufficient word balance

{  "error": "Insufficient word balance",  "code": "insufficient_balance",  "words_remaining": {    "included": 12,    "topup": 0,    "total": 12  }}
403The account owner must re-verify the account by email. No words are charged.Show example
{  "error": "This account must be re-verified by email. The account owner should sign in at writehuman.ai to continue.",  "code": "reverify_required"}
422Invalid input or over the per-request word limit.Show examples

Invalid request body

{  "error": "Invalid request: ...",  "code": "invalid_request"}

Over word limit

{  "error": "Input exceeds per-request limit of 2000 words for your plan. Received ~2500 words.",  "code": "word_limit"}
429Rate limit or too many failed auth attempts.Show examples

Rate limited

{  "error": "Rate limit exceeded for your plan (api_standard -> 40/min). api_standard: 40/min | api_premium: 120/min | api_premium 800K+: 160/min",  "code": "rate_limited"}

Too many failed auth attempts

{  "error": "Too many failed authentication attempts",  "code": "auth_locked_out"}
500Billing update failure after a successful scan. Some of the request's words (included and/or top-up) may already have been charged before the write failed.Show example
{  "error": "Billing update failed",  "code": "billing_failed"}
503Detector unavailable or at capacity, translation failed, or billing temporarily unavailable. No words charged.Show examples

Detector unavailable, at capacity, or translation failed

{  "error": "Detection service unavailable. Please retry.",  "code": "detector_unavailable"}

Billing temporarily unavailable

{  "error": "Service temporarily unavailable, please retry shortly.",  "code": "billing_unavailable"}