NSFW & Visual Safety Detector Documentation
Complete API reference, integration examples, authentication guidelines, and response structures.
Overview
Enterprise-grade visual content moderation API powered by NudeNet. Detect explicit content, suggestive nudity, and safety policy violations with millisecond latency, bounding boxes, and half-nudity filtering.
https://nsfw.cyliumos.onlineAuthentication
Authenticate every HTTP request using the custom X-API-Key header:
Do not expose your private key in client-side applications. Proxy requests through your backend service or Edge Workers.
Code Examples
curl -X POST "https://nsfw.cyliumos.online/is_safe" \
-H "Content-Type: application/json" \
-H "X-API-Key: cyk_live_xxxxxxxxxxxxxxxxxxxxxxxx" \
-d '{
"image": "data:image/jpeg;base64,/9j/4AAQSkZJRg...",
"detection_point": true
}'NSFW & Visual Safety Detector API
High-speed visual safety inspection API designed to eliminate inappropriate and explicit imagery before it reaches your users.
Authentication
Pass your universal API key in the X-API-Key header:
X-API-Key: cyk_live_...
Endpoint
POST /is_safe
Request Headers
| Header | Type | Required | Description |
|---|---|---|---|
Content-Type | string | Yes | application/json |
X-API-Key | string | Yes | Universal API Key generated from dashboard |
Request Body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
image | string | Yes | Base64-encoded image string (with or without data URI header) |
half_nudity | string | No | "disabled" (default) or "enabled" |
detection_point | boolean | No | Set true to return bounding coordinates |
Response Schema (200 OK)
{
"success": true,
"issafe": true,
"message": "Image is safe",
"detections": []
}
Code Examples
cURL
curl -X POST "http://localhost:8001/is_safe" \
-H "Content-Type: application/json" \
-H "X-API-Key: cyk_live_x9z0abcdef" \
-d '{
"image": "data:image/jpeg;base64,...",
"half_nudity": "enabled",
"detection_point": true
}'
TypeScript / JavaScript
const res = await fetch("http://localhost:8001/is_safe", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "cyk_live_x9z0abcdef",
},
body: JSON.stringify({
image: base64Data,
half_nudity: "enabled",
detection_point: true,
}),
});
const result = await res.json();
console.log("Safe:", result.issafe);
Python
import requests
response = requests.post(
"http://localhost:8001/is_safe",
headers={"X-API-Key": "cyk_live_x9z0abcdef"},
json={
"image": base64_image,
"half_nudity": "enabled",
"detection_point": True,
},
)
print(response.json())
Error Codes
| Status | Error Code | Description |
|---|---|---|
| 400 | invalid_image | Malformed base64 image payload |
| 401 | missing_api_key | X-API-Key header omitted |
| 401 | invalid_api_key | Key not found in Firestore |
| 403 | service_not_subscribed | User has not subscribed to nsfw-detection |
| 403 | api_key_inactive | Key is revoked or expired |
| 429 | monthly_limit_reached | Monthly plan quota exhausted |
Status & Error Responses
{
"detail": {
"success": false,
"error": "invalid_payload",
"message": "Invalid request payload"
}
}{
"detail": {
"success": false,
"error": "missing_api_key",
"message": "X-API-Key header is required"
}
}{
"detail": {
"success": false,
"error": "subscription_required",
"message": "An active subscription is required to access this service"
}
}{
"detail": {
"success": false,
"error": "api_key_expired",
"message": "API key has expired or is revoked"
}
}{
"detail": {
"success": false,
"error": "rate_limit_reached",
"message": "Monthly API request limit reached"
}
}{
"detail": {
"success": false,
"error": "internal_error",
"message": "Internal processing error"
}
}Sample Response
Example payload structure returned by this service.
{
"success": true,
"issafe": false,
"message": "Explicit visual content detected",
"detections": [
{
"label": "FEMALE_GENITALIA_EXPOSED",
"score": 0.96,
"top_left": [
120,
85
],
"bottom_right": [
280,
240
],
"box": [
120,
85,
160,
155
]
}
]
}Head over to the playground to upload your own files and inspect live bounding boxes and classifications.
Open Playground