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 | API Reference

post/cygnal/monitor

Request

  • Base URL
    https://api.grayswan.ai
  • Auth
    • HTTP bearer
    • or API key in header x-grayswan-api-key
    • or API key in header grayswan-api-key
    • or API key in header x-gs-api-key
    • or API key in header gs-api-key
    • or API key in query parameter gs_api_key
  • TypeScript
    A function with typed inputs. Its response is checked against the schema.

Request body

textstring nullable
toolsMonitorTool[] nullable
metadataobject nullable
reasoning_mode'off' | 'thinking' | 'hybrid' nullable
policy_idstring nullable
policy_idsstring[] nullable
policy_version_idstring nullable

Evaluate against the policy as it existed at this version. Requires exactly one policy (policy_id or a single-element policy_ids) and is incompatible with no_policy and agent-attached policies.

policy_snapshot_idstring nullable

Evaluate against this policy snapshot (an argus-policy-versions ID, as stored in a policy's version_id). Same constraints as policy_version_id; the two are mutually exclusive.

scanner_configsobject[] nullable
litellm_metadataobject nullable

Response

Successful Response

violationnumber
observe_violationnumber nullable
violated_rulesinteger[]
ipiboolean
mutationboolean
scanner_outputobject nullable
reasoningstring nullable
input_tokensinteger nullable
output_tokensinteger nullable
activity_idstring nullable
block_messagestring nullable
errorboolean
error_messagestring nullable
judgment_deferredboolean

Changes

    • breaking

      the // request property type changed from object to no type

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • info

      the endpoint scheme security GraySwanBearer was added to the API

    • info

      the endpoint scheme security grayswan-api-key was added to the API

    • info

      the endpoint scheme security gs-api-key was added to the API

    • info

      the endpoint scheme security gs_api_key was added to the API

    • info

      the endpoint scheme security x-grayswan-api-key was added to the API

    • info

      the endpoint scheme security x-gs-api-key was added to the API

    • info

      added the new optional request property ///

    • info

      added the new optional request property

    • info

      added subschema #2: MonitorResponsesItem to the // request property anyOf list

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the optional property to the response with the status

    • breaking

      the response property const value text_moderation_only was removed for the status

    • breaking

      the response property const value media was removed for the status

    • warning

      added the new media enum value to the // response property for the response status

    • warning

      added the new text_moderation_only enum value to the // response property for the response status

    • warning

      added the new transcript enum value to the // response property for the response status

    • warning

      added the new unsupported_transcript_shape enum value to the // response property for the response status