Pixazo APIImage Tools APIContent Safety
Pixazo APIImage Tools APIContent Safety

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.

Get API Key
Content Safety API

Models Version

WELCOME BONUS

Get $5 Free Credit on First Payment

No strings attached — add funds and get $5 bonus instantly

Claim Your $5 →

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.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour 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

ParameterTypeRequiredDefaultDescription
image_urlstringConditionalPublic 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_b64stringConditionalBase64-encoded image bytes, as an alternative to image_url (same size limits). Provide either image_url or image_b64.
categoriesarray<string>Noall fourRestrict analysis to a subset of ["Hate", "SelfHarm", "Sexual", "Violence"]. Omit to analyze all four.
severity_thresholdintegerNo2Minimum 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

FieldTypeDescription
flaggedbooleantrue = 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.
categoriesarrayOne entry per analyzed harm category.
categories[].categorystringThe harm category: Hate, SelfHarm, Sexual, or Violence.
categories[].severityintegerHow strongly that category was detected — 0, 2, 4, or 6 (see Severity Levels below).
severity_thresholdintegerThe threshold applied to this request (minimum severity counted as flagged). Defaults to 2; override per request.
msintegerServer-side processing time, in milliseconds.

What Each Category Detects

Every image is analyzed against these four harm categories.

CategoryCovers
SexualNudity & pornography, sexual acts and imagery, vulgar content, prostitution, abuse, and child exploitation/grooming (including forced or assault sexual content).
ViolencePhysical actions intended to hurt, injure, or kill; weapons & guns; gore, injury, and death; bullying & intimidation; domestic violence & physical abuse; terrorism; stalking.
HateAttacks 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.
SelfHarmSelf-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.

SeverityLevelMeaning
0SafeNo objectionable content detected in this category; content is appropriate.
2LowContent may be inappropriate in some contexts; low risk.
4MediumContent is inappropriate and should generally be filtered.
6HighContent is highly inappropriate or harmful and should be blocked.

Example: Sexual: 4 with severity_threshold: 2flagged: true (4 ≥ 2). The same image with severity_threshold: 6flagged: false (4 < 6).

What Each Level Means Per Category (images)

CategoryLow (2)Medium (4)High (6)
SexualSuggestive/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.
ViolenceWeapons 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.
HateStereotyping, 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.
SelfHarmScars, 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

HeaderRequiredDescription
Ocp-Apim-Subscription-KeyYesYour API subscription key
Content-TypeYesMust be application/json

Response Handling

StatusMeaning
200 OKAnalysis complete. Body contains flagged and per-category severity.
400 Bad RequestInvalid JSON, missing both image_url and image_b64, or invalid categories.
401 UnauthorizedMissing or invalid subscription key.
403 Insufficient BalanceWallet balance is too low to cover the request.
422 UnprocessableThe 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 RequestsRate limit exceeded. Retry after a short delay.
503 Service UnavailableModeration 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 (to 0 or 2) 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.

Content Safety 1.0 API Pricing

Your request will cost $0.002 per image.