latestOpenAPI 3.1.02026-08-197104501.1 MB

8fbaab4fc7c5

Guardrails

Create Guardrail

Create a new guardrail

👉 Guardrail docs

Example Request:

curl -X POST "http://localhost:4000/guardrails" \
    -H "Authorization: Bearer <your_api_key>" \
    -H "Content-Type: application/json" \
    -d '{
        "guardrail": {
            "guardrail_name": "my-bedrock-guard",
            "litellm_params": {
                "guardrail": "bedrock",
                "mode": "pre_call",
                "guardrailIdentifier": "ff6ujrregl1q",
                "guardrailVersion": "DRAFT",
                "default_on": true
            },
            "guardrail_info": {
                "description": "Bedrock content moderation guardrail"
            }
        }
    }'

Example Response:

{
    "guardrail_id": "123e4567-e89b-12d3-a456-426614174000",
    "guardrail_name": "my-bedrock-guard",
    "litellm_params": {
        "guardrail": "bedrock",
        "mode": "pre_call",
        "guardrailIdentifier": "ff6ujrregl1q",
        "guardrailVersion": "DRAFT",
        "default_on": true
    },
    "guardrail_info": {
        "description": "Bedrock content moderation guardrail"
    },
    "created_at": "2023-11-09T12:34:56.789Z",
    "updated_at": "2023-11-09T12:34:56.789Z"
}
post/guardrails

Request body

Example request

{
  "guardrail": {
    "litellm_params": {
      "akto_base_url": "http://localhost:9090"
    }
  }
}

Response

Successful Response

{"stackTrail":"paths:/guardrails:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}