NSFW Text Detection
Detect sexually explicit language, hate speech, harassment, self-harm, and other harmful categories in user-generated text.
POST
/nsfw-text/detectAuthentication
Bearer token in the Authorization header.
Request
Content-Type:
application/json| Field | Type | Required | Description |
|---|---|---|---|
| text | string | Required | The text to classify. Long text is automatically chunked. |
Response
| Field | Type | Description |
|---|---|---|
| score | number | Overall NSFW probability (0.0 – 1.0). |
| is_nsfw | boolean | Whether the text is classified as NSFW. |
| categories | object | Per-category scores, e.g. {"sexual": 0.01, "hate": 0.02, "violence": 0.0, "harassment": 0.0, "self_harm": 0.0}. |
| verdict | string | Human-readable verdict summarising the result. |
Example
Request
curl -X POST https://api.cacuda.com/nsfw-text/detect \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Hello, how are you today?"}'Response 200 OK
{
"score": 0.01,
"is_nsfw": false,
"categories": {
"sexual": 0.01,
"hate": 0,
"violence": 0,
"harassment": 0,
"self_harm": 0
},
"verdict": "safe"
}Error Codes
| Code | Description |
|---|---|
| 400 | Missing or empty text field. |
| 401 | Missing or invalid API key. |
| 402 | Insufficient credits. |
| 503 | Detection service unavailable. |
Notes
Text longer than ~450 tokens is automatically split into chunks. Each chunk consumes one credit.
Category keys may vary by model ensemble version.
Try it in the scanner
Test this endpoint interactively with real data. No code required.
Open Scanner