Detect AI in text
Analyzes a text and returns the result in the same request, usually within 1 to 5 seconds. The first request after a quiet period can take longer while capacity starts up, so set your HTTP timeout to at least 120 seconds.
Headers
AuthorizationstringrequiredBearer lk_live_…, your API key.
Content-Typestringrequiredapplication/json
Body
textstringrequiredThe text to analyze, from 30 to 15,000 words.
sentencesbooleanScore every sentence. Defaults to true. With false the response is faster and has document and paragraph scores only.
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.