SDKs & integrations
Official Python and JavaScript SDKs, plus framework integration guides. The fastest way to call AI Detector API from your stack.
Get the SDK in your project.
First detection in 5 lines.
Next.js, Express, FastAPI, Django.
Install the SDK
Both SDKs are open-source and MIT-licensed. They wrap the same REST API under the hood.
pip install aidetectorapinpm install @aidetectorapi/sdkyarn add @aidetectorapi/sdkpnpm add @aidetectorapi/sdkBasic usage
Pass text in, get a score and sentence-level breakdown back.
from aidetectorapi import AIDetector
client = AIDetector(api_key="YOUR_API_KEY")
# Detect AI text — returns score + sentence-level breakdown
result = client.detect("Paste any text to analyze for AI detection.")
print(f"AI probability: {result.score:.0%}")
print(f"Confidence: {result.confidence}")
for s in result.sentences:
print(f" [{s.score:.0%}] {s.text}")import { AIDetector } from "@aidetectorapi/sdk";
const client = new AIDetector(process.env.AIDETECTORAPI_KEY);
const result = await client.detect(
"Paste any text to analyze for AI detection."
);
console.log(`AI probability: ${(result.score * 100).toFixed(0)}%`);
console.log(`Confidence: ${result.confidence}`);
for (const s of result.sentences) {
console.log(` [${(s.score * 100).toFixed(0)}%] ${s.text}`);
}Framework integrations
Drop-in handlers for the most common backend frameworks. Each example expects an AIDETECTORAPI_KEY env var.
// app/api/check/route.ts
import { NextResponse, type NextRequest } from "next/server";
import { AIDetector } from "@aidetectorapi/sdk";
const detector = new AIDetector(process.env.AIDETECTORAPI_KEY!);
export async function POST(req: NextRequest) {
const { text } = await req.json();
const result = await detector.detect(text);
return NextResponse.json(result);
}import express from "express";
import { AIDetector } from "@aidetectorapi/sdk";
const app = express();
app.use(express.json());
const detector = new AIDetector(process.env.AIDETECTORAPI_KEY!);
app.post("/check", async (req, res) => {
const result = await detector.detect(req.body.text);
res.json(result);
});
app.listen(3000);from fastapi import FastAPI
from pydantic import BaseModel
from aidetectorapi import AIDetector
import os
app = FastAPI()
detector = AIDetector(api_key=os.environ["AIDETECTORAPI_KEY"])
class CheckRequest(BaseModel):
text: str
@app.post("/check")
def check(req: CheckRequest):
result = detector.detect(req.text)
return result.model_dump()# views.py
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from aidetectorapi import AIDetector
import json, os
detector = AIDetector(api_key=os.environ["AIDETECTORAPI_KEY"])
@csrf_exempt
def check(request):
data = json.loads(request.body)
result = detector.detect(data["text"])
return JsonResponse({
"score": result.score,
"confidence": result.confidence,
"sentences": [{"text": s.text, "score": s.score} for s in result.sentences],
})No-code & low-code
Don't want to write code? AI Detector API works with the no-code platforms below via a standard REST connector.
Zapier
Trigger detection on new form submissions, emails, or CRM events.
Make (Integromat)
Branch workflows on AI probability or sentence-level threshold.
n8n
Self-hosted automation; same REST endpoint.
Bubble
Add detection to Bubble apps via the API Connector plugin.
All four platforms can hit the AI Detector API REST endpoint directly. See the API reference for request and response details.
MIT-licensed. Issues and PRs welcome. aidetectorapi-python
MIT-licensed. TypeScript-first, native fetch, no deps. aidetectorapi-javascript
SDKs follow semver. Breaking changes ship as a major version with at least 90 days of overlap support.
Python 3.9+ · Node 18+ · Edge runtimes (Vercel, Cloudflare Workers, Deno). JavaScript SDK is zero-dependency.
Get an API key in under 5 minutes
Free tier — 1,000 requests/month, no credit card.
Get my free API key