Skip to main content
Guardrails CRUD API. The server hosts the documenation on this page in an interactive swagger UI. Typically these are available at localhost:8000/docs if you are running the server locally with default configurations.

Authentication

  • HTTP Authentication, scheme: bearer
  • API Key (ApiKeyAuth)
    • Parameter Name: authorization, in: header.

Service Health

get__health-check

GET /health-check
Example responses
200 Response

Responses

To perform this operation, you must be authenticated by means of one of the following methods: ApiKeyAuth, BearerAuth

guard

getGuards

GET /guards Fetches the configuration for all Guards the user has access to.
Example responses
200 Response

Responses

Response Schema

Status Code 200 anyOf or continued anyOf or allOf and and and anyOf or and and and continued anyOf or or anyOf anyOf or or or or or or anyOf or continued anyOf or or or continued anyOf or or continued anyOf or continued anyOf or continued allOf and continued

Enumerated Values

To perform this operation, you must be authenticated by means of one of the following methods: ApiKeyAuth, BearerAuth

createGuard

POST /guards Creates a Guard
Body parameter

Parameters

Enumerated Values

Example responses
200 Response

Responses

To perform this operation, you must be authenticated by means of one of the following methods: ApiKeyAuth, BearerAuth

getGuard

GET /guards/{guardName} Fetches a specific Guard

Parameters

Example responses
200 Response

Responses

To perform this operation, you must be authenticated by means of one of the following methods: ApiKeyAuth, BearerAuth

updateGuard

PUT /guards/{guardName} Updates a Guard
Body parameter

Parameters

Enumerated Values

Example responses
200 Response

Responses

To perform this operation, you must be authenticated by means of one of the following methods: ApiKeyAuth, BearerAuth

deleteGuard

DELETE /guards/{guardName} Deletes a Guard

Parameters

Example responses
200 Response

Responses

To perform this operation, you must be authenticated by means of one of the following methods: ApiKeyAuth, BearerAuth

getGuardHistory

GET /guards/{guardName}/history/{callId} Fetches the history for a specific Guard execution by using the id for the most recent Call

Parameters

Example responses
200 Response

Responses

Response Schema

Status Code 200 anyOf or or anyOf anyOf or or or or or or anyOf or continued anyOf or or or continued anyOf or or continued anyOf or continued anyOf or continued allOf and continued To perform this operation, you must be authenticated by means of one of the following methods: ApiKeyAuth, BearerAuth

openai

openaiChatCompletion

POST /guards/{guardName}/openai/v1/chat/completions OpenAI SDK compatible endpoint for Chat Completions
Body parameter

Parameters

Example responses
200 Response

Responses

To perform this operation, you must be authenticated by means of one of the following methods: ApiKeyAuth, BearerAuth

validate

validate

POST /guards/{guardName}/validate Runs the validations specified in a Guard
Body parameter

Parameters

Enumerated Values

Example responses
200 Response

Responses

To perform this operation, you must be authenticated by means of one of the following methods: ApiKeyAuth, BearerAuth

Schemas

OpenAIChatCompletionPayload

Properties

OpenAIChatCompletion

Properties

HttpError

Properties

HealthCheck

Properties

ValidationOutcome

Properties

None

primitives

Properties

anyOf or or or or

objects

Properties

arrays

Properties

anyOf or

any-type

AnyType

Properties

anyOf or or

validation-result

ValidationResult

Properties

Enumerated Values

error-span

ErrorSpan

Properties

fail-result

FailResult

Properties

reask

ReAsk

Properties

validation-outcome

ValidationOutcome

Properties

anyOf or or continued

Guard

Properties

None

schemaArray

Properties

None

nonNegativeInteger

Properties

nonNegativeIntegerDefault0

Properties

None

simpleTypes

Properties

None

stringArray

Properties

None

LLMResponse

Information from the LLM response.

Properties

CallInputs

CallInputs

Properties

allOf and

ValidatorReference

ValidatorReference

Properties

anyOf or continued

Enumerated Values

args-and-kwargs

ArgsAndKwargs

Properties

core

Core vocabulary meta-schema

Properties

applicator

Applicator vocabulary meta-schema

Properties

unevaluated

Unevaluated applicator vocabulary meta-schema

Properties

validation

Validation vocabulary meta-schema

Properties

anyOf or

meta-data

Meta-data vocabulary meta-schema

Properties

format-annotation

Format vocabulary meta-schema for annotation results

Properties

content

Content vocabulary meta-schema

Properties

schema

Core and Validation specifications meta-schema

Properties

anyOf or allOf and and and and and and

inputs

Inputs

Properties

pass-result

PassResult

Properties

validator-log

ValidatorLog

Properties

anyOf or continued anyOf or continued

outputs

Outputs

Properties

anyOf or or continued anyOf or or or continued anyOf or or continued

iteration

Iteration

Properties

call

Call

Properties

guard

Guard

Properties

ValidatePayload

Properties

LLMResource

Properties

Enumerated Values