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.
Use it
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"
}'const res = await fetch("https://labs.greatwork.company/v1/run", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.GWL_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "curtain-1",
"input": "https://labs.greatwork.company/examples/street.jpg"
}),
});
const { output, usage } = await res.json();import os, requests
res = requests.post(
"https://labs.greatwork.company/v1/run",
headers={"Authorization": f"Bearer {os.environ['GWL_API_KEY']}"},
json={
"model": "curtain-1",
"input": "https://labs.greatwork.company/examples/street.jpg"
},
)
output = res.json()["output"]# Send a local file instead of a URL
curl https://labs.greatwork.company/v1/run \
-H "Authorization: Bearer $GWL_API_KEY" \
-F model=curtain-1 \
-F input=@photo.jpgSet GWL_API_KEY to a key from your dashboard. The bare name curtain works too and follows new versions.
Options
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.
| Name | Type | Default | What it does |
|---|---|---|---|
threshold | number | 0.5 | Score at or above which an image counts as NSFW. |
Output
| Field | Type | Meaning |
|---|---|---|
nsfw | boolean | True when score is at or above threshold. |
score | number | Probability the image is NSFW, 0 to 1. |
Every response wraps this in {"id", "model", "output", "usage": {"units", "unit", "cost_usd"}, "latency_ms"}.
Examples
Street photo
{
"model": "curtain-1",
"input": "/examples/street.jpg"
}{
"nsfw": false,
"score": 0
}Captured on our production servers: 1355 ms, 1 image, $0.0001.
Product photo
{
"model": "curtain-1",
"input": "/examples/product.jpg"
}{
"nsfw": false,
"score": 0
}Captured on our production servers: 1701 ms, 1 image, $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.
Pricing
$0.10 per 1,000 images. One unit per image. Failed calls aren't charged, and a call never costs more than its estimate (POST /v1/estimate tells you before you run it).
Built on
AdamCodd/vit-base-nsfw-detector, 86M (ViT-base) parameters. License: Apache-2.0. We run it on our servers.