Skip to content
AI Detector

Detect AI-Generated Text

The Copyleaks AI Detection API is a powerful tool to determine if a given text was written by a human or generated by an AI. The API is synchronous, meaning you get the results in the same API call.

This guide will walk you through the process of submitting text for AI detection and understanding the results.

  1. Before you start, ensure you have the following:

  2. Choose your preferred method for making API calls.

    You can interact with the API using any standard HTTP client.

    For a quicker setup, we provide a Postman collection. See our Postman guide for instructions.

  3. To perform a scan, we first need to generate an access token. For that, we will use the login endpoint. The API key can be found on the Copyleaks API Dashboard.

    Upon successful authentication, you will receive a token that must be attached to subsequent API calls via the Authorization: Bearer <TOKEN> header. This token remains valid for 48 hours.

    POST https://id.copyleaks.com/v3/account/login/api
    Headers
    Content-Type: application/json
    Body
    {
    "email": "[email protected]",
    "key": "00000000-0000-0000-0000-000000000000"
    }

    Response

    {
    "access_token": "<ACCESS_TOKEN>",
    ".issued": "2025-07-31T10:19:40.0690015Z",
    ".expires": "2025-08-02T10:19:40.0690016Z"
    }
  4. Use the Writer Detector Endpoint to send text for analysis. You need to provide a unique scanId for each submission.

    POST https://api.copyleaks.com/v2/writer-detector/my-scan-1/check
    Headers
    Authorization: Bearer <YOUR_AUTH_TOKEN>
    Content-Type: application/json
    Body
    {
    "text": "Lions are social animals, living in groups called prides, typically consisting of several females, their offspring, and a few males. Female lions are the primary hunters, working together to catch prey. Lions are known for their strength, teamwork, and complex social structures.",
    "sandbox": true
    }
  5. For a complete breakdown of the response structure, see the AI Detection Response documentation.

  6. You have successfully submitted text for AI detection. You can now use the JSON response in your application to take further action based on the findings.