# Curtain (`curtain-1`): NSFW image detection

Keep explicit images out of your uploads.

Curtain scores an image as safe or NSFW (nudity and explicit sexual content). Run it on uploads, avatars and generated images before anyone sees them.

- **Price:** $0.10 per 1,000 images. One unit per image.
- **Languages:** Not applicable
- **Input:** An image: an https URL, a data URL (`data:image/png;base64,...`), or a file in a multipart upload. JPEG, PNG, WebP, GIF, AVIF or TIFF, up to 10 MB.
- **Batch:** no, one input per call
- **Status:** live
- **Built on:** [AdamCodd/vit-base-nsfw-detector](https://huggingface.co/AdamCodd/vit-base-nsfw-detector), Apache-2.0, 86M (ViT-base)

## Request

```bash
curl https://labs.greatwork.company/v1/run \
  -H "Authorization: Bearer $GWL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"curtain-1","input":"https://labs.greatwork.company/examples/street.jpg"}'
```

Upload a local file with multipart: `curl https://labs.greatwork.company/v1/run -H "Authorization: Bearer $GWL_API_KEY" -F model=curtain-1 -F input=@file`

## Options

| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| `input` | image (URL, data URL or upload) | yes | | An image: an https URL, a data URL (`data:image/png;base64,...`), or a file in a multipart upload. JPEG, PNG, WebP, GIF, AVIF or TIFF, up to 10 MB. |
| `threshold` | number | no | `0.5` | Score at or above which an image counts as NSFW. |

## Output

| Field | Type | Description |
|---|---|---|
| `nsfw` | boolean | True when `score` is at or above `threshold`. |
| `score` | number | Probability the image is NSFW, 0 to 1. |

The response envelope is always `{"id", "object": "run", "model", "created", "output", "usage": {"units", "unit", "cost_usd", "cost_micros"}, "latency_ms"}`.

## Examples (real outputs from our servers)

### Street photo

```json
{
  "model": "curtain-1",
  "input": "https://labs.greatwork.company/examples/street.jpg"
}
```

```json
{
  "nsfw": false,
  "score": 0
}
```

1355 ms, $0.0001.

### Product photo

```json
{
  "model": "curtain-1",
  "input": "https://labs.greatwork.company/examples/product.jpg"
}
```

```json
{
  "nsfw": false,
  "score": 0
}
```

1701 ms, $0.0001.

## Good for

- Screen profile photos
- Filter user uploads on a marketplace
- Check AI-generated images before showing them
- Blur thumbnails in a feed

## Limits and caveats

- Covers nudity and sexual content only: not violence, gore or drugs.
- Art, swimwear and medical images can score high; keep a review step for edge cases.
