Skip to content
AI Detector

Detect Natural Language

POST https://api.copyleaks.com/v2/writer-detector/{scanId}/check

Use Copyleaks AI Content Detection to differentiate between human-written and AI-written text.

This endpoint will receive submitted text to be checked. At the end of the processing stage, the result will be shown as classifications. Text classification is divided into sections. Each section may have a different classification.

scanId string Required

A unique scan id provided by you. We recommend you use the same id in your database to represent the scan in the Copyleaks database. This will help you to debug incidents. Using the same ID for the same file will help you to avoid network problems that may lead to multiple scans for the same file. learn more about the criteria for creating a Scan ID.

>= 3 characters <= 36 characters

Match pattern: [a-z0-9] !@$^&-+%=_(){}<>';:/.",~|

Content-Type: application/json
Authorization: Bearer YOUR_LOGIN_TOKEN

The request body is a JSON object containing the text to scan.

text string Required

A text string.

>= 255 characters <= 25000 characters

sandbox boolean default: "false"

Use sandbox mode to test your integration with the Copyleaks API for free.

language string

The language code of your content. The selected language should be on the Supported Languages list below. If the ‘language’ field is not supplied, our system will automatically detect the language of the content.

LanguageCode
English"en"
Spanish"es"
French"fr"
Portuguese"pt"
German"de"
Italian"it"
Russian"ru"
Polish"pl"
Romanian"ro"
Dutch"nl"
Swedish"sv"
Czech"cs"
Norwegian"no"
Korean"ko"
Japanese"ja"
Chinese (Simplified)"zh-CN"
Chinese (Traditional)"zh-TW"
Arabic"ar"
Bengali"bn"
Bulgarian"bg"
Croatian"hr"
Greek"el"
Hebrew"he"
Hindi"hi"
Hungarian"hu"
Serbian"sr"
Thai"th"
Turkish"tr"
Ukrainian"uk"
Vietnamese"vi"

Example: "en"

explain boolean default: "false" Beta

Enable AI Logic feature for AI detection. Example:

{
"text": "Your text here",
"explain": true
}

For further information, please check the AI Logic for a detailed breakdown of its structure and usage, and for full AI Detection response please check the AI Detection Response.

sensitivity integer default: "2"

Control the behavior of the AI detection.

  • Detecting content copied directly from an LLM, like ChatGPT or Gemini, without edits.
  • Detecting content from an LLM with minor changes, like tense adjustments or added words.
  • Detecting content from an LLM that has been heavily modified using tools or manual edits.

>= 1 <= 3

200 OK

The command was executed.

Response Schema

The response contains the following fields:

modelVersion string
The version of the AI detection model used (e.g., "v5").
results array
An array of classification results for different sections of the text.
classification integer
Classification result: 1 = Human, 2 = AI.
probability number
Confidence score for the classification (0-1).
matches array
Text segments that contributed to this classification with character and word positions.
summary object
Overall classification summary.
human number
Percentage of text classified as human-written (0-1).
ai number
Percentage of text classified as AI-generated (0-1).
scannedDocument object
Metadata about the scan.
scanId string
The unique identifier for this scan.
totalWords integer
Total number of words analyzed.
totalExcluded integer
Number of words excluded from analysis.
actualCredits integer
Credits actually consumed for this scan.
expectedCredits integer
Expected credits for this scan.
creationTime string
ISO 8601 timestamp when the scan was created.
explain object
AI Logic explanation data (only when explain=true).
patterns object
Detailed analysis patterns and statistics for AI detection reasoning.
statistics object
Statistical data including AI and human counts.
text object
Text position data for character and word analysis.

Example Response

A typical response from this endpoint:

Show full example (115 lines)
{
"modelVersion": "v5",
"results": [
{
"classification": 2,
"probability": 1,
"matches": [
{
"text": {
"chars": {
"starts": [
0
],
"lengths": [
1509
// ... truncated
400 Bad Request

Bad request.

POST https://api.copyleaks.com/v2/writer-detector/my-scan-123/check
Content-Type: application/json
Authorization: Bearer YOUR_LOGIN_TOKEN
{
"text": "Copyleaks is a comprehensive plagiarism detection platform that performs extensive searches across 60 trillion websites, 15,000+ academic journals, 20+ code data repositories, and 1M+ internal documents. Using AI-powered text analysis, easily scan documents, raw text, code, and URLs and instantly receive detailed reporting on the findings.",
"sandbox": false,
"explain": true,
"sensitivity": 2
}