Skip to main content
POST
cURL

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:
Alternatively, you can use Bearer token authentication:

Request

Headers

Body parameters

You may provide images in any of the following fields. The endpoint accepts up to 10 images per request. At least one image field is required. If more than 10 images are provided, only the first 10 are processed and billed.

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: USD or XNO depending on payment source.
  • truncated: true if more than 10 images were provided.
  • has_nsfw_concepts: List of booleans (one per image, in input order).
  • is_nsfw: true if 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

x-api-key
string
header
required

Body

application/json

NSFW image classification request

NSFW image classification request payload

image_urls

Primary input field. One URL or an array of URLs (only the first 10 are processed).

Example:

"https://example.com/image.jpg"

imageUrls

Alias for image_urls. One URL or an array of URLs (only the first 10 are processed).

Example:

"https://example.com/image.jpg"

imageUrl
string<uri>

Alias for a single image URL

Example:

"https://example.com/image.jpg"

imageDataUrl
string

Base64 data URL for a single image (format: data:image/[type];base64,[data])

Example:

"data:image/jpeg;base64,/9j/4AAQ..."

imageDataUrls
string[]

Base64 data URLs for multiple images (only the first 10 are processed)

Minimum array length: 1
model
string
default:nsfw-classifier

Only supported value is nsfw-classifier

Response

NSFW classification response

model
string

The classifier model used

Example:

"nsfw-classifier"

requestId
string

Request ID (if available; helpful for support)

inputCount
integer

Number of images processed (max 10)

Example:

2

cost
number

Final charged amount (after discounts and currency conversion)

Example:

0.003

currency
string

Currency of the charge

Example:

"USD"

truncated
boolean

True if more than 10 images were provided

Example:

false

has_nsfw_concepts
boolean[]

Per-image NSFW flags in input order

Example:
is_nsfw
boolean

True if any image was flagged

Example:

true