Detect AI in files
The same endpoint takes a PDF, DOCX, TXT or Markdown file instead of a text. Send it base64-encoded in JSON; the response is the same as for a text.
Body
filestringrequiredThe file, base64-encoded. Up to 15 MB.
filenamestringrequiredThe file name with its extension, for example essay.docx. The extension picks the parser.
sentencesbooleanScore every sentence. Defaults to true.
Billing
You are billed the words the file actually has, counted once it has been read. If those words would take you past your free words without a card, or past your monthly limit, you get a 402 instead of a result and nothing is billed.
Response
predicted_classstringhuman, ai or inconclusive. The result to show your users. See Reading the result.
scorenumberScore of the whole document, from 0 (human) to 100 (AI).
ai_fractionnumberShare of the text that reads as AI, from 0 to 1: 1 for an AI document, 0 for a human one, the share of the highlighted passage otherwise.
confidencestringhigh, medium or low. Low for short texts, scores near the middle, languages without full support, and documents whose paragraphs disagree with the overall score.
messagestringA one-line summary you can show as is.
languagestringDetected language, ISO 639-1.
language_supportedbooleanfalse when the language is not calibrated: you still get a score, with low confidence.
wordsintegerWords analyzed. In Chinese and Japanese two characters count as one word.
paragraphs[]arrayEach paragraph with index, start and end (character offsets in your text), words and score.
sentences[]arrayEach sentence with index, paragraph, start, end, text, score, label (ai from 70, uncertain from 35, otherwise human) and highlight. Empty when sentences is false.
model_versionstringThe model that produced the result. Store it with the result if you need to audit it later.
usageobjectwords_charged for this request and words_this_period, your total this month.