Skip to main content

Endpoint

POST /v1/moderate/batch
Analyzes multiple texts in a single request. More efficient than making multiple individual requests.

Request

Body Parameters

texts
array
required
Array of strings to moderateMin items: 1 Max items: 100 (recommended) Item type: string

Request Example

curl -X POST "http://localhost:8000/v1/moderate/batch" \
  -H "Content-Type: application/json" \
  -d '{
    "texts": [
      "First text to moderate",
      "Second text to moderate",
      "Third text to moderate"
    ]
  }'

Response

Success Response (200)

{
  "results": [
    {
      "text": "First text to moderate",
      "label": { ... },
      "ensemble": { ... },
      "meta": { ... }
    },
    {
      "text": "Second text to moderate",
      "label": { ... },
      "ensemble": { ... },
      "meta": { ... }
    }
  ],
  "total_processed": 2,
  "processing_time_ms": 48
}

Performance

MetricValue
Avg Time Per Text5-10ms (in batch)
Max Batch Size100 texts (recommended)
Total Time~500ms for 100 texts
Batch processing is 3-4x faster per text compared to individual requests due to model loading overhead amortization.