NSFW Image Detection
Flag explicit, violent, or unsafe imagery. Returns a severity rating you can use to set moderation thresholds.
POST
/nsfw/detectAuthentication
Bearer token in the Authorization header.
Request
Content-Type:
multipart/form-data| Field | Type | Required | Description |
|---|---|---|---|
| file | File | Required | Image file to analyse. Accepts PNG, JPEG, and WebP. |
Response
| Field | Type | Description |
|---|---|---|
| score | number | Probability the image is NSFW (0.0 – 1.0). |
| is_nsfw | boolean | Whether the image is classified as NSFW. |
| severity | string | Severity level: "safe", "suggestive", "explicit", or "extreme". |
| verdict | string | Human-readable verdict summarising the result. |
Example
Request
curl -X POST https://api.cacuda.com/nsfw/detect \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@image.png"
Response 200 OK
{
"score": 0.03,
"is_nsfw": false,
"severity": "safe",
"verdict": "safe"
}Error Codes
| Code | Description |
|---|---|
| 400 | No file provided or unsupported format. |
| 401 | Missing or invalid API key. |
| 402 | Insufficient credits. |
| 503 | Detection service unavailable. |
Try it in the scanner
Test this endpoint interactively with real data. No code required.
Open Scanner