NSFW Image Classification
Binary NSFW classification for up to 10 image URLs or data URLs per request
Overview
The NSFW Image Classification endpoint performs binary classification on image URLs (or base64 data URLs) and returns whether each image contains NSFW concepts. Send up to 10 images per request.Authentication
Include your API key in the request header:Request
Headers
Body parameters
You may provide images in any of the following fields. The endpoint accepts up to 10 images per request.| Parameter | Type | Required | Description |
|---|---|---|---|
image_urls | string | string[] | No | Primary input field. One URL or an array of URLs. |
imageUrls | string | string[] | No | Alias for image_urls. |
imageUrl | string | No | Alias for a single image URL. |
imageDataUrl | string | No | Base64 data URL for a single image. |
imageDataUrls | string[] | No | Base64 data URLs for multiple images. |
model | string | No | Only supported value is nsfw-classifier (default). |
Example request
Response
Success (200)
Response fields
model: The classifier model used.requestId: Request ID (if available; helpful for support).inputCount: Number of images processed (max 10).cost: Final charged amount (after discounts and currency conversion).currency:USDorXNOdepending on payment source.truncated:trueif more than 10 images were provided.has_nsfw_concepts: List of booleans (one per image, in input order).is_nsfw:trueif any image was flagged.
Errors
400 – Invalid or policy violation
- Missing or invalid image URLs
- JSON parsing error
- Policy violation (returns a safety error message)
401 – Unauthorized
429 – Rate limit or API key usage limits
500 – Server or provider failure
Billing Notes
- Charged $0.0015 per image actually sent to the classifier.
- If more than 10 images are provided, only the first 10 are billed/processed.
- Discounts and referral policies apply as with other endpoints.
Code Examples
Authorizations
Body
NSFW image classification request
NSFW image classification request payload
Primary input field. One URL or an array of URLs (only the first 10 are processed).
"https://example.com/image.jpg"
Alias for image_urls. One URL or an array of URLs (only the first 10 are processed).
"https://example.com/image.jpg"
Alias for a single image URL
"https://example.com/image.jpg"
Base64 data URL for a single image (format: data:image/[type];base64,[data])
"data:image/jpeg;base64,/9j/4AAQ..."
Base64 data URLs for multiple images (only the first 10 are processed)
1Only supported value is nsfw-classifier
Response
NSFW classification response
The classifier model used
"nsfw-classifier"
Request ID (if available; helpful for support)
Number of images processed (max 10)
2
Final charged amount (after discounts and currency conversion)
0.003
Currency of the charge
"USD"
True if more than 10 images were provided
false
Per-image NSFW flags in input order
[false, true]True if any image was flagged
true