FastAPI microservice that scores text content for AI-likelihood using perplexity analysis, burstiness measurement, and stylometric markers.
docker compose up --build -d# Health check
curl http://localhost:8000/health
# Detect AI content
curl -X POST http://localhost:8000/detect \
-H "Content-Type: application/json" \
-d '{"text": "Your text content here with at least fifty words so it passes the minimum word count threshold. Add more words to reach the minimum. The quick brown fox jumps over the lazy dog. This sentence adds more words. Another sentence for good measure. Keep going until we have enough words for the detector to analyze properly. Almost there now, just a few more words needed."}'POST /detect
- Body:
{ "text": "...", "min_words": 50 } - Returns:
{ "score", "label", "breakdown", "word_count" } label: "AI" (score >= 60), "HUMAN" (score <= 35), "UNCERTAIN" (36-59)
GET /health
- Returns:
{ "status": "ok" }
{
"name": "check_ai_score",
"description": "Analyze text content to determine how likely it was written by AI. Returns a score from 0 (human) to 100 (AI), a label (AI/HUMAN/UNCERTAIN), and a breakdown of perplexity, burstiness, and stylometric sub-scores.",
"input_schema": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "The text content to analyze for AI authorship."
},
"min_words": {
"type": "integer",
"description": "Minimum word count threshold. Returns an error if the text has fewer words.",
"default": 50
}
},
"required": ["text"]
}
}