API Reference

Moderation

POST
/moderation
/moderation

The Authorization access token

Authorization

Authorization
Required
Bearer <token>

API Key

In: header

Request Body

application/jsonRequired

input
Required
Input

moderation_promptModerationPrompt

rewriteRewrite

curl -X POST "https://api.grayswan.ai/moderation" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "string",
    "moderation_prompt": "string",
    "rewrite": true
  }'

Successful Response

{
  "id": "string",
  "created": 0,
  "model": "string",
  "flagged": true,
  "passed": 0,
  "detected": 0,
  "rewrite": "string",
  "system_fingerprint": "string",
  "categories": [
    null
  ],
  "usage": {
    "completion_tokens": 0,
    "prompt_tokens": 0,
    "total_tokens": 0
  }
}