Official Python SDK for the AI Detector API — detect AI-generated text with sentence-level confidence scoring.
Status: v0 scaffold. SDK surface is stable; under-the-hood HTTP client and error types are being finalized. Pin the patch version once we cut 1.0.
pip install aidetectorapiPython 3.9+ is supported.
from aidetectorapi import AIDetector
client = AIDetector(api_key="YOUR_API_KEY")
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}")Get a free API key at https://aidetectorapi.com/signup/ (1,000 requests/month, no credit card).
api_key— your AI Detector API key.base_url— override the API host. Defaults tohttps://api.aidetectorapi.com.timeout— per-request timeout in seconds.
Sends a single piece of text for analysis. Returns a DetectionResult with:
score: float— overall AI probability (0–1)confidence: Literal["low", "medium", "high"]sentences: list[SentenceScore]
Available on Pro and Enterprise plans. Up to 100 texts per call.
The SDK raises typed exceptions:
AIDetectorAuthError— invalid or missing API key (HTTP 401)AIDetectorRateLimitError— rate-limited; check.retry_after(HTTP 429)AIDetectorAPIError— other 4xx/5xx with.status_codeand.message
MIT — see LICENSE.