# 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)
- `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?threshold=0.6"
```

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

**Parameters:**
- `url` (query, optional, string) — Image URL (or base64/raw body) Example: `https://example.com/photo.jpg`
- `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%2Fexample.com%2Fphoto.jpg"
```


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