Skip to main content
POST
llama-guard-4-12b: Moderations
Meta’s Llama Guard 4 12B is a multimodal safety classification model for moderating text, images, and mixed text-image inputs. It evaluates both incoming prompts and generated responses, returning a safe or unsafe classification along with the policy categories a violation falls under. It handles multilingual text and multiple images in one call, which makes it a fit for chat moderation, prompt and response filtering, policy enforcement, and agent guardrails. Built on a dense 12B architecture derived from Llama 4 Scout, it is designed as a dedicated safety layer in front of a production model rather than as a general-purpose generator.
References: Model docsTermsPrivacy

Authorizations

x-api-key
string
header
required

Headers

x-project-id
string

Optional project identifier. Scopes the request to a specific project when provided.

Body

application/json
model
string
default:llama-guard-4-12b
required

Model identifier (fixed for this playground).

Allowed value: "llama-guard-4-12b"
Example:

"llama-guard-4-12b"

input
required

Text to classify. Accepts a single string, an array of strings (one result per element), or an array of content parts ({ "type": "text", "text": "..." }) that form a single multi-modal input.

Required string length: 1 - 131072

Response

Success

OpenAI-compatible moderations envelope. One results entry per input.

id
string

Unique identifier for the moderation request.

Example:

"modr-0a1b2c3d4e5f60718293a4b5c6d7e8f90"

model
string

The model used for classification.

Example:

"llama-guard-4-12b"

results
object[]

Moderation verdicts, one per input (a string input yields a single-element array).