AI Detector
Analyze text to detect AI-generated content with confidence scores and sentence-level analysis.
POST /api/detector/
Analyze text to determine whether it was written by AI. Returns a confidence score and per-sentence breakdown.
Authentication: X-API-Key header with ai_detector scope
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
content | string | Yes | Text content to analyze |
callback_url | string | No | URL to receive results asynchronously via webhook |
poll | boolean | No | Set to true to enable polling mode (default: false) |
webhook_secret | string | No | Secret sent in X-Webhook-Secret header of webhook POST |
Limits
| Limit | Value |
|---|---|
| Minimum length | 50 words |
| Maximum length | 2,000 words |
Requests outside these bounds are rejected with 400 (code service_error) before any credits are charged. The limits apply to both synchronous and asynchronous requests.
Processing Modes
The endpoint supports synchronous and asynchronous processing:
| Parameters | Mode | Response |
|---|---|---|
| (none) | Sync | 200 OK — result in response body |
callback_url | Async + webhook | 202 Accepted — result POSTed to your URL |
poll: true | Async + polling | 202 Accepted — result via GET /api/jobs/{task_id}/ |
callback_url + poll: true | Async + both | 202 Accepted — result via webhook AND polling |
See Async Jobs for details on asynchronous processing.
Synchronous Example
Request
curl -X POST https://developer-portal.walterwrites.ai/api/detector/ \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"content": "Artificial intelligence has revolutionized numerous industries by automating complex tasks and improving business decisions. Organizations across healthcare, finance, and manufacturing now rely on machine learning models to analyze vast amounts of data, identify meaningful patterns, and generate accurate predictions. As these technologies continue to evolve, they are expected to deliver even greater efficiency, innovation, and value across the global economy."
}'Response (200 OK)
{
"status": "success",
"task_id": null,
"result": "ai",
"ai_score": 0.87,
"items": [
{
"text": "Artificial intelligence has revolutionized numerous industries by automating complex tasks and improving business decisions.",
"prediction": "ai-generated",
"ai_score": 0.91
},
{
"text": "Organizations across healthcare, finance, and manufacturing now rely on machine learning models to analyze vast amounts of data, identify meaningful patterns, and generate accurate predictions.",
"prediction": "ai-generated",
"ai_score": 0.86
},
{
"text": "As these technologies continue to evolve, they are expected to deliver even greater efficiency, innovation, and value across the global economy.",
"prediction": "ai-generated",
"ai_score": 0.84
}
],
"service_name": "detector_service",
"execution_time": 1.52,
"word_count": 60,
"credits_remaining": 1940,
"message": "Text has been successfully checked",
"user": {
"id": 12345
}
}Asynchronous Example
Request
curl -X POST https://developer-portal.walterwrites.ai/api/detector/ \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"content": "Artificial intelligence has revolutionized numerous industries by automating complex tasks and improving business decisions. Organizations across healthcare, finance, and manufacturing now rely on machine learning models to analyze vast amounts of data, identify meaningful patterns, and generate accurate predictions. As these technologies continue to evolve, they are expected to deliver even greater efficiency, innovation, and value across the global economy.",
"poll": true,
"callback_url": "https://your-server.com/webhook",
"webhook_secret": "your_secret_123"
}'Response (202 Accepted)
{
"status": "pending",
"task_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"result": null,
"ai_score": null,
"items": null,
"service_name": null,
"execution_time": null,
"word_count": 60,
"credits_remaining": 1940,
"message": null,
"user": {
"id": 12345
}
}Use the returned task_id to poll for results, or wait for the webhook delivery to your callback_url.
Response Fields
| Field | Type | Description |
|---|---|---|
status | string | "success" (sync) or "pending" (async) |
task_id | string | null | Job ID for async requests; null for sync |
result | string | null | Detection verdict: "ai" or "human" |
ai_score | float | null | AI probability (0.0 = human, 1.0 = AI) |
items | array | null | Sentence-level analysis with individual scores |
items[].text | string | Individual sentence text |
items[].prediction | string | Classification: "ai-generated" or "original" |
items[].ai_score | float | AI probability for this sentence (0.0–1.0) |
service_name | string | null | Name of the service that handled the request. For reference only. |
execution_time | float | null | Processing time in seconds |
word_count | integer | Word count of input text |
credits_remaining | integer | Credit balance after this request |
message | string | null | Status message |
user.id | integer | Your user ID |
AI Score Interpretation
| Score Range | Classification | Confidence |
|---|---|---|
| 0.0 – 0.3 | Human | High confidence |
| 0.3 – 0.5 | Likely Human | Medium confidence |
| 0.5 – 0.7 | Likely AI | Medium confidence |
| 0.7 – 1.0 | AI-Generated | High confidence |
The binary result field returns "ai" when ai_score > 0.5 and "human" otherwise.
Webhook Delivery
When using callback_url, the result is POSTed to your URL as JSON with the same response structure as the synchronous response. If you provided a webhook_secret, it is sent in the X-Webhook-Secret header so you can verify the request originated from WalterAI.
The callback_url must be a publicly routable URL. Requests to private, internal, or reserved IP addresses are blocked for security reasons.
POST https://your-server.com/webhook
Content-Type: application/json
X-Webhook-Secret: your_secret_123
{
"status": "success",
"task_id": "a1b2c3d4-...",
"result": "ai",
"ai_score": 0.87,
...
}