Skip to main content
POST
このエンドポイントは、ユーザー生成コンテンツを model エンドポイントに送信する前にチェックするために使用します。modelinput の値を含む OpenAI 互換のモデレーションリクエストを送信してください。
bearer ヘッダーには CometAPI API キーを使用します: Authorization: Bearer $COMETAPI_KEY.

リクエスト本文

マルチモーダルモデレーションでは、それをサポートする model(omni-moderation-latest など)で OpenAI スタイルのマルチモーダル入力を送信します。公開画像 URL は CometAPI サーバーからダウンロード可能である必要があります。コピーして使える画像テストには、base64 data URL を使用してください。

リクエスト例

1 つのテキスト入力のみを分類する必要がある場合は、単一のテキスト文字列を送信します:
1 回のリクエストで複数のテキスト入力をチェックしたい場合は、文字列の配列を送信します:
CometAPI がダウンロードできる画像をモデレーション入力に含める場合は、テキストと画像 URL を一緒に送信します:
自己完結型の画像リクエストが必要な場合は、base64 data URL を使用します:

レスポンスの形状

レスポンスには idmodelresultsusage が含まれます。results の各項目には、対応する入力がフラグ付けされたかどうか、カテゴリごとのブール値、カテゴリスコア、および各カテゴリに適用された入力タイプが含まれます。バッチのテキストリクエストでは、results には入力文字列ごとに 1 つの項目が含まれます。課金および監視用のフィールドには usage を使用します。

承認

Authorization
string
header
必須

CometAPI API key used for model requests. Send it as Authorization: Bearer $COMETAPI_KEY.

ボディ

application/json
model
string
必須

Required moderation model ID. Use omni-moderation-latest for text and image moderation unless you have a specific moderation model requirement.

:

"omni-moderation-latest"

input
必須

Content to check. Use a string for one text input, an array of strings for batch text checks, or OpenAI-style multimodal parts such as text plus image_url when the selected model supports it.

:

"I want to check this text before sending it to a model."

レスポンス

Moderation decisions and token usage.

id
string
必須

Moderation request ID.

:

"modr-1594"

model
string
必須

Model used for moderation.

:

"omni-moderation-latest"

results
object[]
必須

Moderation decisions. For batch text input, this array contains one result per input string.

usage
object
必須

Token usage for the moderation request.