Python
Content Moderation in Python
Production-grade moderation for any Python service.
FastAPI, Django, Flask, and any ML pipeline.
What it detects
- • User-submitted text
- • AI model outputs
- • Comment forms
- • Uploaded media
- • PII in logs
- • Custom rules
Why developers choose Vettly
- • Sync and async client
- • Works with httpx, requests, or aiohttp
- • Drop into FastAPI, Django, or Flask
- • Type stubs included
Example request
bashimport os
from vettly import Vettly
vettly = Vettly(api_key=os.environ["VETTLY_API_KEY"])
result = vettly.check(
content=user_input,
content_type="text",
policy_id="default",
)
if result.action == "block":
raise ValueError("Content blocked")Example response
json{
"flagged": true,
"action": "block",
"categories": {
"harassment": 0.93,
"hate": 0.02
},
"policy": "default",
"latency_ms": 142
}Compared to rolling your own classifier
Vettly returns decisions and audit-ready logs so your Python service stays focused on product logic.
Keep exploring
AI Chatbot Moderation API
Moderate inputs and LLM outputs in real time. Block prompt injection, NSFW content, and policy violations before users see them.
Vettly vs OpenAI Moderation
Multi-modal coverage, dashboards, and provider freedom vs text-only checks.
Content Moderation API
One endpoint for text, image, and video moderation.
Content Moderation in Next.js
Add content moderation to a Next.js App Router project in minutes. Route Handlers, Server Actions, edge runtime, policy setup, and safe error handling.