# AI Content Detector (`junipr/ai-content-detector`) Actor

Detect AI-generated text using statistical analysis. Analyzes perplexity, burstiness, vocabulary diversity, repetition patterns, and writing style. Returns confidence scores, classification (AI/human/mixed), and detailed signal breakdowns. Batch processing for multiple texts.

- **URL**: https://apify.com/junipr/ai-content-detector.md
- **Developed by:** [junipr](https://apify.com/junipr) (community)
- **Categories:** Developer tools, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

$6.50 / 1,000 text analyzeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## AI Content Detector

Detect AI-generated text from modern LLMs using statistical analysis. Analyzes perplexity patterns, sentence burstiness, vocabulary diversity, repetition patterns, and stylistic uniformity — all running **locally with zero external API calls**.

### Why Use This Actor

Existing AI detection tools require expensive subscriptions ($15+/month for GPTZero, Originality.ai) and send your text to external AI services. This actor uses proven statistical indicators running entirely on Apify's infrastructure.

| Feature | Ours | GPTZero | Originality.ai | Copyleaks |
|---------|------|---------|----------------|-----------|
| Price per 1K texts | **$6.50** | ~$10-15/sub | ~$15/sub | ~$10/sub |
| Batch processing | ✅ 100K+ | Limited | Limited | Yes |
| External API needed | **None** | Proprietary | Proprietary | Proprietary |
| Speed | **<10ms/text** | ~500ms | ~500ms | ~500ms |
| Deterministic results | ✅ | ❌ | ❌ | ❌ |
| Open methodology | ✅ | ❌ | ❌ | ❌ |

**Honest limitation:** Statistical AI detection is not perfect. No detector achieves 100% accuracy. Short texts (<100 words), heavily edited AI text, and formal/technical writing may produce less accurate results. Use probability scores as signals, not verdicts.

### How to Use

Zero-config: just provide an array of text strings.

```json
{
  "texts": [
    "In today's rapidly evolving technological landscape, it is important to note that artificial intelligence has demonstrated remarkable capabilities across a wide variety of domains.",
    "I can't believe how weird yesterday was. My dog somehow got into the kitchen and ate half a pizza while I was on a call. The whole thing was chaos."
  ]
}
````

With metadata and IDs:

```json
{
  "texts": [
    {
      "id": "submission-456",
      "text": "The article text to analyze...",
      "metadata": { "author": "John Doe", "source": "blog" }
    }
  ]
}
```

### Input Configuration

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `texts` | array | Demo texts | Plain strings or objects with text/id/metadata. Max: 100,000 |
| `analyzePerplexity` | boolean | `true` | Word predictability analysis |
| `analyzeBurstiness` | boolean | `true` | Sentence length variation |
| `analyzeVocabulary` | boolean | `true` | Type-token ratio, vocabulary diversity |
| `analyzeRepetition` | boolean | `true` | Filler phrases, transitional word density |
| `analyzeStyle` | boolean | `true` | Paragraph uniformity, sentence starters |
| `paragraphLevel` | boolean | `true` | Per-paragraph analysis for mixed content |
| `aiThreshold` | number | `0.65` | AI classification threshold (0.50–0.95) |
| `includeSignalDetails` | boolean | `true` | Full signal breakdown in output |
| `onlyAiDetected` | boolean | `false` | Filter to AI-detected texts only |

### Output Format

```json
{
  "id": null,
  "classification": "ai_generated",
  "aiProbability": 0.78,
  "humanProbability": 0.22,
  "confidence": 0.82,
  "wordCount": 245,
  "signals": {
    "burstiness": {
      "score": 0.71,
      "sentenceLengthVariance": 8.2,
      "sentenceLengthMean": 22.4,
      "interpretation": "Sentence lengths are suspiciously uniform — AI-like pattern",
      "weight": 0.25
    },
    "repetition": {
      "score": 0.69,
      "fillerPhraseCount": 4,
      "transitionalWordDensity": 0.062,
      "interpretation": "High density of AI-characteristic phrases"
    }
  },
  "flaggedPatterns": [
    {
      "pattern": "uniform_sentence_length",
      "description": "Sentences are unusually similar in length",
      "severity": "strong"
    },
    {
      "pattern": "filler_phrase_density",
      "description": "4 AI-typical filler phrases detected",
      "severity": "moderate"
    }
  ],
  "paragraphAnalysis": [
    {
      "paragraphIndex": 1,
      "aiProbability": 0.82,
      "classification": "ai_generated",
      "dominantSignal": "repetition"
    }
  ],
  "analyzedAt": "2026-03-11T12:00:00.000Z"
}
```

#### Signal Score Interpretation

| Range | Meaning |
|-------|---------|
| 0.0 – 0.3 | Strongly suggests human writing |
| 0.3 – 0.5 | Mildly suggests human writing |
| 0.5 – 0.7 | Uncertain |
| 0.7 – 1.0 | Strongly suggests AI writing |

### Detection Signals

- **Perplexity:** AI text uses consistently "safe" word choices — high predictability, low variance
- **Burstiness:** Human text has highly variable sentence lengths; AI text is uniform
- **Vocabulary:** AI text often repeats vocabulary at higher rates (lower type-token ratio)
- **Repetition:** AI text overuses transitional words ("furthermore", "moreover") and filler phrases
- **Style:** AI text tends to have uniform paragraph lengths and repetitive sentence starters

### Tips and Advanced Usage

- **Paragraph-level analysis:** Enable `paragraphLevel: true` to detect mixed content (human intro + AI body)
- **Adjusting threshold:** Lower threshold (0.50) = more aggressive, higher false positive rate; Higher (0.85) = only flag clear AI text
- **False positives:** Formal academic and technical writing may score as AI-like — check `flaggedPatterns` for context
- **Batch audits:** Use `onlyAiDetected: true` to filter a large content set to flagged items for manual review

### Pricing

**$6.50 per 1,000 texts analyzed** (PPE — pay only for successfully analyzed texts)

Pricing includes all platform compute costs — no hidden fees.

| Use Case | Texts | Cost |
|----------|-------|------|
| Student assignment check | 30 | $0.20 |
| Blog content audit | 500 | $3.25 |
| Monthly submission screening | 5,000 | $32.50 |
| Platform content moderation | 100,000 | $650.00 |

Texts below 50 characters and empty inputs are NOT billed.

### FAQ

#### How accurate is this detector?

Statistical detection typically achieves 70-85% accuracy on unmodified AI text. Heavily edited AI text and formal human writing reduce accuracy. Always treat results as probability signals, not proof.

#### Can it identify which AI model wrote the text?

No — it detects AI-like statistical patterns, not model fingerprints. Outputs from modern LLMs tend to score similarly.

#### What's the minimum text length?

50 characters minimum. For reliable results, 200+ words recommended.

#### Does it work on non-English text?

Most signals work across languages (burstiness, vocabulary diversity). Filler phrase detection is English-only.

#### Is this suitable for academic integrity checking?

As one signal among many, yes. Do not use as sole evidence of misconduct — human review is always recommended.

#### How does it differ from GPTZero?

GPTZero uses a proprietary AI model (which itself has biases). This actor uses transparent, deterministic statistical methods — same input always produces same output, and you can understand exactly why a text was flagged.

***

Related actors by Junipr: [Address Validator](https://apify.com/junipr/address-validator) | [Temporary Email Generator](https://apify.com/junipr/temporary-email-generator)

# Actor input Schema

## `texts` (type: `array`):

List of texts to analyze for AI content. Each can be a plain string or an object with text, id, and metadata fields.

## `analyzePerplexity` (type: `boolean`):

Analyze word-level perplexity (predictability). AI text tends to have uniformly low perplexity.

## `analyzeBurstiness` (type: `boolean`):

Analyze sentence length variation. Human text has high burstiness; AI text is more uniform.

## `analyzeVocabulary` (type: `boolean`):

Analyze vocabulary diversity (type-token ratio). AI text often has lower vocabulary diversity.

## `analyzeRepetition` (type: `boolean`):

Detect phrase repetition patterns and filler phrases common in AI text.

## `analyzeStyle` (type: `boolean`):

Analyze stylistic uniformity (paragraph length variation, punctuation patterns).

## `paragraphLevel` (type: `boolean`):

Analyze each paragraph separately to detect mixed human+AI content.

## `aiThreshold` (type: `number`):

Probability threshold above which text is classified as likely AI-generated. Min: 0.50, Max: 0.95.

## `includeSignalDetails` (type: `boolean`):

Include detailed breakdown of each analysis signal.

## `onlyAiDetected` (type: `boolean`):

Only output texts classified as AI-generated.

## `onlyHumanDetected` (type: `boolean`):

Only output texts classified as human-written.

## Actor input object example

```json
{
  "texts": [
    "The quick brown fox jumps over the lazy dog. This is a simple sentence written naturally.",
    "In the realm of artificial intelligence, large language models have demonstrated remarkable capabilities in generating human-like text across a wide variety of domains and applications. Furthermore, it is important to note that these systems exhibit consistent patterns."
  ],
  "analyzePerplexity": true,
  "analyzeBurstiness": true,
  "analyzeVocabulary": true,
  "analyzeRepetition": true,
  "analyzeStyle": true,
  "paragraphLevel": true,
  "aiThreshold": 0.65,
  "includeSignalDetails": true,
  "onlyAiDetected": false,
  "onlyHumanDetected": false
}
```

# Actor output Schema

## `results` (type: `string`):

AI probability scores, human/AI classification, confidence, perplexity/burstiness/vocabulary/repetition/style signal details, and paragraph-level breakdown.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("junipr/ai-content-detector").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("junipr/ai-content-detector").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call junipr/ai-content-detector --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=junipr/ai-content-detector",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "AI Content Detector",
        "description": "Detect AI-generated text using statistical analysis. Analyzes perplexity, burstiness, vocabulary diversity, repetition patterns, and writing style. Returns confidence scores, classification (AI/human/mixed), and detailed signal breakdowns. Batch processing for multiple texts.",
        "version": "1.0",
        "x-build-id": "4vxwoUMWaxKaW9lsd"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/junipr~ai-content-detector/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-junipr-ai-content-detector",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/junipr~ai-content-detector/runs": {
            "post": {
                "operationId": "runs-sync-junipr-ai-content-detector",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/junipr~ai-content-detector/run-sync": {
            "post": {
                "operationId": "run-sync-junipr-ai-content-detector",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "texts": {
                        "title": "Texts",
                        "type": "array",
                        "description": "List of texts to analyze for AI content. Each can be a plain string or an object with text, id, and metadata fields.",
                        "default": [
                            "The quick brown fox jumps over the lazy dog. This is a simple sentence written naturally.",
                            "In the realm of artificial intelligence, large language models have demonstrated remarkable capabilities in generating human-like text across a wide variety of domains and applications. Furthermore, it is important to note that these systems exhibit consistent patterns."
                        ]
                    },
                    "analyzePerplexity": {
                        "title": "Analyze Perplexity",
                        "type": "boolean",
                        "description": "Analyze word-level perplexity (predictability). AI text tends to have uniformly low perplexity.",
                        "default": true
                    },
                    "analyzeBurstiness": {
                        "title": "Analyze Burstiness",
                        "type": "boolean",
                        "description": "Analyze sentence length variation. Human text has high burstiness; AI text is more uniform.",
                        "default": true
                    },
                    "analyzeVocabulary": {
                        "title": "Analyze Vocabulary",
                        "type": "boolean",
                        "description": "Analyze vocabulary diversity (type-token ratio). AI text often has lower vocabulary diversity.",
                        "default": true
                    },
                    "analyzeRepetition": {
                        "title": "Analyze Repetition",
                        "type": "boolean",
                        "description": "Detect phrase repetition patterns and filler phrases common in AI text.",
                        "default": true
                    },
                    "analyzeStyle": {
                        "title": "Analyze Style",
                        "type": "boolean",
                        "description": "Analyze stylistic uniformity (paragraph length variation, punctuation patterns).",
                        "default": true
                    },
                    "paragraphLevel": {
                        "title": "Paragraph Level Analysis",
                        "type": "boolean",
                        "description": "Analyze each paragraph separately to detect mixed human+AI content.",
                        "default": true
                    },
                    "aiThreshold": {
                        "title": "AI Threshold",
                        "type": "number",
                        "description": "Probability threshold above which text is classified as likely AI-generated. Min: 0.50, Max: 0.95.",
                        "default": 0.65
                    },
                    "includeSignalDetails": {
                        "title": "Include Signal Details",
                        "type": "boolean",
                        "description": "Include detailed breakdown of each analysis signal.",
                        "default": true
                    },
                    "onlyAiDetected": {
                        "title": "Only AI Detected",
                        "type": "boolean",
                        "description": "Only output texts classified as AI-generated.",
                        "default": false
                    },
                    "onlyHumanDetected": {
                        "title": "Only Human Detected",
                        "type": "boolean",
                        "description": "Only output texts classified as human-written.",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
