# NSFW Detection API
> Moderate images automatically with on-device machine learning. Classify any image across five categories — neutral, drawing, sexy, porn and hentai — and receive per-class probabilities, the top class, a combined NSFW score and a clear verdict (safe, questionable or nsfw). A simpler check endpoint returns a single safe/unsafe decision against a threshold you choose, ideal for upload gates and user-generated-content pipelines. Supply an image by public URL, base64 or a raw binary request body; only public http/https URLs are accepted and private or internal hosts are blocked, and large images are downscaled automatically. Runs locally on TensorFlow (NSFWJS / MobileNetV2) — no third-party upstream and no per-image cloud cost — with a warm model that keeps inference fast. Ideal for community platforms, marketplaces, dating and chat apps, and any service that accepts user images.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/nsfw-api/..."
```

## Pricing
- **Free** (Free) — 3,000 calls/Mo, 1 req/s
- **Basic** ($14/Mo) — 45,000 calls/Mo, 5 req/s
- **Pro** ($37/Mo) — 300,000 calls/Mo, 20 req/s
- **Mega** ($94/Mo) — 1,400,000 calls/Mo, 60 req/s

## Endpoints

### NSFW

#### `GET /v1/check` — Simple safe/unsafe decision

**Parameters:**
- `url` (query, optional, string) — Image URL (or base64/raw body) Example: `https://tesseract.projectnaptha.com/img/eng_bw.png`
- `base64` (query, optional, string) — Base64 image data
- `threshold` (query, optional, string) — NSFW threshold 0..1 (default 0.6) Example: `0.6`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nsfw-api/v1/check?url=https%3A%2F%2Ftesseract.projectnaptha.com%2Fimg%2Feng_bw.png&threshold=0.6"
```

**Response:**
```json
{
    "data": {
        "safe": true,
        "threshold": 0.6,
        "top_class": "Neutral",
        "nsfw_score": 0.0008
    },
    "meta": {
        "timestamp": "2026-05-31T03:47:44.172Z",
        "request_id": "eb816e53-5961-4837-8f20-e3477e10a3ad"
    },
    "status": "ok",
    "message": "Image checked",
    "success": true
}
```

#### `GET /v1/classify` — Full NSFW class breakdown

**Parameters:**
- `url` (query, optional, string) — Image URL (or base64/raw body) Example: `https://tesseract.projectnaptha.com/img/eng_bw.png`
- `base64` (query, optional, string) — Base64 image data

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nsfw-api/v1/classify?url=https%3A%2F%2Ftesseract.projectnaptha.com%2Fimg%2Feng_bw.png"
```

**Response:**
```json
{
    "data": {
        "safe": true,
        "classes": {
            "porn": 0.0002,
            "sexy": 0,
            "hentai": 0.0006,
            "drawing": 0.0031,
            "neutral": 0.9961
        },
        "verdict": "safe",
        "top_class": "Neutral",
        "nsfw_score": 0.0008
    },
    "meta": {
        "timestamp": "2026-05-31T03:47:44.345Z",
        "request_id": "980c7f31-39db-4a14-bc74-dd39d4c455c3"
    },
    "status": "ok",
    "message": "Image classified",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/nsfw-api
OpenAPI spec: https://www.oanor.com/api/nsfw-api/openapi.json
