Moderate Content
Endpoints
Moderate Content
Dialect-aware Arabic content moderation. Catches profanity and slang that Western APIs miss.
POST
Moderate Content
Dialect-aware Arabic content moderation powered by ALLaM. Understands profanity, slang, and offensive language differences across Gulf, Egyptian, Levantine, and MSA Arabic — catching what Western moderation APIs miss entirely.Documentation Index
Fetch the complete documentation index at: https://developers.trynawa.com/llms.txt
Use this file to discover all available pages before exploring further.
Cost: $0.004 per request (4 credits). Semantic cache hits are free (
X-NAWA-Cache: HIT).Request
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer nawa_live_sk_xxx or Bearer nawa_test_sk_xxx |
Content-Type | Yes | application/json |
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | The text to moderate. Max 5,000 characters. |
context | string | No | Where the text appears (e.g. “youtube comment”, “product review”). Helps the model calibrate. |
strictness | string | No | Moderation strictness: low, medium, high. Default: medium. |
platform | string | No | Source platform: youtube, instagram, twitter, facebook. |
- low — only flag severe content (explicit hate speech, extreme profanity, direct threats)
- medium — flag moderate and severe content (profanity, harassment, hate speech, spam)
- high — flag all potentially problematic content (mild profanity, borderline content, subtle insults)
Example request
Response
Safe content (200)
Flagged content (200)
When content is flagged, the response includes specific flags, severity scores, and a cleaned version of the text:Result fields
| Field | Type | Description |
|---|---|---|
text | string | The original input text |
is_safe | boolean | Whether the content passed moderation |
verdict | string | safe or flagged |
flags | array | List of triggered category names |
severity | string | Overall severity: none, low, medium, high |
severity_score | number | Severity score 0—1 |
language | string | Detected language: ar, en, or mixed |
dialect | string or null | Detected Arabic dialect. Null if not Arabic. |
categories | object | Boolean flags for each moderation category |
category_scores | object | Confidence scores 0—1 for each category |
flagged_terms | array | Specific problematic words/phrases found |
cleaned_text | string or null | Text with flagged terms replaced by ***. Null if safe. |
model | string | Model version used |
provider | string | AI provider used (allam or claude) |
fallback_used | boolean | Whether the fallback provider was used |
cached | boolean | Whether served from semantic cache |
cost_usd | number | Cost in USD |
credits_used | number | Credits deducted |
Moderation categories
| Category | Description |
|---|---|
profanity | Swearing, vulgar language, dialect-specific profanity |
hate_speech | Content targeting groups based on race, religion, ethnicity, etc. |
harassment | Personal attacks, bullying, intimidation |
sexual | Sexually explicit or suggestive content |
spam | Promotional content, repetitive text, link spam |
self_harm | Content promoting or describing self-harm |
violence | Threats, glorification of violence, graphic descriptions |
Examples
Safe Gulf Arabic content
Safe Gulf Arabic content
Input: “هذا محتوى رائع جدا”
Result: is_safe:
true, verdict: safe, severity: noneSpam detection
Spam detection
Input: “اشتركوا في قناتي الرابط في البايو!! فولو فولو فولو!!”
Result: is_safe:
false, flags: ["spam"], severity: lowHigh strictness catching mild content
High strictness catching mild content
Input: Borderline content that passes on medium but flags on high strictness
With platform context
With platform context
Input: Moderate a YouTube comment with platform context
Error responses
| Status | Type | When |
|---|---|---|
| 400 | invalid_request_error | Missing text. Invalid strictness or platform. Text too long. |
| 401 | authentication_error | Invalid or missing API key |
| 402 | insufficient_credits | No credits remaining |
| 429 | rate_limit_error | Rate limit exceeded |
| 500 | api_error | Internal or provider error |