Content Safety API - AI Image Moderation & NSFW Detection: Pricing, Documentation
by Pixazo
Content Safety API call. Pass an image_url and the endpoint returns a flagged verdict plus per-category severity scores for Sexual, Violence, Hate and Self-Harm, measured against a configurable severity_threshold. Responses are synchronous, so there is no polling step. Images must be under 4MB.

Models Version
Get $5 Free Credit on First Payment
No strings attached — add funds and get $5 bonus instantly
Content Safety 1.0 API Documentation
POST https://gateway.pixazo.ai/content-safety/v1/image-moderation
Authentication
All requests require an API key passed via header.
| Header | Type | Required | Description |
|---|---|---|---|
| Ocp-Apim-Subscription-Key | string | Yes | Your API subscription key |
Image Moderation - Content Safety
Analyze an image for objectionable content across four harm categories (Hate, SelfHarm, Sexual, Violence). The response returns a per-category severity (0 Safe, 2 Low, 4 Medium, 6 High) and a single flagged boolean. Synchronous — the verdict is returned in one call (typically under 1 second).
Request Code
POST /content-safety/v1/image-moderation HTTP/1.1
Host: gateway.pixazo.ai
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY
Content-Type: application/json
{
"image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/doc-assets/images/input.jpg"
}
import requests
url = "https://gateway.pixazo.ai/content-safety/v1/image-moderation"
headers = {
"Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY",
"Content-Type": "application/json",
}
payload = {"image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/doc-assets/images/input.jpg"}
resp = requests.post(url, headers=headers, json=payload)
print(resp.json())
const res = await fetch("https://gateway.pixazo.ai/content-safety/v1/image-moderation", {
method: "POST",
headers: {
"Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({ image_url: "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/doc-assets/images/input.jpg" }),
});
const data = await res.json();
console.log(data);
curl -X POST "https://gateway.pixazo.ai/content-safety/v1/image-moderation" \
-H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
-H "Content-Type: application/json" \
-d '{"image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/doc-assets/images/input.jpg"}'
Output
{
"flagged": false,
"categories": [
{ "category": "Sexual", "severity": 0 },
{ "category": "Violence", "severity": 0 },
{ "category": "Hate", "severity": 0 },
{ "category": "SelfHarm", "severity": 0 }
],
"severity_threshold": 2,
"ms": 414
}
Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| image_url | string | Conditional | — | Public http(s) URL of the image to analyze. Must return an image/* content-type and be ≤ 4 MB (50×50 to 2048×2048 px). Provide either image_url or image_b64. |
| image_b64 | string | Conditional | — | Base64-encoded image bytes, as an alternative to image_url (same size limits). Provide either image_url or image_b64. |
| categories | array<string> | No | all four | Restrict analysis to a subset of ["Hate", "SelfHarm", "Sexual", "Violence"]. Omit to analyze all four. |
| severity_threshold | integer | No | 2 | Minimum severity (0, 2, 4, 6) counted as flagged. 2 = Low and up (strict), 4 = Medium/High only, 6 = High only. Clamped to 0–6. |
Severity levels returned per category: 0 Safe, 2 Low, 4 Medium, 6 High.
Example Request
{
"image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/doc-assets/images/input.jpg",
"categories": ["Sexual", "Violence"],
"severity_threshold": 4
}
Example Response
{
"flagged": false,
"categories": [
{ "category": "Sexual", "severity": 0 },
{ "category": "Violence", "severity": 2 }
],
"severity_threshold": 4,
"ms": 512
}
Response Fields
| Field | Type | Description |
|---|---|---|
flagged | boolean | true = at least one category's severity is ≥ severity_threshold, so the image should be blocked or sent for review. false = every category is below the threshold (safe to allow). Use the per-category severity values to decide how to handle a flagged image. |
categories | array | One entry per analyzed harm category. |
categories[].category | string | The harm category: Hate, SelfHarm, Sexual, or Violence. |
categories[].severity | integer | How strongly that category was detected — 0, 2, 4, or 6 (see Severity Levels below). |
severity_threshold | integer | The threshold applied to this request (minimum severity counted as flagged). Defaults to 2; override per request. |
ms | integer | Server-side processing time, in milliseconds. |
What Each Category Detects
Every image is analyzed against these four harm categories.
| Category | Covers |
|---|---|
| Sexual | Nudity & pornography, sexual acts and imagery, vulgar content, prostitution, abuse, and child exploitation/grooming (including forced or assault sexual content). |
| Violence | Physical actions intended to hurt, injure, or kill; weapons & guns; gore, injury, and death; bullying & intimidation; domestic violence & physical abuse; terrorism; stalking. |
| Hate | Attacks or discriminatory content targeting identity attributes — race, ethnicity, nationality, gender identity/expression, sexual orientation, religion, appearance/body size, disability — plus harassment, bullying, and hate symbols. |
| SelfHarm | Self-injury, suicide, and related acts; eating disorders; and bullying/intimidation that promotes self-harm. |
Severity Levels
Each category returns one of four severity levels. flagged is true when any category's severity is at or above severity_threshold.
| Severity | Level | Meaning |
|---|---|---|
| 0 | Safe | No objectionable content detected in this category; content is appropriate. |
| 2 | Low | Content may be inappropriate in some contexts; low risk. |
| 4 | Medium | Content is inappropriate and should generally be filtered. |
| 6 | High | Content is highly inappropriate or harmful and should be blocked. |
Example: Sexual: 4 with severity_threshold: 2 → flagged: true (4 ≥ 2). The same image with severity_threshold: 6 → flagged: false (4 < 6).
What Each Level Means Per Category (images)
| Category | Low (2) | Medium (4) | High (6) |
|---|---|---|---|
| Sexual | Suggestive/racy poses, non-graphic nudity in artwork, body art. | Erotic or soft-nude content, obscured/partial sexual activity. | Explicit sexual acts & organs, CSAM, non-consensual acts. |
| Violence | Weapons or bladed tools in display or use, light injury, non-realistic violence. | Moderate gore; domestic violence & physical abuse; use of force/coercion to intimidate an individual; a weapon used against a target. | High gore, graphic injury/death, dismemberment, terrorism. |
| Hate | Stereotyping, biased sentiment, certain hate symbols in context. | Insults, mocking, dehumanization, promotion of exclusion of an identity group. | Hate-speech/hate-crime imagery, glorified extremist/hate symbols. |
| SelfHarm | Scars, self-harm tools/injury in recovery, emaciation. | Mocking survivors; self-harm shown as a solution; moderate gore. | Explicit self-harm or suicide acts, high gore. |
Request Headers
| Header | Required | Description |
|---|---|---|
| Ocp-Apim-Subscription-Key | Yes | Your API subscription key |
| Content-Type | Yes | Must be application/json |
Response Handling
| Status | Meaning |
|---|---|
| 200 OK | Analysis complete. Body contains flagged and per-category severity. |
| 400 Bad Request | Invalid JSON, missing both image_url and image_b64, or invalid categories. |
| 401 Unauthorized | Missing or invalid subscription key. |
| 403 Insufficient Balance | Wallet balance is too low to cover the request. |
| 422 Unprocessable | The image could not be fetched or is not a valid/supported image (bad URL, non-image content-type, > 4 MB, or corrupt). |
| 429 Too Many Requests | Rate limit exceeded. Retry after a short delay. |
| 503 Service Unavailable | Moderation backend temporarily unavailable. Retry. |
Limitations & Best Practices
- Strong on graphic / explicit content — gore, weapons, visible injury, and explicit sexual imagery are detected reliably.
- May under-detect implied or staged scenes — a threatening pose or an intimidation scene without visible weapons, gore, or injury can score below the flag threshold even when a human reads it as harmful. Treat a low or zero score as “no graphic violation detected,” not a guarantee that the image is safe.
- Tune the threshold — lower
severity_threshold(to0or2) to catch borderline / suggestive content; raise it to flag only clear violations. - For high-stakes moderation, pair the API with human review of flagged and borderline content.