---
title: "Apply Guardrail"
method: POST
path: "/guardrails/apply_guardrail"
---

# Apply Guardrail

`POST /guardrails/apply_guardrail`

Apply a guardrail to text input and return the processed result.

This endpoint allows testing guardrails by applying them to custom text inputs.

## Request body

- ApplyGuardrailRequest
  - `guardrail_name` string, required
  - `text` string, required
  - `language` string, nullable
  - `entities` PiiEntityType[], nullable
  - `input_type` string
  - `messages` object[], nullable

## Response `200`

Successful Response

- ApplyGuardrailResponse
  - `response_text` string, required

## Other responses

- `422` — Validation Error

## Changes

- **2026-08-30** `24ad9eaf6a00` — 1 info
  - api tag `guardrails` removed
- **2026-08-27** `4a06c3148b6c` — 1 info
  - api tag `guardrails` added
- **2026-08-13** `9dbf4ea7ee00` — 1 info
  - api tag `guardrails` removed

[Change history](https://skmtc.dev/flock/apis/litellm-api/changes/guardrails/apply_guardrail/post.md)

---

[API](https://skmtc.dev/flock/apis/litellm-api.md) · [All operations](https://skmtc.dev/flock/apis/litellm-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/flock/litellm-api/revisions/24ad9eaf6a00/schema)
