---
title: "Cygnal Monitor"
method: POST
path: "/cygnal/monitor"
---

# Cygnal Monitor

`POST /cygnal/monitor`

Monitors content for policy violations.

This endpoint is used to check if the provided text contains harmful
content or violates a given set of policies.

Docs: [Guide](https://docs.grayswan.ai/cygnal/monitor-requests) |
[API Reference](https://docs.grayswan.ai/api-reference/cygnal/monitor)

## Request body

- CreateMonitorRequest
  - `text` string, nullable
  - `messages` MonitorMessage[], nullable
    - `role` 'system' | 'user' | 'assistant' | 'tool' | 'developer', required
    - `content` union
      - string
      - MonitorMessageContentPart[]
        - `type` string, required
        - `text` string, nullable
        - `source` object, nullable
        - `input` object, nullable
        - `name` string, nullable
        - `id` string, nullable
    - `tool_calls` ChatCompletionMessageFunctionToolCall[], nullable
      - `id` string, required
      - `function` Function, required — The function that the model called.
        - `arguments` string, required
        - `name` string, required
      - `type` 'function', required
    - `tool_call_id` string, nullable
    - `name` string, nullable
  - `tools` MonitorTool[], nullable
  - `metadata` object, nullable
  - `categories` union
    - object
    - string[]
    - object[]
  - `rules` union
    - object
    - string[]
    - object[]
  - `reasoning_mode` 'off' | 'thinking' | 'hybrid', nullable
  - `policy_id` string, nullable
  - `policy_ids` string[], nullable
  - `scanner_configs` object[], nullable
  - `litellm_metadata` object, nullable

## Response `200`

Successful Response

- MonitoringResponse — Response schema for monitoring/moderation results. Also used as the structure for pre_analysis and post_generation_analysis dicts in activity logging.
  - `violation` number
  - `observe_violation` number, nullable
  - `violated_rules` integer[]
  - `violated_rule_descriptions` RuleDescription[]
    - `rule` integer
    - `name` string
    - `description` string
  - `ignored_inputs` IgnoredInput[]
    - `type` 'media', required
    - `reason` 'text_moderation_only', required
    - `description` string, required
  - `ipi` boolean
  - `mutation` boolean
  - `scanner_output` object, nullable
  - `reasoning` string, nullable
  - `input_tokens` integer, nullable
  - `output_tokens` integer, nullable
  - `activity_id` string, nullable
  - `block_message` string, nullable
  - `applied_policies` AppliedPolicy[], nullable
    - `id` string, required
    - `name` string, required
  - `error` boolean
  - `error_message` string, nullable

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `422` — Unprocessable Content
- `500` — Internal Server Error

---

[API](https://skmtc.net/grayswan/apis/gray-swan-ai-api.md) · [All operations](https://skmtc.net/grayswan/apis/gray-swan-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/grayswan/gray-swan-ai-api/revisions/6ef1ea32ff13/schema)
