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
Vettly Family
Safety Inbox, Vettly Coach, and visible Companion pairing for teen families.
Content Moderation API
One endpoint for text, image, and video moderation.
Image Moderation API
Policy-driven image checks with clear allow, review, and block actions.
Content Moderation in Next.js
Add content moderation to a Next.js App Router project in minutes. Server-side API routes, React Server Components, and edge runtime examples.
Get an API key
Start making decisions in minutes with a Developer plan and clear upgrade paths.
Get an API key