---
title: "Create a moderation"
method: POST
path: "/v1/moderations"
---

# Create a moderation

`POST /v1/moderations`

Checks text or multimodal input with a moderation model. The response is OpenAI-compatible and returns one `results` item for each moderated input.

## Request body

- object
  - `model` string, required — Required moderation model ID. Use `omni-moderation-latest` for text and image moderation unless you have a specific moderation model requirement.
  - `input` union, required — 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.
    - string — One text input to classify.
    - string[] — Batch text inputs to classify in one request.
    - union[] — OpenAI-style multimodal input parts. Use a text part with an image_url part for image moderation. Public image URLs must be downloadable by CometAPI servers; use a base64 data URL for a self-contained image request.
      - union
        - object
          - `type` 'text', required — Text input part.
          - `text` string, required — Text to classify.
        - object
          - `type` 'image_url', required — Image input part.
          - `image_url` object, required — Image container for image input. Provide `url` with an HTTPS URL or a base64 data URL.
            - `url` string, required — Publicly downloadable image URL or base64 data URL.

## Response `200`

Moderation decisions and token usage.

- CreateModerationResponse
  - `id` string, required — Moderation request ID.
  - `model` string, required — Model used for moderation.
  - `results` ModerationResult[], required — Moderation decisions. For batch text input, this array contains one result per input string.
    - `flagged` boolean, required — Whether this input item was flagged by any moderation category.
    - `categories` ModerationCategories, required — Boolean moderation category decisions for one input item.
      - `harassment` boolean — Whether the input matched the harassment moderation category.
      - `harassment/threatening` boolean — Whether the input matched the harassment/threatening moderation category.
      - `hate` boolean — Whether the input matched the hate moderation category.
      - `hate/threatening` boolean — Whether the input matched the hate/threatening moderation category.
      - `illicit` boolean — Whether the input matched the illicit moderation category.
      - `illicit/violent` boolean — Whether the input matched the illicit/violent moderation category.
      - `self-harm` boolean — Whether the input matched the self-harm moderation category.
      - `self-harm/intent` boolean — Whether the input matched the self-harm/intent moderation category.
      - `self-harm/instructions` boolean — Whether the input matched the self-harm/instructions moderation category.
      - `sexual` boolean — Whether the input matched the sexual moderation category.
      - `sexual/minors` boolean — Whether the input matched the sexual/minors moderation category.
      - `violence` boolean — Whether the input matched the violence moderation category.
      - `violence/graphic` boolean — Whether the input matched the violence/graphic moderation category.
    - `category_scores` ModerationCategoryScores, required — Moderation category confidence scores for one input item.
      - `harassment` number, float — Confidence score for the harassment moderation category.
      - `harassment/threatening` number, float — Confidence score for the harassment/threatening moderation category.
      - `hate` number, float — Confidence score for the hate moderation category.
      - `hate/threatening` number, float — Confidence score for the hate/threatening moderation category.
      - `illicit` number, float — Confidence score for the illicit moderation category.
      - `illicit/violent` number, float — Confidence score for the illicit/violent moderation category.
      - `self-harm` number, float — Confidence score for the self-harm moderation category.
      - `self-harm/intent` number, float — Confidence score for the self-harm/intent moderation category.
      - `self-harm/instructions` number, float — Confidence score for the self-harm/instructions moderation category.
      - `sexual` number, float — Confidence score for the sexual moderation category.
      - `sexual/minors` number, float — Confidence score for the sexual/minors moderation category.
      - `violence` number, float — Confidence score for the violence moderation category.
      - `violence/graphic` number, float — Confidence score for the violence/graphic moderation category.
    - `category_applied_input_types` ModerationCategoryAppliedInputTypes, required — Input part types considered for each moderation category.
      - `harassment` string[] — Input part types that were evaluated for the harassment category.
      - `harassment/threatening` string[] — Input part types that were evaluated for the harassment/threatening category.
      - `hate` string[] — Input part types that were evaluated for the hate category.
      - `hate/threatening` string[] — Input part types that were evaluated for the hate/threatening category.
      - `illicit` string[] — Input part types that were evaluated for the illicit category.
      - `illicit/violent` string[] — Input part types that were evaluated for the illicit/violent category.
      - `self-harm` string[] — Input part types that were evaluated for the self-harm category.
      - `self-harm/intent` string[] — Input part types that were evaluated for the self-harm/intent category.
      - `self-harm/instructions` string[] — Input part types that were evaluated for the self-harm/instructions category.
      - `sexual` string[] — Input part types that were evaluated for the sexual category.
      - `sexual/minors` string[] — Input part types that were evaluated for the sexual/minors category.
      - `violence` string[] — Input part types that were evaluated for the violence category.
      - `violence/graphic` string[] — Input part types that were evaluated for the violence/graphic category.
  - `usage` ModerationUsage, required — Token usage for the moderation request. Additional provider accounting fields can be present.
    - `prompt_tokens` integer — Input tokens counted for the request.
    - `completion_tokens` integer — Output tokens counted for the request.
    - `total_tokens` integer — Total tokens counted for the request.
    - `input_tokens` integer — Input token count when reported separately.
    - `output_tokens` integer — Output token count when reported separately.
    - `prompt_tokens_details` object, nullable — Detailed prompt token accounting when provided.
    - `completion_tokens_details` object, nullable — Detailed completion token accounting when provided.
    - `input_tokens_details` object, nullable — Detailed input token accounting when provided.
    - `claude_cache_creation_1_h_tokens` integer — One-hour cache creation tokens when reported by the provider accounting layer.
    - `claude_cache_creation_5_m_tokens` integer — Five-minute cache creation tokens when reported by the provider accounting layer.

## Other responses

- `400` — The request body is invalid or missing required input.
- `401` — The API key is missing or invalid.
- `503` — The selected moderation model is unavailable for the current account.

---

[API](https://skmtc.net/cometapi/apis/create-api-key.md) · [All operations](https://skmtc.net/cometapi/apis/create-api-key/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cometapi/create-api-key/versions/0863102dbf34/schema)
