Endpoint
Request
Body Parameters
array
required
Array of strings to moderateMin items: 1
Max items: 100 (recommended)
Item type: string
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Moderate multiple texts in batch
POST /v1/moderate/batch
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"
]
}'
from guardian_api import GuardianClient
client = GuardianClient(base_url="http://localhost:8000")
texts = [
"First text to moderate",
"Second text to moderate",
"Third text to moderate"
]
results = client.moderate_batch(texts)
print(results)
const client = new GuardianClient({ baseUrl: 'http://localhost:8000' });
const texts = [
'First text to moderate',
'Second text to moderate',
'Third text to moderate'
];
const results = await client.moderateBatch(texts);
console.log(results);
{
"results": [
{
"text": "First text to moderate",
"label": { ... },
"ensemble": { ... },
"meta": { ... }
},
{
"text": "Second text to moderate",
"label": { ... },
"ensemble": { ... },
"meta": { ... }
}
],
"total_processed": 2,
"processing_time_ms": 48
}
| Metric | Value |
|---|---|
| Avg Time Per Text | 5-10ms (in batch) |
| Max Batch Size | 100 texts (recommended) |
| Total Time | ~500ms for 100 texts |