# AI Logic

> A guide to using Copyleaks AI Logic to understand the reasoning behind AI detection results, providing transparency and enabling more confident decision-making.

In a world where the line between human and AI-generated content is increasingly blurred, transparency is paramount. Copyleaks AI Logic is a groundbreaking feature that provides unprecedented insight into the "why" behind our AI detection results. It moves beyond a simple score to reveal the specific patterns and characteristics that indicate the presence of AI-generated content.

## The Power of Explainability

AI Logic is designed to address the "black box" problem in [AI detection](https://copyleaks.com/ai-detector). By providing a clear, data-driven explanation for each result, we empower you to:

-   **Make Confident Decisions**: Understand the specific signals that led to a piece of content being flagged, allowing you to make more informed and defensible decisions.
-   **Build Trust with Users**: Provide your users with a transparent explanation of why their content was flagged, fostering a sense of fairness and trust.
-   **Facilitate Constructive Dialogue**: Use the detailed insights from AI Logic to have more productive conversations about the appropriate use of AI tools.

### How to Use AI Logic

AI Logic is available as an optional parameter in your AI detection API requests. When enabled, the API response will include an additional `patterns` object that contains a detailed breakdown of the AI and human-like patterns found in the text.

This object includes:

-   **Statistics**: A comparison of the statistical properties of the text against known AI and human writing patterns.
-   **Textual Analysis**: The specific segments of the text that exhibit AI-like characteristics, including their exact location and length.

By analyzing this data, you can gain a deeper understanding of the AI's assessment and build more sophisticated and transparent content integrity workflows.

### A New Level of Transparency

AI Logic represents a significant step forward in the field of AI detection. By providing a clear and understandable explanation for our results, we are empowering developers, educators, and content creators to navigate the evolving landscape of AI-generated content with confidence and integrity.

## Usage Explanation

Upon successful completion of the request, the API will return a response containing various logics related to AI and human-written texts.

**Example JSON Response**

```json
{
  "patterns": {
    "statistics": {
      "aiCount": [
        15.9636,
        39.5495,
        84.7079,
        119.8710,
        9.9233,
        185.6670,
        14.4536,
        19.1995
      ],
      "humanCount": [
        0.8076,
        1.5076,
        3.8228,
        8.5071,
        0.3769,
        4.2536,
        0.3231,
        1.1845
      ]
    },
    "text": {
      "chars": {
        "starts": [31, 55, 303, 909, 961, 987, 1129, 1775],
        "lengths": [23, 32, 23, 33, 25, 30, 30, 19]
      },
      "words": {
        "starts": [5, 9, 45, 135, 144, 148, 169, 257],
        "lengths": [4, 6, 3, 6, 4, 5, 5, 3]
      }
    }
  }
}
```

## Understanding the Response

The response provides data that helps understand why certain text patterns have been flagged as likely AI-generated. This information enables:

- Clear documentation explaining AI detection results
- Facilitation of dialogue that leads to mutual understanding and trust
- Easy interpretation of detection results for quick action
- Collaboration and data-driven conclusions.

## Next Steps

<CardGroup cols={2}>
  <Card title="API Reference" icon="code" href="/reference/actions/writer-detector/check">Explore the full API reference for the AI Detection endpoint.</Card>
</CardGroup>
