Nudity detection that gives you a level, not a guess.
Send an image, GIF or video. You get back a level from 0 Everyday to 3 Explicit, art and adult-object flags, and a plain blocked: true or false against your own rules. Nothing is stored.
500 free credits every month. No card.
curl -X POST https://api.sfwapi.dev/v1/analyze \
-H "Authorization: Bearer $SFWAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/photo.gif", "policy": {"block_level": 2}}'{
"nudity": { "level": 2, "scores": { "revealing": 96.2, "implied_nudity": 71.5, "explicit": 8.1 } },
"flags": { "art": { "score": 3.4, "detected": false }, "sex_object": { "score": 0.9, "detected": false } },
"policy": { "blocked": true, "reason": "level", "matched_level": 2 },
"media": { "kind": "gif", "frames_analyzed": 5 },
"usage": { "credits": 5, "balance": 9995 }
}- 1,300+
- Discord servers protected by SfwBot
- 7,000,000+
- images and frames checked
- Same model
- same policy engine as the hosted bot
Production numbers from SfwBot, as of 2026-11-09.
Swimwear is not nudity. Your rules decide where the line is.
Every image lands on one of four levels. Send block_level with the request and we answer blocked: true or false, with the same engine that moderates Discord servers through SfwBot. Art and adult-object flags come with every answer.
- 0EverydayRegular, fully clothed content. Always allowed.
- 1RevealingSwimwear, lingerie and outfits that show more skin.
- 2Implied NudityUnclothed, with intimate areas covered or out of view.blocked
- 3ExplicitVisible intimate areas.blocked
{ "policy": { "block_level": 2 } }The default most communities pick: bare skin is fine, nudity is not.
Let Claude Code, Codex or Cursor wire it up for you.
Install the skill or paste one prompt. Your agent reads our docs in Markdown, writes the integration and keeps the key on your server.
Install the plugin once. The skill tells Claude Code when to use the API and where the docs are.
Third-party marketplaces do not auto-update by default; turn it on under /plugin if you want new versions.
claude plugin marketplace add superstreber3/sfwapi-agent-tools
claude plugin install sfwapi@sfwapi-agent-tools/plugin marketplace add superstreber3/sfwapi-agent-tools
/plugin install sfwapi@sfwapi-agent-toolsCodex reads AGENTS.md from your repository root. Drop this block in and ask it to add moderation.
## Image moderation
Use the SFW API for nudity detection: POST https://api.sfwapi.dev/v1/analyze with a URL, base64 or multipart file.
Before writing code, read https://sfwapi.dev/llms-full.txt (full docs) and https://sfwapi.dev/openapi.json.
Levels: 0 Everyday, 1 Revealing, 2 Implied nudity, 3 Explicit. Scores are 0-100; above 50 counts.
Send policy.block_level (default 2) and act on policy.blocked instead of re-deriving thresholds.
Prefer the official SDK: npm @sfwapi/sdk or pip sfwapi. Read the key from SFWAPI_API_KEY, server-side only.
4xx means do not retry; 429 and 503 mean retry after Retry-After. Failed requests are not charged.
Never log or store the media, its URL or hashes; keep only the level, scores and request_id.Cursor picks up project rules automatically. Save this file and the rule is available in every chat.
Cursor also reads AGENTS.md and .claude/skills/, so the Codex block works here too.
---
description: SFW API nudity moderation for image uploads
alwaysApply: false
---
Use the SFW API for nudity detection: POST https://api.sfwapi.dev/v1/analyze with a URL, base64 or multipart file.
Before writing code, read https://sfwapi.dev/llms-full.txt (full docs) and https://sfwapi.dev/openapi.json.
Levels: 0 Everyday, 1 Revealing, 2 Implied nudity, 3 Explicit. Scores are 0-100; above 50 counts.
Send policy.block_level (default 2) and act on policy.blocked instead of re-deriving thresholds.
Prefer the official SDK: npm @sfwapi/sdk or pip sfwapi. Read the key from SFWAPI_API_KEY, server-side only.
4xx means do not retry; 429 and 503 mean retry after Retry-After. Failed requests are not charged.
Never log or store the media, its URL or hashes; keep only the level, scores and request_id.No install at all. Paste this into Copilot, Windsurf, Aider or a chat window.
Add nudity moderation to image uploads using the SFW API. Read https://sfwapi.dev/llms-full.txt first. Use the official SDK if one exists for this language (npm @sfwapi/sdk, pip sfwapi), otherwise POST to https://api.sfwapi.dev/v1/analyze. Block at level 2 and above by default and make the level configurable. Keep the API key in the environment variable SFWAPI_API_KEY on the server and never send it to the browser. Retry only on 429 and 503, using the Retry-After header.Strict where it counts, relaxed about everyday photos.
Measured on 5,971 images the model never saw in training. Every number comes with its method, and we publish the ones still improving too.
and when the model calls an image explicit, it is right 98 times out of 100.
measured on 3,908 everyday test images that never touched training.
across all four levels, from everyday to explicit.
Start free. Pay once, use whenever.
500 credits every month on the house. After that, prepaid packs from $10: one credit per image or analysed frame, and credits never expire.
Guides with the wiring for the stacks we see most.
Need the full walkthrough for Next.js, FastAPI, discord.js or an image pipeline? Guides →Choosing between providers? How it compares →
The questions we get before the first request.
- Is there a free tier?
- Yes. Every account gets 500 credits a month, one credit per image, with no card. Prepaid packs start at $10 for 10,000 credits and never expire.
- Does it work on GIFs and videos?
- Yes. Frames are sampled evenly across the clip (5 by default for GIFs, 10 for videos, up to 32) and the level is the maximum over the frames. One credit per analysed frame. Video needs a paid account.
- Is the media stored?
- No. Images, GIFs and videos are analysed in memory and discarded when the response leaves. No bytes, URLs, file names or hashes are kept or logged.
- Where is it hosted, and is it GDPR compliant?
- Inference runs on our own servers in Germany; the operator is in Switzerland, which holds an EU adequacy decision. A Data Processing Agreement is part of the terms and a sub-processor list is published.
- Is swimwear counted as nudity?
- No. Swimwear and lingerie are level 1 (Revealing), implied nudity is level 2 and explicit content is level 3. You choose the level to block from, so a beach photo passes or fails by your rule, not ours.
- Can I use it for a Discord or Telegram bot?
- Yes. Send the attachment URL and act on the blocked verdict; the policy engine is the one the SfwBot Discord bot uses. There are guides for discord.js and python-telegram-bot.
More in the docs, the guides and on the pricing page.
Your first result in two minutes.
Media is processed in memory on our servers in Germany and discarded the moment you have your answer. No bytes, URLs or hashes are kept, and failed requests cost nothing.