This guide walks you through your first integration with the Copyleaks API: authenticating, submitting text, and interpreting an AI detection result. It takes about five minutes.
1

Create your account

To follow this guide you will need:
2

Install your tools

Choose your preferred method for making API calls.
# macOS
brew install curl

# Ubuntu/Debian
sudo apt-get install curl

# Windows - download from https://curl.se
HTTP needs no installation - call the API with any standard HTTP client, or import our Postman collection for a quicker start.
3

Authenticate

Every request must be authorized with an access token. Generate one by calling the login endpoint with your email and API key, both available on the API Dashboard.The token is returned in the response and must be sent on every subsequent request via the Authorization: Bearer <ACCESS_TOKEN> header. It remains valid for 48 hours.
POST https://id.copyleaks.com/v3/account/login/api
Content-Type: application/json

{
  "email": "[email protected]",
  "key": "00000000-0000-0000-0000-000000000000"
}
A successful request returns the token and its lifetime:
Response
{
  "access_token": "<ACCESS_TOKEN>",
  ".issued": "2025-07-31T10:19:40.0690015Z",
  ".expires": "2025-08-02T10:19:40.0690016Z"
}
Store the token securely and reuse it for the next 48 hours rather than logging in before every request.
4

Detect AI-generated text

Submit text to the AI Content Detector. The examples below run in sandbox mode ("sandbox": true), which returns simulated results so you can test your integration for free. Set sandbox to false for real detection, which consumes credits.Replace <ACCESS_TOKEN> with the token from the previous step. The text must be at least 255 characters, and each scan requires a unique scan ID (my-first-scan below).
POST https://api.copyleaks.com/v2/writer-detector/my-first-scan/check
Authorization: Bearer <ACCESS_TOKEN>
Content-Type: application/json

{
  "text": "Artificial intelligence has revolutionized numerous industries by automating complex tasks and providing data-driven insights. Machine learning algorithms can analyze vast datasets to identify patterns that humans might miss. In healthcare, AI assists with diagnosis and drug discovery.",
  "sandbox": true
}
The response classifies the text and reports an overall AI probability:
Response
{
  "modelVersion": "v5",
  "results": [
    { "classification": 2, "probability": 0.99 }
  ],
  "summary": { "ai": 0.99, "human": 0.01 }
}
summary.ai is the overall probability that the text is AI-generated, from 0 to 1. Each entry in results classifies a section of the text: a classification of 2 indicates AI-generated and 1 indicates human-written, with probability as the confidence for that section.

Recap

You have completed your first integration. In this guide you:
  • Authenticated with the Copyleaks API and received a 48-hour access token.
  • Submitted text to the AI Content Detector in sandbox mode.
  • Interpreted the classification and AI probability in the response.
To run against live detection, set sandbox to false. Note that production scans consume credits.

Next steps

Check for Plagiarism

Detect plagiarism in text documents using the Copyleaks API. Search billions of sources to find unoriginal content.

Detect AI-Generated Content

Detect AI-generated text via sync or async API calls. This guide covers sync detection; see the Authenticity API guide for async.

Assess Grammar and Writing Quality

Get writing and grammar suggestions via API. Authenticate, submit text, and access full details in the docs.

Moderate Text

Scan and moderate text content for unsafe or policy-relevant material across 10+ categories.

Ready to scale beyond the basics?

Get a personalized demo and discover how to process thousands of documents seamlessly, integrate Copyleaks into your existing systems, and achieve enterprise-grade accuracy for your specific use case.