> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lyzr.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Toxicity Checker

> Analyzes the input text for toxicity and returns the result.

### Endpoint

**POST** `/toxicity-meter/`

### Base URL

`https://rai-prod.studio.lyzr.ai`

### Authentication

API Key (`x-api-key`) must be included in the request header.

### Request Body

| Field        | Type   | Required | Description                       |
| ------------ | ------ | -------- | --------------------------------- |
| `input_text` | string | Yes      | The text to analyze for toxicity. |
| `agent_id`   | string | Yes      | The associated agent's unique ID. |
| `session_id` | string | Yes      | The current session's unique ID.  |
| `run_id`     | string | No       | Optional run ID for traceability. |

#### Example Request Body

```json theme={null}
{
  "input_text": "What the hell!"
  "agent_id": "67e3aff94c4db47d2999cdef",
  "session_id": "67e3aff94c4db47d2999cdef-g6bayx8ijn",
  "run_id": "string"
}

```


## OpenAPI

````yaml post /toxicity-meter/
openapi: 3.0.3
info:
  title: Toxicity Meter API
  version: 1.0.0
  description: Detects toxicity in user input.
servers:
  - url: https://rai-prod.studio.lyzr.ai
security: []
paths:
  /toxicity-meter/:
    post:
      tags:
        - Toxicity Meter
      summary: Get Toxicity
      description: Analyzes the input text for toxicity and returns the result.
      operationId: getToxicity
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - input_text
                - agent_id
                - session_id
              properties:
                input_text:
                  type: string
                  example: What the fuck!
                agent_id:
                  type: string
                  example: 67e3aff94c4db47d2999cdef
                session_id:
                  type: string
                  example: 67e3aff94c4db47d2999cdef-g6bayx8ijn
                run_id:
                  type: string
                  example: string
      responses:
        '200':
          description: Successful toxicity check
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: TOXIC
                  details:
                    type: object
                    properties:
                      is_toxic:
                        type: boolean
                        example: true
                      confidence:
                        type: number
                        format: float
                        example: 99.9
                  status_code:
                    type: integer
                    example: 200
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    items:
                      type: object
                      properties:
                        loc:
                          type: array
                          items:
                            type: string
                        msg:
                          type: string
                        type:
                          type: string
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````