# Content Moderation API

The Content Moderation API allows you to analyze text content for policy violations, harassment, hate speech, and other harmful signals. It returns structured safety assessments.

> [!IMPORTANT]
> **Powered by Nova AI**
> This feature uses a specialized AI model optimized for safety classification. It is separate from the standard Chat Completions API.
>
> [official AI docs (Nova AI)](https://nova-ai.nabzclan.vip/user/developer/docs/content-moderation)

## Endpoint

**POST** `https://developer.nabzclan.vip/api/v1/moderation`

## Authentication

Include your API key in the `Authorization` header:

```bash
Authorization: Bearer YOUR_API_TOKEN
```

## Request Parameters

### Required
- **content** (string): The text content to analyze. Max 50,000 characters.

### Optional
- **policy** (string): Custom moderation policies to append to the model's rules. Max 10,000 characters.
- **instructions** (string): Additional instructions for the specific request. Max 2,000 characters.

## Response Format

```json
{
  "status": "ALLOWED",          // "ALLOWED" or "BLOCKED"
  "category": "SAFE",           // "SAFE", "HATE", "VIOLENCE", etc.
  "severity": "LOW",            // "LOW", "MEDIUM", "HIGH", "CRITICAL"
  "action": "ALLOW",            // "ALLOW", "WARN", "BLOCK", "ESCALATE"
  "reason": "...",              // Explanation
  "confidence": 0.99,           // 0.00 - 1.00
  "detected_signals": []        // List of specific triggers found
}
```

## Examples

### 1. Basic Content Check

```bash
curl -X POST https://developer.nabzclan.vip/api/v1/moderation \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "content": "Hello world"
  }'
```

### 2. Custom Policies

```bash
curl -X POST https://developer.nabzclan.vip/api/v1/moderation \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "content": "You are stupid",
    "policy": "#policy 1: block all insults",
    "instructions": "be strict"
  }'
```

### 3. Python Example

```python
import requests

url = "https://developer.nabzclan.vip/api/v1/moderation"
headers = {"Authorization": "Bearer YOUR_API", "Content-Type": "application/json"}
data = {
    "content": "Text to check...",
    "policy": "#policy 1: block spam"
}

response = requests.post(url, headers=headers, json=data)
print(response.json())
```
