apyhub
ARTIFICIAL INTELLIGENCE · IMAGE PROCESSING

Classify NSFW Image API

What it does

NSFW Image Classifier checks an uploaded image and returns whether it is safe or NSFW. Send a binary image file in the request body, up to 20 MB, and get back a structured classification response.

The response includes a boolean nsfw flag, a human-readable label, a confidence score between 0 and 1, and a scores object with per-class probabilities. That makes it useful when you need both a simple moderation decision and the underlying confidence values for thresholding or logging.

Use NSFW Image Classifier to screen user-uploaded avatars, profile pictures, marketplace listings, or community content before it is published. It fits directly into moderation pipelines where you want to block explicit imagery, route uncertain cases for review, or store a score for later audit.

Because the input and output are minimal, it is easy to place this check at the edge of an upload flow or behind an internal moderation queue without reshaping your existing file handling.

POST
Classify an image as safe or NSFW with confidence score
http://localhost:8080/dosvak/classify-nsfw-image
QUICKSTARTGUIDE

Quickstart

Upload an image to classify whether it contains NSFW content.

curl -X POST "http://localhost:8080/dosvak/classify-nsfw-image" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/image.jpg"

What you'll get back

Returns a JSON object with optional top-level fields: nsfw boolean, label string, score number, and scores object. scores contains string keys mapped to numeric scores.

{
  "nsfw": false,
  "label": "safe",
  "score": 0.98,
  "scores": {
    "safe": 0.98,
    "nsfw": 0.02
  }
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
Image file (max 20 MB)

About this endpoint

What it does

Uploads an image file and returns an NSFW classification result for that image, including a boolean flag, a label, a confidence score, and per-class scores.

Request Body

ParameterTypeMandatoryDescription
fileStringYesImage file upload in binary format. Maximum size: 20 MB.

Response

Returns a JSON object with four top-level fields: nsfw as a boolean, label as a string, score as a number between 0 and 1, and scores as an object whose values are numbers.

ParameterTypeMandatoryDescription
nsfwBooleanNoBoolean classification result.
labelStringNoClassification label returned by the service.
scoreNumberNoConfidence score between 0 and 1.
scoresObjectNoObject containing score values keyed by class name.

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.