curl --request POST \
--url https://api.copyleaks.com/v2/writer-detector/my-scan-123/check \
--header 'Authorization: Bearer YOUR_LOGIN_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"text": "Copyleaks is a comprehensive plagiarism detection platform...",
"sandbox": false,
"explain": true,
"sensitivity": 2
}'
from copyleaks.copyleaks import Copyleaks
from copyleaks.models.submit.ai_detection_document import NaturalLanguageDocument
auth_token = Copyleaks.login("[email protected]", "YOUR_API_KEY")
submission = NaturalLanguageDocument("Copyleaks is a comprehensive plagiarism detection platform...")
submission.set_sandbox(False)
submission.set_explain(True)
submission.set_sensitivity(2)
response = Copyleaks.AiDetectionClient.submit_natural_language(auth_token, "my-scan-123", submission)
print(response.model_dump_json(by_alias=True, exclude_unset=True, indent=2))
const { Copyleaks, CopyleaksNaturalLanguageSubmissionModel } = require('copyleaks');
async function main() {
const copyleaks = new Copyleaks();
const auth = await copyleaks.loginAsync('YOUR_EMAIL', 'YOUR_API_KEY');
const submission = new CopyleaksNaturalLanguageSubmissionModel(
'Copyleaks is a comprehensive plagiarism detection platform...'
);
submission.sandbox = false;
submission.explain = true;
submission.sensitivity = 2;
const response = await copyleaks.aiDetectionClient.submitNaturalTextAsync(auth, 'my-scan-123', submission);
console.log(JSON.stringify(response, null, 2));
}
main();
import classes.Copyleaks;
import models.submissions.aidetection.CopyleaksNaturalLanguageSubmissionModel;
import models.response.CopyleaksAuthToken;
CopyleaksAuthToken authToken = Copyleaks.login("your@email", "API_KEY");
CopyleaksNaturalLanguageSubmissionModel sub = new CopyleaksNaturalLanguageSubmissionModel(
"Copyleaks is a comprehensive plagiarism detection platform..."
);
sub.setSandbox(false);
sub.setExplain(true);
sub.setSensitivity(2);
Copyleaks.aiDetectionClient.submitNaturalLanguage(authToken, "my-scan-123", sub);
{
"modelVersion": "v11.0",
"results": [
{
"classification": 2,
"probability": 1,
"matches": [
{
"text": {
"chars": { "starts": [0], "lengths": [1509] },
"words": { "starts": [0], "lengths": [221] }
}
}
]
}
],
"summary": { "human": 0, "ai": 1 },
"scannedDocument": {
"scanId": "my-scan-123",
"totalWords": 221,
"actualCredits": 1,
"expectedCredits": 1,
"creationTime": "2023-01-10T10:07:58.9459512Z"
},
"explain": {
"patterns": {
"statistics": {
"aiCount": [1.2066389, 9.673915, 34.41001],
"humanCount": [0.18481831, 0.13894142, 0.33555666],
"proportion": [6.5287843, 69.625854, 102.54607],
"source": [1, 1, 1]
},
"text": {
"chars": { "starts": [10, 96, 136], "lengths": [25, 33, 33] },
"words": { "starts": [1, 12, 17], "lengths": [4, 4, 5] }
}
}
}
}
AI Text Detection
AI Text Detection
Differentiate between human-written and AI-written text.
POST
/
v2
/
writer-detector
/
{scanId}
/
check
curl --request POST \
--url https://api.copyleaks.com/v2/writer-detector/my-scan-123/check \
--header 'Authorization: Bearer YOUR_LOGIN_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"text": "Copyleaks is a comprehensive plagiarism detection platform...",
"sandbox": false,
"explain": true,
"sensitivity": 2
}'
from copyleaks.copyleaks import Copyleaks
from copyleaks.models.submit.ai_detection_document import NaturalLanguageDocument
auth_token = Copyleaks.login("[email protected]", "YOUR_API_KEY")
submission = NaturalLanguageDocument("Copyleaks is a comprehensive plagiarism detection platform...")
submission.set_sandbox(False)
submission.set_explain(True)
submission.set_sensitivity(2)
response = Copyleaks.AiDetectionClient.submit_natural_language(auth_token, "my-scan-123", submission)
print(response.model_dump_json(by_alias=True, exclude_unset=True, indent=2))
const { Copyleaks, CopyleaksNaturalLanguageSubmissionModel } = require('copyleaks');
async function main() {
const copyleaks = new Copyleaks();
const auth = await copyleaks.loginAsync('YOUR_EMAIL', 'YOUR_API_KEY');
const submission = new CopyleaksNaturalLanguageSubmissionModel(
'Copyleaks is a comprehensive plagiarism detection platform...'
);
submission.sandbox = false;
submission.explain = true;
submission.sensitivity = 2;
const response = await copyleaks.aiDetectionClient.submitNaturalTextAsync(auth, 'my-scan-123', submission);
console.log(JSON.stringify(response, null, 2));
}
main();
import classes.Copyleaks;
import models.submissions.aidetection.CopyleaksNaturalLanguageSubmissionModel;
import models.response.CopyleaksAuthToken;
CopyleaksAuthToken authToken = Copyleaks.login("your@email", "API_KEY");
CopyleaksNaturalLanguageSubmissionModel sub = new CopyleaksNaturalLanguageSubmissionModel(
"Copyleaks is a comprehensive plagiarism detection platform..."
);
sub.setSandbox(false);
sub.setExplain(true);
sub.setSensitivity(2);
Copyleaks.aiDetectionClient.submitNaturalLanguage(authToken, "my-scan-123", sub);
{
"modelVersion": "v11.0",
"results": [
{
"classification": 2,
"probability": 1,
"matches": [
{
"text": {
"chars": { "starts": [0], "lengths": [1509] },
"words": { "starts": [0], "lengths": [221] }
}
}
]
}
],
"summary": { "human": 0, "ai": 1 },
"scannedDocument": {
"scanId": "my-scan-123",
"totalWords": 221,
"actualCredits": 1,
"expectedCredits": 1,
"creationTime": "2023-01-10T10:07:58.9459512Z"
},
"explain": {
"patterns": {
"statistics": {
"aiCount": [1.2066389, 9.673915, 34.41001],
"humanCount": [0.18481831, 0.13894142, 0.33555666],
"proportion": [6.5287843, 69.625854, 102.54607],
"source": [1, 1, 1]
},
"text": {
"chars": { "starts": [10, 96, 136], "lengths": [25, 33, 33] },
"words": { "starts": [1, 12, 17], "lengths": [4, 4, 5] }
}
}
}
}
curl --request POST \
--url https://api.copyleaks.com/v2/writer-detector/my-scan-123/check \
--header 'Authorization: Bearer YOUR_LOGIN_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"text": "Copyleaks is a comprehensive plagiarism detection platform...",
"sandbox": false,
"explain": true,
"sensitivity": 2
}'
from copyleaks.copyleaks import Copyleaks
from copyleaks.models.submit.ai_detection_document import NaturalLanguageDocument
auth_token = Copyleaks.login("[email protected]", "YOUR_API_KEY")
submission = NaturalLanguageDocument("Copyleaks is a comprehensive plagiarism detection platform...")
submission.set_sandbox(False)
submission.set_explain(True)
submission.set_sensitivity(2)
response = Copyleaks.AiDetectionClient.submit_natural_language(auth_token, "my-scan-123", submission)
print(response.model_dump_json(by_alias=True, exclude_unset=True, indent=2))
const { Copyleaks, CopyleaksNaturalLanguageSubmissionModel } = require('copyleaks');
async function main() {
const copyleaks = new Copyleaks();
const auth = await copyleaks.loginAsync('YOUR_EMAIL', 'YOUR_API_KEY');
const submission = new CopyleaksNaturalLanguageSubmissionModel(
'Copyleaks is a comprehensive plagiarism detection platform...'
);
submission.sandbox = false;
submission.explain = true;
submission.sensitivity = 2;
const response = await copyleaks.aiDetectionClient.submitNaturalTextAsync(auth, 'my-scan-123', submission);
console.log(JSON.stringify(response, null, 2));
}
main();
import classes.Copyleaks;
import models.submissions.aidetection.CopyleaksNaturalLanguageSubmissionModel;
import models.response.CopyleaksAuthToken;
CopyleaksAuthToken authToken = Copyleaks.login("your@email", "API_KEY");
CopyleaksNaturalLanguageSubmissionModel sub = new CopyleaksNaturalLanguageSubmissionModel(
"Copyleaks is a comprehensive plagiarism detection platform..."
);
sub.setSandbox(false);
sub.setExplain(true);
sub.setSensitivity(2);
Copyleaks.aiDetectionClient.submitNaturalLanguage(authToken, "my-scan-123", sub);
{
"modelVersion": "v11.0",
"results": [
{
"classification": 2,
"probability": 1,
"matches": [
{
"text": {
"chars": { "starts": [0], "lengths": [1509] },
"words": { "starts": [0], "lengths": [221] }
}
}
]
}
],
"summary": { "human": 0, "ai": 1 },
"scannedDocument": {
"scanId": "my-scan-123",
"totalWords": 221,
"actualCredits": 1,
"expectedCredits": 1,
"creationTime": "2023-01-10T10:07:58.9459512Z"
},
"explain": {
"patterns": {
"statistics": {
"aiCount": [1.2066389, 9.673915, 34.41001],
"humanCount": [0.18481831, 0.13894142, 0.33555666],
"proportion": [6.5287843, 69.625854, 102.54607],
"source": [1, 1, 1]
},
"text": {
"chars": { "starts": [10, 96, 136], "lengths": [25, 33, 33] },
"words": { "starts": [1, 12, 17], "lengths": [4, 4, 5] }
}
}
}
}
Request
Path Parameters
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. Learn more about the criteria for creating a Scan ID.
>= 3 characters <= 36 charactersHeaders
Content-Type: application/json
Authorization: Bearer YOUR_LOGIN_TOKEN
Request Body
string
required
A text string.
>= 255 characters <= 100000 charactersboolean
default:"false"
Use sandbox mode to test your integration with the Copyleaks API for free.
string
The language code of your content in ISO-639-1 format. See the full list of supported languages.
If the
language field is not supplied, our system will automatically detect the language of the content.
Example: "en"boolean
default:"false"
Enable AI Logic feature for AI detection. 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 Text Detection Response.
AI Logic explanations are returned for six languages only; for any other language the response contains the detection result without explanations.
integer
default:"2"
Sets how strong the AI signal in a passage must be before the passage is flagged as AI-generated. The same levels apply to
aiGeneratedText.sensitivity when you submit a scan.1- Most conservative. Generally only passages with the strongest AI signal are flagged. Fewer human-written passages are flagged by mistake, and more AI-generated text can go unflagged.2- Balanced. The default.3- Most sensitive. Passages with a weaker AI signal are flagged too. More AI-generated text is caught, and more human-written text can be flagged by mistake.
>= 1 <= 3Responses
Next Steps
Detect AI-Generated Text
Learn how to use the AI Detection API to check if content was written by a human or generated by an AI.
AI Logic
Understand how AI Logic can help you interpret the results of AI text detection.
AI Text Detection in Authenticity Scans
Learn about the AI Text Detection result that Authenticity scans deliver.

