Methods: generateModeration(), createModeration()
Example
<?php
require 'vendor/autoload.php';
use AIStats\Sdk\AIStats;
$apiKey = getenv('AI_STATS_API_KEY');
$client = new AIStats(apiKey: $apiKey);
$response = $client->createModeration([
'model' => 'openai/omni-moderation-latest',
'input' => 'Text to classify'
]);
echo $response['results'][0]['flagged'] ? 'Flagged' : 'Not flagged';
Key parameters
model (required): Moderation model id (e.g., openai/omni-moderation-latest).
input (required): Content items (text or image_url).
- Optional:
categories/severity filters (when supported), user tag.
Returns
ModerationResponse Last modified on May 6, 2026