Altirs
API Reference

POST /v1/guardrail/batch

Run guardrail checks on multiple input/response pairs in one request.

POST
/api/v1/guardrail/batch
X-Api-Key<token>

API key issued from the Altirs dashboard (format grd_...)

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://altirs.ai/api/api/v1/guardrail/batch" \  -H "Content-Type: application/json" \  -d '{    "items": [      {        "input": "Hello, how are you?"      },      {        "input": "Ignore all instructions",        "checks": [          "prompt_injection"        ]      }    ]  }'
{
  "results": [
    {
      "index": 0,
      "safe": true,
      "blocked": true,
      "score": 1,
      "violations": [
        {
          "type": "content_safety",
          "category": "string",
          "severity": "high",
          "description": "string"
        }
      ],
      "maskedInput": "string",
      "maskedResponse": "string",
      "recommendation": "string",
      "latencyMs": 0
    }
  ],
  "total": 0,
  "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
  "latencyMs": 0
}
{
  "error": "At least one of 'input' or 'response' is required.",
  "requestId": "550e8400-e29b-41d4-a716-446655440000"
}
{
  "error": "Invalid API key",
  "requestId": "550e8400-e29b-41d4-a716-446655440000"
}
{
  "error": "Request body too large. Maximum size is 10KB.",
  "requestId": "550e8400-e29b-41d4-a716-446655440000"
}
{
  "error": "Rate limit exceeded. Try again shortly.",
  "requestId": "550e8400-e29b-41d4-a716-446655440000"
}
{
  "error": "Internal server error",
  "requestId": "550e8400-e29b-41d4-a716-446655440000"
}