AI Detector API Quickstart
Follow these five steps to go from zero to detecting AI-generated text. You will have a working integration in under five minutes . No credit card required.
In a hurry? Here's the whole thing.
Replace YOUR_API_KEY with the key from your dashboard. Below is the same request in three languages.
import requests
response = requests.post(
"https://api.aidetectorapi.com/v1/detect",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"text": "Paste any text to analyze for AI detection."},
timeout=10,
)
result = response.json()
print(f"AI probability: {result['score']:.0%}")
print(f"Sentences analyzed: {result['sentences_analyzed']}")const res = await fetch("https://api.aidetectorapi.com/v1/detect", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.AIDETECTORAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
text: "Paste any text to analyze for AI detection.",
}),
});
const result = await res.json();
console.log(`AI probability: ${(result.score * 100).toFixed(0)}%`);
console.log(`Sentences analyzed: ${result.sentences_analyzed}`);curl -X POST https://api.aidetectorapi.com/v1/detect -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"text": "Paste any text to analyze for AI detection."}'import { AIDetector } from "@aidetectorapi/sdk";
const client = new AIDetector(process.env.AIDETECTORAPI_KEY);
const result = await client.detect("Paste any text to analyze.");
console.log(result.score, result.sentences);Read the full walkthrough below, or jump to the API reference for response shapes, error codes, and rate limits.
Get Your API Key
Sign up at aidetectorapi.com/signup to get your free API key. No credit card required , the free tier includes 1,000 requests per month with full access to every feature.
After signing up, copy your API key from the dashboard. You will use it in the Authorization header of every request.
Install the SDK
Install the official SDK for your language of choice, or skip this step and use any HTTP client or cURL directly.
$ pip install aidetectorapi$ npm install aidetectorapiYou can also use any HTTP client , cURL, fetch, requests, axios . Anything that can make an HTTP POST request works.
Make Your First Request
Send a POST request to /v1/detect with the text you want to analyze. Replace your_api_key with the key from Step 1.
import requests
response = requests.post(
"https://aidetectorapi.com/v1/detect",
headers={"Authorization": "Bearer your_api_key"},
json={"text": "Paste the text you want to analyze here."}
)
result = response.json()
print(result)const response = await fetch(
"https://aidetectorapi.com/v1/detect",
{
method: "POST",
headers: {
"Authorization": "Bearer your_api_key",
"Content-Type": "application/json"
},
body: JSON.stringify({
text: "Paste the text you want to analyze here."
})
}
);
const result = await response.json();
console.log(result);curl -X POST https://aidetectorapi.com/v1/detect \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{"text": "Paste the text you want to analyze here."}'Understand the Response
The API returns a JSON object with an overall score, per-sentence breakdowns, and metadata. Here is a sample response:
{
"score": 0.94,
"label": "ai-generated",
"confidence": "high",
"words_analyzed": 342,
"sentences": [
{
"text": "The quick brown fox jumps over the lazy dog.",
"score": 0.97
},
"..."
]
}Response Fields
| Field | Type | Description |
|---|---|---|
score | number | Overall AI probability from 0 to 1. A score of 0.94 means 94% likelihood the text is AI-generated. |
label | string | Human-readable classification: "ai-generated", "human-written", or "mixed". |
sentences | array | Array of objects, each containing text (the sentence) and score (AI probability for that sentence). Enables granular, sentence-level analysis. |
confidence | string | Confidence level of the result: "high", "medium", or "low". Based on text length and model certainty. |
words_analyzed | number | Total number of words in the submitted text that were analyzed. Useful for verifying that the full document was processed. |
Next Steps
You are up and running. Here is where to go from here:
Ready to Detect AI Content?
Get your free API key and start detecting AI-generated text in under five minutes. No credit card required.