Create a moderation
Use CometAPI POST /v1/moderations to check text or multimodal input with an OpenAI-compatible moderation request.
model and an input value.
Authorization: Bearer $COMETAPI_KEY.Request body
| Field | Type | Required | Description |
|---|---|---|---|
input | string or array | Yes | The 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. |
model | string | Yes | Moderation model ID. Use omni-moderation-latest for text and image moderation unless you have a specific moderation model requirement. |
omni-moderation-latest. Public image URLs must be downloadable by CometAPI servers. For a copyable image test, use a base64 data URL.
Request examples
Send a single text string when you only need to classify one text input:Response shape
The response includesid, model, results, and usage. Each item in results reports whether the matching input was flagged, category booleans, category scores, and input types applied to each category. For a batch text request, results contains one item per input string. Use usage for billing and monitoring fields.Authorizations
CometAPI API key used for model requests. Send it as Authorization: Bearer $COMETAPI_KEY.
Body
Required moderation model ID. Use omni-moderation-latest for text and image moderation unless you have a specific moderation model requirement.
"omni-moderation-latest"
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."
Response
Moderation decisions and token usage.
Moderation request ID.
"modr-1594"
Model used for moderation.
"omni-moderation-latest"
Moderation decisions. For batch text input, this array contains one result per input string.
Token usage for the moderation request. Additional provider accounting fields can be present.