Content Table

Prism Endpoint:

AI Moderator


Usage

Description

Leverage AI to detect unsafe content with deep context awareness. This endpoint assigns safety scores across 8 categories while adapting to the provided context. It can distinguish playful texts from genuine threats, ensuring accurate moderation for any environment.


Method & Path

Use https://prism.optical-labs.ca/text/ai-moderation to access this endpoint. The method must be POST and the header should contain your secret API key, as shown below:


Body Fields

Field Name Type Description
text String (required) Text with a length between 1 and 5000 characters
context String (optional) Text with a length between 0 and 200 characters
model String (optional) ID of the model used. One of: "prism-guard-flash" "prism-guard-pro"

Valid Response

Each successful request to this endpoint costs 10 to 12 credit, depending on the model used. Your usage and remaining credits are always returned in the meta object of the response.


Models

Name Description Cost/Request Execution Time*
prism-guard-flash (default) Fast, efficient, reliable. 10 credits 0.5 - 3 seconds
prism-guard-pro Deeper reasoning, higher intelligence. 12 credits 2 - 8 seconds

*Execution times vary based on input length. Expect higher latency for larger requests.


Interactive Preview

Because of the high-compute nature of this endpoint, the interactive preview is not available.


Examples

Basic Request

The simplest request you can make, using only the text field (not recommended):

The response includes the full configuration used for the request, including default values for any undefined parameters:


Custom Context

Add context to help the AI understand the situation:

The response includes the full configuration used for the request, including default values for any undefined parameters:


Pro Model

You can also use the pro model for greater intelligence at the cost of 2 extra credits: