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.
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 }'{ "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.
textstringrequiredThe text to score. 10 to 100,000 characters, and subject to the same words-per-request limit as humanize.
languagestringThe language of
text, by its English name, such asSpanish. Detected from the text if omitted. Non-English text is translated to English before it is scored.and 40 moreinclude_sentencesbooleanAlso returns a score for each sentence. Default: false.
Response#
A 200 response indicates that the text was scored and the words were charged.
scanIdstring | nullIdentifier of this scan.
versionstring | nullVersion of the detection model.
versionIDstring | nullBuild of the detection model.
ai_probabilitynumber | nullThe probability that the text is AI-generated, from 0 to 1, where 1 indicates AI-generated text.
This scale is the inverse of
scoreson /v1/humanize, where a higher value indicates more human-like text.predicted_classstring | nullThe overall classification:
ai,humanormixed.class_probabilitiesobjectThe 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_metaobjectThe length of the scored text.
doc_length.charsinteger | null- Characters scored.
doc_length.tokensinteger | null- Tokens scored.
languagestringThe 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,
sentencesandrequest_metadescribe 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_unavailableresponse is not charged. Wait for the number of seconds given inRetry-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"}