Skip to content

kevinacount2/aidetectorapi-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aidetectorapi-python

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.

Install

pip install aidetectorapi

Python 3.9+ is supported.

Quickstart

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

AIDetector(api_key, base_url=None, timeout=10)

  • api_key — your AI Detector API key.
  • base_url — override the API host. Defaults to https://api.aidetectorapi.com.
  • timeout — per-request timeout in seconds.

client.detect(text: str) -> DetectionResult

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]

client.detect_batch(texts: list[str]) -> list[DetectionResult]

Available on Pro and Enterprise plans. Up to 100 texts per call.

Errors

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_code and .message

Links

License

MIT — see LICENSE.

About

Official Python SDK for AI Detector API — detect AI-generated text with sentence-level confidence scoring.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages