> ## Documentation Index
> Fetch the complete documentation index at: https://snowglobe.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Guardrails Server Rest API

<Note>
  Guardrails CRUD API. The server hosts the documenation on this page in an interactive swagger UI. Typically these are available at [<u>localhost:8000/docs</u>](http://localhost:8000/docs) if you are running the server locally with default configurations.
</Note>

# **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

```python theme={null}
{
  "status": 0,
  "message": "string"
}
```

### **Responses**

| **Status** | **Meaning** | **Description** | **Schema** |
| :- | :- | :- | :- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | Returns the status of the server | [HealthCheck](https://guardrailsai.com/docs/guardrails_server_api/#healthcheck) |
| default | Default | Unexpected error | [HttpError](https://guardrailsai.com/docs/guardrails_server_api/#httperror) |

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

```python theme={null}
[
  {
    "id": "string",
    "name": "string",
    "description": "string",
    "validators": [
      {
        "id": "string",
        "on": "messages",
        "onFail": "exception",
        "args": [
          true
        ],
        "kwargs": {
          "property1": null,
          "property2": null
        }
      }
    ],
    "output_schema": {
      "definitions": {},
      "dependencies": {
        "property1": {},
        "property2": {}
      },
      "$anchor": "string",
      "$ref": "../dictionary",
      "$dynamicRef": "../dictionary",
      "$dynamicAnchor": "string",
      "$vocabulary": {
        "property1": true,
        "property2": true
      },
      "$comment": "string",
      "$defs": {},
      "prefixItems": [
        null
      ],
      "items": null,
      "contains": null,
      "additionalProperties": null,
      "properties": {},
      "patternProperties": {},
      "dependentSchemas": {
        "property1": null,
        "property2": null
      },
      "propertyNames": null,
      "if": null,
      "then": null,
      "else": null,
      "allOf": [
        null
      ],
      "anyOf": [
        null
      ],
      "oneOf": [
        null
      ],
      "not": null,
      "unevaluatedItems": null,
      "unevaluatedProperties": null,
      "multipleOf": 0,
      "maximum": 0,
      "exclusiveMaximum": 0,
      "minimum": 0,
      "exclusiveMinimum": 0,
      "maxLength": 0,
      "minLength": 0,
      "pattern": "/regex/",
      "maxItems": 0,
      "minItems": 0,
      "uniqueItems": false,
      "maxContains": 0,
      "minContains": 0,
      "maxProperties": 0,
      "minProperties": 0,
      "required": [],
      "dependentRequired": {
        "property1": [],
        "property2": []
      },
      "const": null,
      "enum": [
        null
      ],
      "type": "array",
      "title": "string",
      "description": "string",
      "default": null,
      "deprecated": false,
      "readOnly": false,
      "writeOnly": false,
      "examples": [
        null
      ],
      "format": "string",
      "contentMediaType": "string",
      "contentEncoding": "string",
      "contentSchema": null
    },
    "history": [
      {
        "id": "string",
        "iterations": [],
        "inputs": {
          "llmApi": "string",
          "llmOutput": "string",
          "messages": [
            {
              "property1": null,
              "property2": null
            }
          ],
          "promptParams": {
            "property1": null,
            "property2": null
          },
          "numReasks": 0,
          "metadata": {
            "property1": null,
            "property2": null
          },
          "fullSchemaReask": true,
          "stream": true,
          "args": [
            true
          ],
          "kwargs": {
            "property1": null,
            "property2": null
          }
        },
        "exception": "string"
      }
    ]
  }
]
```

### **Responses**

| **Status** | **Meaning** | **Description** | **Schema** |
| :- | :- | :- | :- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | A list of Guards. | Inline |
| default | Default | Unexpected error | [HttpError](https://guardrailsai.com/docs/guardrails_server_api/#httperror) |

### **Response Schema**

Status Code **200**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | \[[guard](https://guardrailsai.com/docs/guardrails_server_api/#guard)] | false | none | none |
| » Guard | [guard](https://guardrailsai.com/docs/guardrails_server_api/#guard) | false | none | none |
| »» id | string(kebab-case) | true | none | The unique identifier for the Guard. |
| »» name | string | true | none | The name for the Guard. |
| »» description | string | false | none | A description that concisely states the expected behaviour or purpose of the Guard. |
| »» validators | \[allOf] | false | none | none |
| »»» ValidatorReference | [ValidatorReference](https://guardrailsai.com/docs/guardrails_server_api/#validatorreference) | false | none | none |
| »»»» id | string | true | none | The unique identifier for this Validator; e.g. guardrails/regex\_match |
| »»»» on | any | false | none | A reference to the property this validator should be applied against. Can be a valid JSON path or a meta-property such as "messages" or "output" |

*anyOf*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»» *anonymous* | string | false | none | meta-property |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»» *anonymous* | string | false | none | JSON path to property; e.g. \$.[foo.bar](http://foo.bar) |

*continued*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»» onFail | string | false | none | none |
| »» output\_schema | [schema](https://guardrailsai.com/docs/guardrails_server_api/#schema) | false | none | none |
| »»» definitions | object | false | none | none |
| »»»» **additionalProperties** | any | false | none | none |
| »»» dependencies | object | false | none | none |
| »»»» **additionalProperties** | any | false | none | none |

*anyOf*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»» *anonymous* | any | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»» *anonymous* | \[string] | false | none | none |

*allOf*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»» *anonymous* | [core](https://guardrailsai.com/docs/guardrails_server_api/#core) | false | none | none |
| »»»» \$anchor | string | false | none | none |
| »»»» \$ref | string(uri-reference) | false | none | none |
| »»»» \$dynamicRef | string(uri-reference) | false | none | none |
| »»»» \$dynamicAnchor | string | false | none | none |
| »»»» \$vocabulary | object | false | none | none |
| »»»»» **additionalProperties** | boolean | false | none | none |
| »»»» \$comment | string | false | none | none |
| »»»» \$defs | object | false | none | none |
| »»»»» **additionalProperties** | any | false | none | none |

*and*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»» *anonymous* | [applicator](https://guardrailsai.com/docs/guardrails_server_api/#applicator) | false | none | none |
| »»»» prefixItems | \[any] | false | none | none |
| »»»» items | any | false | none | none |
| »»»» contains | any | false | none | none |
| »»»» additionalProperties | any | false | none | none |
| »»»» properties | object | false | none | none |
| »»»»» **additionalProperties** | any | false | none | none |
| »»»» patternProperties | object | false | none | none |
| »»»»» **additionalProperties** | any | false | none | none |
| »»»» dependentSchemas | object | false | none | none |
| »»»»» **additionalProperties** | any | false | none | none |
| »»»» propertyNames | any | false | none | none |
| »»»» if | any | false | none | none |
| »»»» then | any | false | none | none |
| »»»» else | any | false | none | none |
| »»»» allOf | \[any] | false | none | none |
| »»»» anyOf | \[any] | false | none | none |
| »»»» oneOf | \[any] | false | none | none |
| »»»» not | any | false | none | none |

*and*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»» *anonymous* | [unevaluated](https://guardrailsai.com/docs/guardrails_server_api/#unevaluated) | false | none | none |
| »»»» unevaluatedItems | any | false | none | none |
| »»»» unevaluatedProperties | any | false | none | none |

*and*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»» *anonymous* | [validation](https://guardrailsai.com/docs/guardrails_server_api/#validation) | false | none | none |
| »»»» multipleOf | number | false | none | none |
| »»»» maximum | number | false | none | none |
| »»»» exclusiveMaximum | number | false | none | none |
| »»»» minimum | number | false | none | none |
| »»»» exclusiveMinimum | number | false | none | none |
| »»»» maxLength | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none | none |
| »»»» minLength | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none | none |
| »»»» pattern | string(regex) | false | none | none |
| »»»» maxItems | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none | none |
| »»»» minItems | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none | none |
| »»»» uniqueItems | boolean | false | none | none |
| »»»» maxContains | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none | none |
| »»»» minContains | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none | none |
| »»»» maxProperties | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none | none |
| »»»» minProperties | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none | none |
| »»»» required | \[string] | false | none | none |
| »»»» dependentRequired | object | false | none | none |
| »»»»» **additionalProperties** | \[string] | false | none | none |
| »»»» const | any | false | none | none |
| »»»» enum | \[any] | false | none | none |
| »»»» type | any | false | none | none |

*anyOf*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»» *anonymous* | any | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»» *anonymous* | \[[simpleTypes](https://guardrailsai.com/docs/guardrails_server_api/#simpletypes)] | false | none | none |

*and*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»» *anonymous* | [meta-data](https://guardrailsai.com/docs/guardrails_server_api/#meta-data) | false | none | none |
| »»»» title | string | false | none | none |
| »»»» description | string | false | none | none |
| »»»» default | any | false | none | none |
| »»»» deprecated | boolean | false | none | none |
| »»»» readOnly | boolean | false | none | none |
| »»»» writeOnly | boolean | false | none | none |
| »»»» examples | \[any] | false | none | none |

*and*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»» *anonymous* | [format-annotation](https://guardrailsai.com/docs/guardrails_server_api/#format-annotation) | false | none | none |
| »»»» format | string | false | none | none |

*and*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»» *anonymous* | [content](https://guardrailsai.com/docs/guardrails_server_api/#content) | false | none | none |
| »»»» contentMediaType | string | false | none | none |
| »»»» contentEncoding | string | false | none | none |
| »»»» contentSchema | any | false | none | none |

*continued*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »» history | \[[call](https://guardrailsai.com/docs/guardrails_server_api/#call)] | false | read-only | none |
| »»» Call | [call](https://guardrailsai.com/docs/guardrails_server_api/#call) | false | none | none |
| »»»» id | string | true | none | The unique identifier for this Call. Can be used as an identifier for a specific execution of a Guard. |
| »»»» iterations | \[[iteration](https://guardrailsai.com/docs/guardrails_server_api/#iteration)] | false | none | none |
| »»»»» Iteration | [iteration](https://guardrailsai.com/docs/guardrails_server_api/#iteration) | false | none | none |
| »»»»»» id | string | true | none | The unique identifier for this Call. Can be used as an identifier for a specific execution of a Guard. |
| »»»»»» index | integer | true | none | The zero-based index of this iteration within the current Call. |
| »»»»»» callId | string | true | none | The unique identifier for the Call that this iteration is a part of. |
| »»»»»» inputs | [inputs](https://guardrailsai.com/docs/guardrails_server_api/#inputs) | false | none | none |
| »»»»»»» llmApi | string | false | none | The LLM resource targeted by the user. e.g. [openai.chat](http://openai.chat).completions.create |
| »»»»»»» llmOutput | string | false | none | The string output from an external LLM call provided by the user via Guard.parse. |
| »»»»»»» messages | \[object] | false | none | The message history for chat models. |
| »»»»»»»» **additionalProperties** | any | false | none | none |
| »»»»»»» promptParams | object | false | none | Parameters to be formatted into the prompt. |
| »»»»»»»» **additionalProperties** | any | false | none | none |
| »»»»»»» numReasks | integer | false | none | The total number of times the LLM can be called to correct output excluding the initial call. |
| »»»»»»» metadata | object | false | none | Additional data to be used by Validators during execution time. |
| »»»»»»»» **additionalProperties** | any | false | none | none |
| »»»»»»» fullSchemaReask | boolean | false | none | Whether to perform reasks for the entire schema rather than for individual fields. |
| »»»»»»» stream | boolean | false | none | Whether to use streaming. |
| »»»»»» outputs | [outputs](https://guardrailsai.com/docs/guardrails_server_api/#outputs) | false | none | none |
| »»»»»»» llmResponseInfo | [LLMResponse](https://guardrailsai.com/docs/guardrails_server_api/#llmresponse) | false | none | Information from the LLM response. |
| »»»»»»»» promptTokenCount | integer | false | none | none |
| »»»»»»»» responseTokenCount | integer | false | none | none |
| »»»»»»»» output | string | true | none | none |
| »»»»»»»» streamOutput | \[string] | false | none | none |
| »»»»»»»» asyncStreamOutput | \[string] | false | none | none |
| »»»»»»» rawOutput | string | false | none | The string content from the LLM response. |
| »»»»»»» parsedOutput | any | false | none | none |

*anyOf*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»» *anonymous* | string | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»» *anonymous* | object | false | none | none |
| »»»»»»»»» **additionalProperties** | any | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»» *anonymous* | \[anyOf] | false | none | none |
| »»»»»»»»» AnyType | any | false | none | none |

*anyOf*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»»» *anonymous* | any | false | none | none |

*anyOf*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»»»» *anonymous* | boolean | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»»»» *anonymous* | integer | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»»»» *anonymous* | null | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»»»» *anonymous* | number | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»»»» *anonymous* | string | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»»» *anonymous* | [objects](https://guardrailsai.com/docs/guardrails_server_api/#objects) | false | none | none |
| »»»»»»»»»»» **additionalProperties** | any | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»»» *anonymous* | \[anyOf] | false | none | none |

*anyOf*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»»»» *anonymous* | any | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»»»» *anonymous* | [objects](https://guardrailsai.com/docs/guardrails_server_api/#objects) | false | none | none |

*continued*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»» validationResponse | any | false | none | none |

*anyOf*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»» *anonymous* | string | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»» *anonymous* | [reask](https://guardrailsai.com/docs/guardrails_server_api/#reask) | false | none | none |
| »»»»»»»»» **additionalProperties** | any | false | none | none |
| »»»»»»»»» incorrectValue | any | false | none | none |
| »»»»»»»»» failResults | \[allOf] | false | none | none |
| »»»»»»»»»» FailResult | [fail-result](https://guardrailsai.com/docs/guardrails_server_api/#fail-result) | false | none | The output from a single Validator. |
| »»»»»»»»»»» outcome | any | true | none | none |
| »»»»»»»»»»» errorMessage | string | true | none | none |
| »»»»»»»»»»» fixValue | any | false | none | none |
| »»»»»»»»»»» errorSpans | \[[error-span](https://guardrailsai.com/docs/guardrails_server_api/#error-span)] | false | none | none |
| »»»»»»»»»»»» ErrorSpan | [error-span](https://guardrailsai.com/docs/guardrails_server_api/#error-span) | false | none | none |
| »»»»»»»»»»»»» start | integer | true | none | none |
| »»»»»»»»»»»»» end | integer | true | none | none |
| »»»»»»»»»»»»» reason | string | true | none | The reason validation failed, specific to this chunk. |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»» *anonymous* | object | false | none | none |
| »»»»»»»»» **additionalProperties** | any | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»» *anonymous* | \[anyOf] | false | none | none |
| »»»»»»»»» AnyType | any | false | none | none |

*continued*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»» guardedOutput | any | false | none | none |

*anyOf*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»» *anonymous* | string | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»» *anonymous* | object | false | none | none |
| »»»»»»»»» **additionalProperties** | any | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»» *anonymous* | \[anyOf] | false | none | none |
| »»»»»»»»» AnyType | any | false | none | none |

*continued*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»» reasks | \[[reask](https://guardrailsai.com/docs/guardrails_server_api/#reask)] | false | none | none |
| »»»»»»»» ReAsk | [reask](https://guardrailsai.com/docs/guardrails_server_api/#reask) | false | none | none |
| »»»»»»» validatorLogs | \[[validator-log](https://guardrailsai.com/docs/guardrails_server_api/#validator-log)] | false | none | none |
| »»»»»»»» ValidatorLog | [validator-log](https://guardrailsai.com/docs/guardrails_server_api/#validator-log) | false | none | none |
| »»»»»»»»» validatorName | string(PascalCase) | true | none | The class name of the validator. |
| »»»»»»»»» registeredName | string(kebab-case) | true | none | The registry id of the validator. |
| »»»»»»»»» instanceId | any | false | none | A unique identifier for the validator that produced this log within the session. |

*anyOf*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»»» *anonymous* | string | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»»» *anonymous* | integer | false | none | none |

*continued*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»» propertyPath | string | true | none | The JSON path to the property which was validated that produced this log. |
| »»»»»»»»» valueBeforeValidation | any | true | none | none |
| »»»»»»»»» valueAfterValidation | any | false | none | none |
| »»»»»»»»» validationResult | any | false | none | none |

*anyOf*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»»» *anonymous* | [pass-result](https://guardrailsai.com/docs/guardrails_server_api/#pass-result) | false | none | The output from a single Validator. |
| »»»»»»»»»»» outcome | any | true | none | none |
| »»»»»»»»»»» valueOverride | any | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»»» *anonymous* | [fail-result](https://guardrailsai.com/docs/guardrails_server_api/#fail-result) | false | none | The output from a single Validator. |
| »»»»»»»»»»» outcome | any | true | none | none |
| »»»»»»»»»»» errorMessage | string | true | none | none |
| »»»»»»»»»»» fixValue | any | false | none | none |
| »»»»»»»»»»» errorSpans | \[[error-span](https://guardrailsai.com/docs/guardrails_server_api/#error-span)] | false | none | none |

*continued*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»» startTime | string(date-time) | false | none | none |
| »»»»»»»»» endTime | string(date-time) | false | none | none |
| »»»»»»» error | string | false | none | The error message from any exception which interrupted the Guard execution process. |
| »»»» inputs | [CallInputs](https://guardrailsai.com/docs/guardrails_server_api/#callinputs) | false | none | none |

*allOf*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»» *anonymous* | [inputs](https://guardrailsai.com/docs/guardrails_server_api/#inputs) | false | none | none |

*and*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»» *anonymous* | [args-and-kwargs](https://guardrailsai.com/docs/guardrails_server_api/#args-and-kwargs) | false | none | none |
| »»»»»» args | \[anyOf] | false | none | none |
| »»»»»»» AnyType | any | false | none | none |
| »»»»»» kwargs | object | false | none | none |
| »»»»»»» **additionalProperties** | any | false | none | none |

*continued*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»» exception | string | false | none | none |

#### **Enumerated Values**

| **Property** | **Value** |
| :- | :- |
| *anonymous* | messages |
| *anonymous* | output |
| onFail | exception |
| onFail | filter |
| onFail | fix |
| onFail | fix\_reask |
| onFail | noop |
| onFail | reask |
| onFail | refrain |
| onFail | custom |
| *anonymous* | array |
| *anonymous* | boolean |
| *anonymous* | integer |
| *anonymous* | null |
| *anonymous* | number |
| *anonymous* | object |
| *anonymous* | string |

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

```python theme={null}
{
  "id": "string",
  "name": "string",
  "description": "string",
  "validators": [
    {
      "id": "string",
      "on": "messages",
      "onFail": "exception",
      "args": [
        true
      ],
      "kwargs": {
        "property1": null,
        "property2": null
      }
    }
  ],
  "output_schema": {
    "definitions": {},
    "dependencies": {
      "property1": {},
      "property2": {}
    },
    "$anchor": "string",
    "$ref": "../dictionary",
    "$dynamicRef": "../dictionary",
    "$dynamicAnchor": "string",
    "$vocabulary": {
      "property1": true,
      "property2": true
    },
    "$comment": "string",
    "$defs": {},
    "prefixItems": [
      null
    ],
    "items": null,
    "contains": null,
    "additionalProperties": null,
    "properties": {},
    "patternProperties": {},
    "dependentSchemas": {
      "property1": null,
      "property2": null
    },
    "propertyNames": null,
    "if": null,
    "then": null,
    "else": null,
    "allOf": [
      null
    ],
    "anyOf": [
      null
    ],
    "oneOf": [
      null
    ],
    "not": null,
    "unevaluatedItems": null,
    "unevaluatedProperties": null,
    "multipleOf": 0,
    "maximum": 0,
    "exclusiveMaximum": 0,
    "minimum": 0,
    "exclusiveMinimum": 0,
    "maxLength": 0,
    "minLength": 0,
    "pattern": "/regex/",
    "maxItems": 0,
    "minItems": 0,
    "uniqueItems": false,
    "maxContains": 0,
    "minContains": 0,
    "maxProperties": 0,
    "minProperties": 0,
    "required": [],
    "dependentRequired": {
      "property1": [],
      "property2": []
    },
    "const": null,
    "enum": [
      null
    ],
    "type": "array",
    "title": "string",
    "description": "string",
    "default": null,
    "deprecated": false,
    "readOnly": false,
    "writeOnly": false,
    "examples": [
      null
    ],
    "format": "string",
    "contentMediaType": "string",
    "contentEncoding": "string",
    "contentSchema": null
  }
}
```

### **Parameters**

| **Name** | **In** | **Type** | **Required** | **Description** |
| :- | :- | :- | :- | :- |
| body | body | [guard](https://guardrailsai.com/docs/guardrails_server_api/#guard) | true | none |
| » id | body | string(kebab-case) | true | The unique identifier for the Guard. |
| » name | body | string | true | The name for the Guard. |
| » description | body | string | false | A description that concisely states the expected behaviour or purpose of the Guard. |
| » validators | body | \[allOf] | false | none |
| »» ValidatorReference | body | [ValidatorReference](https://guardrailsai.com/docs/guardrails_server_api/#validatorreference) | false | none |
| »»» id | body | string | true | The unique identifier for this Validator; e.g. guardrails/regex\_match |
| »»» on | body | any | false | A reference to the property this validator should be applied against. Can be a valid JSON path or a meta-property such as "prompt" or "output" |
| »»»» *anonymous* | body | string | false | meta-property |
| »»»» *anonymous* | body | string | false | JSON path to property; e.g. \$.[foo.bar](http://foo.bar) |
| »»» onFail | body | string | false | none |
| » output\_schema | body | [schema](https://guardrailsai.com/docs/guardrails_server_api/#schema) | false | none |
| »» definitions | body | object | false | none |
| »»» **additionalProperties** | body | any | false | none |
| »» dependencies | body | object | false | none |
| »»» **additionalProperties** | body | any | false | none |
| »»»» *anonymous* | body | any | false | none |
| »»»» *anonymous* | body | \[string] | false | none |
| »» *anonymous* | body | [core](https://guardrailsai.com/docs/guardrails_server_api/#core) | false | none |
| »»» \$anchor | body | string | false | none |
| »»» \$ref | body | string(uri-reference) | false | none |
| »»» \$dynamicRef | body | string(uri-reference) | false | none |
| »»» \$dynamicAnchor | body | string | false | none |
| »»» \$vocabulary | body | object | false | none |
| »»»» **additionalProperties** | body | boolean | false | none |
| »»» \$comment | body | string | false | none |
| »»» \$defs | body | object | false | none |
| »»»» **additionalProperties** | body | any | false | none |
| »» *anonymous* | body | [applicator](https://guardrailsai.com/docs/guardrails_server_api/#applicator) | false | none |
| »»» prefixItems | body | \[any] | false | none |
| »»» items | body | any | false | none |
| »»» contains | body | any | false | none |
| »»» additionalProperties | body | any | false | none |
| »»» properties | body | object | false | none |
| »»»» **additionalProperties** | body | any | false | none |
| »»» patternProperties | body | object | false | none |
| »»»» **additionalProperties** | body | any | false | none |
| »»» dependentSchemas | body | object | false | none |
| »»»» **additionalProperties** | body | any | false | none |
| »»» propertyNames | body | any | false | none |
| »»» if | body | any | false | none |
| »»» then | body | any | false | none |
| »»» else | body | any | false | none |
| »»» allOf | body | \[any] | false | none |
| »»» anyOf | body | \[any] | false | none |
| »»» oneOf | body | \[any] | false | none |
| »»» not | body | any | false | none |
| »» *anonymous* | body | [unevaluated](https://guardrailsai.com/docs/guardrails_server_api/#unevaluated) | false | none |
| »»» unevaluatedItems | body | any | false | none |
| »»» unevaluatedProperties | body | any | false | none |
| »» *anonymous* | body | [validation](https://guardrailsai.com/docs/guardrails_server_api/#validation) | false | none |
| »»» multipleOf | body | number | false | none |
| »»» maximum | body | number | false | none |
| »»» exclusiveMaximum | body | number | false | none |
| »»» minimum | body | number | false | none |
| »»» exclusiveMinimum | body | number | false | none |
| »»» maxLength | body | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none |
| »»» minLength | body | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none |
| »»» pattern | body | string(regex) | false | none |
| »»» maxItems | body | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none |
| »»» minItems | body | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none |
| »»» uniqueItems | body | boolean | false | none |
| »»» maxContains | body | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none |
| »»» minContains | body | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none |
| »»» maxProperties | body | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none |
| »»» minProperties | body | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none |
| »»» required | body | \[string] | false | none |
| »»» dependentRequired | body | object | false | none |
| »»»» **additionalProperties** | body | \[string] | false | none |
| »»» const | body | any | false | none |
| »»» enum | body | \[any] | false | none |
| »»» type | body | any | false | none |
| »»»» *anonymous* | body | any | false | none |
| »»»» *anonymous* | body | \[[simpleTypes](https://guardrailsai.com/docs/guardrails_server_api/#simpletypes)] | false | none |
| »» *anonymous* | body | [meta-data](https://guardrailsai.com/docs/guardrails_server_api/#meta-data) | false | none |
| »»» title | body | string | false | none |
| »»» description | body | string | false | none |
| »»» default | body | any | false | none |
| »»» deprecated | body | boolean | false | none |
| »»» readOnly | body | boolean | false | none |
| »»» writeOnly | body | boolean | false | none |
| »»» examples | body | \[any] | false | none |
| »» *anonymous* | body | [format-annotation](https://guardrailsai.com/docs/guardrails_server_api/#format-annotation) | false | none |
| »»» format | body | string | false | none |
| »» *anonymous* | body | [content](https://guardrailsai.com/docs/guardrails_server_api/#content) | false | none |
| »»» contentMediaType | body | string | false | none |
| »»» contentEncoding | body | string | false | none |
| »»» contentSchema | body | any | false | none |
| » history | body | \[[call](https://guardrailsai.com/docs/guardrails_server_api/#call)] | false | none |
| »» Call | body | [call](https://guardrailsai.com/docs/guardrails_server_api/#call) | false | none |
| »»» id | body | string | true | The unique identifier for this Call. Can be used as an identifier for a specific execution of a Guard. |
| »»» iterations | body | \[[iteration](https://guardrailsai.com/docs/guardrails_server_api/#iteration)] | false | none |
| »»»» Iteration | body | [iteration](https://guardrailsai.com/docs/guardrails_server_api/#iteration) | false | none |
| »»»»» id | body | string | true | The unique identifier for this Call. Can be used as an identifier for a specific execution of a Guard. |
| »»»»» index | body | integer | true | The zero-based index of this iteration within the current Call. |
| »»»»» callId | body | string | true | The unique identifier for the Call that this iteration is a part of. |
| »»»»» inputs | body | [inputs](https://guardrailsai.com/docs/guardrails_server_api/#inputs) | false | none |
| »»»»»» llmApi | body | string | false | The LLM resource targeted by the user. e.g. [openai.chat](http://openai.chat).completions.create |
| »»»»»» llmOutput | body | string | false | The string output from an external LLM call provided by the user via Guard.parse. |
| »»»»»» messages | body | \[object] | false | The message history for chat models. |
| »»»»»»» **additionalProperties** | body | any | false | none |
| »»»»»» promptParams | body | object | false | Parameters to be formatted into the prompt. |
| »»»»»»» **additionalProperties** | body | any | false | none |
| »»»»»» numReasks | body | integer | false | The total number of times the LLM can be called to correct output excluding the initial call. |
| »»»»»» metadata | body | object | false | Additional data to be used by Validators during execution time. |
| »»»»»»» **additionalProperties** | body | any | false | none |
| »»»»»» fullSchemaReask | body | boolean | false | Whether to perform reasks for the entire schema rather than for individual fields. |
| »»»»»» stream | body | boolean | false | Whether to use streaming. |
| »»»»» outputs | body | [outputs](https://guardrailsai.com/docs/guardrails_server_api/#outputs) | false | none |
| »»»»»» llmResponseInfo | body | [LLMResponse](https://guardrailsai.com/docs/guardrails_server_api/#llmresponse) | false | Information from the LLM response. |
| »»»»»»» promptTokenCount | body | integer | false | none |
| »»»»»»» responseTokenCount | body | integer | false | none |
| »»»»»»» output | body | string | true | none |
| »»»»»»» streamOutput | body | \[string] | false | none |
| »»»»»»» asyncStreamOutput | body | \[string] | false | none |
| »»»»»» rawOutput | body | string | false | The string content from the LLM response. |
| »»»»»» parsedOutput | body | any | false | none |
| »»»»»»» *anonymous* | body | string | false | none |
| »»»»»»» *anonymous* | body | object | false | none |
| »»»»»»»» **additionalProperties** | body | any | false | none |
| »»»»»»» *anonymous* | body | \[anyOf] | false | none |
| »»»»»»»» AnyType | body | any | false | none |
| »»»»»»»»» *anonymous* | body | any | false | none |
| »»»»»»»»»» *anonymous* | body | boolean | false | none |
| »»»»»»»»»» *anonymous* | body | integer | false | none |
| »»»»»»»»»» *anonymous* | body | null | false | none |
| »»»»»»»»»» *anonymous* | body | number | false | none |
| »»»»»»»»»» *anonymous* | body | string | false | none |
| »»»»»»»»» *anonymous* | body | [objects](https://guardrailsai.com/docs/guardrails_server_api/#objects) | false | none |
| »»»»»»»»»» **additionalProperties** | body | any | false | none |
| »»»»»»»»» *anonymous* | body | \[anyOf] | false | none |
| »»»»»»»»»» *anonymous* | body | any | false | none |
| »»»»»»»»»» *anonymous* | body | [objects](https://guardrailsai.com/docs/guardrails_server_api/#objects) | false | none |
| »»»»»» validationResponse | body | any | false | none |
| »»»»»»» *anonymous* | body | string | false | none |
| »»»»»»» *anonymous* | body | [reask](https://guardrailsai.com/docs/guardrails_server_api/#reask) | false | none |
| »»»»»»»» **additionalProperties** | body | any | false | none |
| »»»»»»»» incorrectValue | body | any | false | none |
| »»»»»»»» failResults | body | \[allOf] | false | none |
| »»»»»»»»» FailResult | body | [fail-result](https://guardrailsai.com/docs/guardrails_server_api/#fail-result) | false | The output from a single Validator. |
| »»»»»»»»»» outcome | body | any | true | none |
| »»»»»»»»»» errorMessage | body | string | true | none |
| »»»»»»»»»» fixValue | body | any | false | none |
| »»»»»»»»»» errorSpans | body | \[[error-span](https://guardrailsai.com/docs/guardrails_server_api/#error-span)] | false | none |
| »»»»»»»»»»» ErrorSpan | body | [error-span](https://guardrailsai.com/docs/guardrails_server_api/#error-span) | false | none |
| »»»»»»»»»»»» start | body | integer | true | none |
| »»»»»»»»»»»» end | body | integer | true | none |
| »»»»»»»»»»»» reason | body | string | true | The reason validation failed, specific to this chunk. |
| »»»»»»» *anonymous* | body | object | false | none |
| »»»»»»»» **additionalProperties** | body | any | false | none |
| »»»»»»» *anonymous* | body | \[anyOf] | false | none |
| »»»»»»»» AnyType | body | any | false | none |
| »»»»»» guardedOutput | body | any | false | none |
| »»»»»»» *anonymous* | body | string | false | none |
| »»»»»»» *anonymous* | body | object | false | none |
| »»»»»»»» **additionalProperties** | body | any | false | none |
| »»»»»»» *anonymous* | body | \[anyOf] | false | none |
| »»»»»»»» AnyType | body | any | false | none |
| »»»»»» reasks | body | \[[reask](https://guardrailsai.com/docs/guardrails_server_api/#reask)] | false | none |
| »»»»»»» ReAsk | body | [reask](https://guardrailsai.com/docs/guardrails_server_api/#reask) | false | none |
| »»»»»» validatorLogs | body | \[[validator-log](https://guardrailsai.com/docs/guardrails_server_api/#validator-log)] | false | none |
| »»»»»»» ValidatorLog | body | [validator-log](https://guardrailsai.com/docs/guardrails_server_api/#validator-log) | false | none |
| »»»»»»»» validatorName | body | string(PascalCase) | true | The class name of the validator. |
| »»»»»»»» registeredName | body | string(kebab-case) | true | The registry id of the validator. |
| »»»»»»»» instanceId | body | any | false | A unique identifier for the validator that produced this log within the session. |
| »»»»»»»»» *anonymous* | body | string | false | none |
| »»»»»»»»» *anonymous* | body | integer | false | none |
| »»»»»»»» propertyPath | body | string | true | The JSON path to the property which was validated that produced this log. |
| »»»»»»»» valueBeforeValidation | body | any | true | none |
| »»»»»»»» valueAfterValidation | body | any | false | none |
| »»»»»»»» validationResult | body | any | false | none |
| »»»»»»»»» *anonymous* | body | [pass-result](https://guardrailsai.com/docs/guardrails_server_api/#pass-result) | false | The output from a single Validator. |
| »»»»»»»»»» outcome | body | any | true | none |
| »»»»»»»»»» valueOverride | body | any | false | none |
| »»»»»»»»» *anonymous* | body | [fail-result](https://guardrailsai.com/docs/guardrails_server_api/#fail-result) | false | The output from a single Validator. |
| »»»»»»»»»» outcome | body | any | true | none |
| »»»»»»»»»» errorMessage | body | string | true | none |
| »»»»»»»»»» fixValue | body | any | false | none |
| »»»»»»»»»» errorSpans | body | \[[error-span](https://guardrailsai.com/docs/guardrails_server_api/#error-span)] | false | none |
| »»»»»»»» startTime | body | string(date-time) | false | none |
| »»»»»»»» endTime | body | string(date-time) | false | none |
| »»»»»» error | body | string | false | The error message from any exception which interrupted the Guard execution process. |
| »»» inputs | body | [CallInputs](https://guardrailsai.com/docs/guardrails_server_api/#callinputs) | false | none |
| »»»» *anonymous* | body | [inputs](https://guardrailsai.com/docs/guardrails_server_api/#inputs) | false | none |
| »»»» *anonymous* | body | [args-and-kwargs](https://guardrailsai.com/docs/guardrails_server_api/#args-and-kwargs) | false | none |
| »»»»» args | body | \[anyOf] | false | none |
| »»»»»» AnyType | body | any | false | none |
| »»»»» kwargs | body | object | false | none |
| »»»»»» **additionalProperties** | body | any | false | none |
| »»» exception | body | string | false | none |

#### **Enumerated Values**

| **Parameter** | **Value** |
| :- | :- |
| »»»» *anonymous* | messages |
| »»»» *anonymous* | output |
| »»» onFail | exception |
| »»» onFail | filter |
| »»» onFail | fix |
| »»» onFail | fix\_reask |
| »»» onFail | noop |
| »»» onFail | reask |
| »»» onFail | refrain |
| »»» onFail | custom |
| »»»» *anonymous* | array |
| »»»» *anonymous* | boolean |
| »»»» *anonymous* | integer |
| »»»» *anonymous* | null |
| »»»» *anonymous* | number |
| »»»» *anonymous* | object |
| »»»» *anonymous* | string |
| »»»» *anonymous* | array |
| »»»» *anonymous* | boolean |
| »»»» *anonymous* | integer |
| »»»» *anonymous* | null |
| »»»» *anonymous* | number |
| »»»» *anonymous* | object |
| »»»» *anonymous* | string |

> Example responses

> 200 Response

```python theme={null}
{
  "id": "string",
  "name": "string",
  "description": "string",
  "validators": [
    {
      "id": "string",
      "on": "messages",
      "onFail": "exception",
      "args": [
        true
      ],
      "kwargs": {
        "property1": null,
        "property2": null
      }
    }
  ],
  "output_schema": {
    "definitions": {},
    "dependencies": {
      "property1": {},
      "property2": {}
    },
    "$anchor": "string",
    "$ref": "../dictionary",
    "$dynamicRef": "../dictionary",
    "$dynamicAnchor": "string",
    "$vocabulary": {
      "property1": true,
      "property2": true
    },
    "$comment": "string",
    "$defs": {},
    "prefixItems": [
      null
    ],
    "items": null,
    "contains": null,
    "additionalProperties": null,
    "properties": {},
    "patternProperties": {},
    "dependentSchemas": {
      "property1": null,
      "property2": null
    },
    "propertyNames": null,
    "if": null,
    "then": null,
    "else": null,
    "allOf": [
      null
    ],
    "anyOf": [
      null
    ],
    "oneOf": [
      null
    ],
    "not": null,
    "unevaluatedItems": null,
    "unevaluatedProperties": null,
    "multipleOf": 0,
    "maximum": 0,
    "exclusiveMaximum": 0,
    "minimum": 0,
    "exclusiveMinimum": 0,
    "maxLength": 0,
    "minLength": 0,
    "pattern": "/regex/",
    "maxItems": 0,
    "minItems": 0,
    "uniqueItems": false,
    "maxContains": 0,
    "minContains": 0,
    "maxProperties": 0,
    "minProperties": 0,
    "required": [],
    "dependentRequired": {
      "property1": [],
      "property2": []
    },
    "const": null,
    "enum": [
      null
    ],
    "type": "array",
    "title": "string",
    "description": "string",
    "default": null,
    "deprecated": false,
    "readOnly": false,
    "writeOnly": false,
    "examples": [
      null
    ],
    "format": "string",
    "contentMediaType": "string",
    "contentEncoding": "string",
    "contentSchema": null
  },
  "history": [
    {
      "id": "string",
      "iterations": [],
      "inputs": {
        "llmApi": "string",
        "llmOutput": "string",
        "messages": [
          {
            "property1": null,
            "property2": null
          }
        ],
        "promptParams": {
          "property1": null,
          "property2": null
        },
        "numReasks": 0,
        "metadata": {
          "property1": null,
          "property2": null
        },
        "fullSchemaReask": true,
        "stream": true,
        "args": [
          true
        ],
        "kwargs": {
          "property1": null,
          "property2": null
        }
      },
      "exception": "string"
    }
  ]
}
```

### **Responses**

| **Status** | **Meaning** | **Description** | **Schema** |
| :- | :- | :- | :- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | the new Guard | [guard](https://guardrailsai.com/docs/guardrails_server_api/#guard) |
| default | Default | Unexpected error | [HttpError](https://guardrailsai.com/docs/guardrails_server_api/#httperror) |

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**

| **Name** | **In** | **Type** | **Required** | **Description** |
| :- | :- | :- | :- | :- |
| guardName | path | string | true | Guard name |
| asOf | query | string(date-time) | false | Used to query for data as it existed at this date and time |

> Example responses

> 200 Response

```python theme={null}
{
  "id": "string",
  "name": "string",
  "description": "string",
  "validators": [
    {
      "id": "string",
      "on": "messages",
      "onFail": "exception",
      "args": [
        true
      ],
      "kwargs": {
        "property1": null,
        "property2": null
      }
    }
  ],
  "output_schema": {
    "definitions": {},
    "dependencies": {
      "property1": {},
      "property2": {}
    },
    "$anchor": "string",
    "$ref": "../dictionary",
    "$dynamicRef": "../dictionary",
    "$dynamicAnchor": "string",
    "$vocabulary": {
      "property1": true,
      "property2": true
    },
    "$comment": "string",
    "$defs": {},
    "prefixItems": [
      null
    ],
    "items": null,
    "contains": null,
    "additionalProperties": null,
    "properties": {},
    "patternProperties": {},
    "dependentSchemas": {
      "property1": null,
      "property2": null
    },
    "propertyNames": null,
    "if": null,
    "then": null,
    "else": null,
    "allOf": [
      null
    ],
    "anyOf": [
      null
    ],
    "oneOf": [
      null
    ],
    "not": null,
    "unevaluatedItems": null,
    "unevaluatedProperties": null,
    "multipleOf": 0,
    "maximum": 0,
    "exclusiveMaximum": 0,
    "minimum": 0,
    "exclusiveMinimum": 0,
    "maxLength": 0,
    "minLength": 0,
    "pattern": "/regex/",
    "maxItems": 0,
    "minItems": 0,
    "uniqueItems": false,
    "maxContains": 0,
    "minContains": 0,
    "maxProperties": 0,
    "minProperties": 0,
    "required": [],
    "dependentRequired": {
      "property1": [],
      "property2": []
    },
    "const": null,
    "enum": [
      null
    ],
    "type": "array",
    "title": "string",
    "description": "string",
    "default": null,
    "deprecated": false,
    "readOnly": false,
    "writeOnly": false,
    "examples": [
      null
    ],
    "format": "string",
    "contentMediaType": "string",
    "contentEncoding": "string",
    "contentSchema": null
  },
  "history": [
    {
      "id": "string",
      "iterations": [],
      "inputs": {
        "llmApi": "string",
        "llmOutput": "string",
        "messages": [
          {
            "property1": null,
            "property2": null
          }
        ],
        "promptParams": {
          "property1": null,
          "property2": null
        },
        "numReasks": 0,
        "metadata": {
          "property1": null,
          "property2": null
        },
        "fullSchemaReask": true,
        "stream": true,
        "args": [
          true
        ],
        "kwargs": {
          "property1": null,
          "property2": null
        }
      },
      "exception": "string"
    }
  ]
}
```

### **Responses**

| **Status** | **Meaning** | **Description** | **Schema** |
| :- | :- | :- | :- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | the fetched Guard | [guard](https://guardrailsai.com/docs/guardrails_server_api/#guard) |
| default | Default | Unexpected error | [HttpError](https://guardrailsai.com/docs/guardrails_server_api/#httperror) |

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

```python theme={null}
{
  "id": "string",
  "name": "string",
  "description": "string",
  "validators": [
    {
      "id": "string",
      "on": "messages",
      "onFail": "exception",
      "args": [
        true
      ],
      "kwargs": {
        "property1": null,
        "property2": null
      }
    }
  ],
  "output_schema": {
    "definitions": {},
    "dependencies": {
      "property1": {},
      "property2": {}
    },
    "$anchor": "string",
    "$ref": "../dictionary",
    "$dynamicRef": "../dictionary",
    "$dynamicAnchor": "string",
    "$vocabulary": {
      "property1": true,
      "property2": true
    },
    "$comment": "string",
    "$defs": {},
    "prefixItems": [
      null
    ],
    "items": null,
    "contains": null,
    "additionalProperties": null,
    "properties": {},
    "patternProperties": {},
    "dependentSchemas": {
      "property1": null,
      "property2": null
    },
    "propertyNames": null,
    "if": null,
    "then": null,
    "else": null,
    "allOf": [
      null
    ],
    "anyOf": [
      null
    ],
    "oneOf": [
      null
    ],
    "not": null,
    "unevaluatedItems": null,
    "unevaluatedProperties": null,
    "multipleOf": 0,
    "maximum": 0,
    "exclusiveMaximum": 0,
    "minimum": 0,
    "exclusiveMinimum": 0,
    "maxLength": 0,
    "minLength": 0,
    "pattern": "/regex/",
    "maxItems": 0,
    "minItems": 0,
    "uniqueItems": false,
    "maxContains": 0,
    "minContains": 0,
    "maxProperties": 0,
    "minProperties": 0,
    "required": [],
    "dependentRequired": {
      "property1": [],
      "property2": []
    },
    "const": null,
    "enum": [
      null
    ],
    "type": "array",
    "title": "string",
    "description": "string",
    "default": null,
    "deprecated": false,
    "readOnly": false,
    "writeOnly": false,
    "examples": [
      null
    ],
    "format": "string",
    "contentMediaType": "string",
    "contentEncoding": "string",
    "contentSchema": null
  }
}
```

### **Parameters**

| **Name** | **In** | **Type** | **Required** | **Description** |
| :- | :- | :- | :- | :- |
| guardName | path | string | true | Guard name |
| body | body | [guard](https://guardrailsai.com/docs/guardrails_server_api/#guard) | true | none |
| » id | body | string(kebab-case) | true | The unique identifier for the Guard. |
| » name | body | string | true | The name for the Guard. |
| » description | body | string | false | A description that concisely states the expected behaviour or purpose of the Guard. |
| » validators | body | \[allOf] | false | none |
| »» ValidatorReference | body | [ValidatorReference](https://guardrailsai.com/docs/guardrails_server_api/#validatorreference) | false | none |
| »»» id | body | string | true | The unique identifier for this Validator; e.g. guardrails/regex\_match |
| »»» on | body | any | false | A reference to the property this validator should be applied against. Can be a valid JSON path or a meta-property such as "prompt" or "output" |
| »»»» *anonymous* | body | string | false | meta-property |
| »»»» *anonymous* | body | string | false | JSON path to property; e.g. \$.[foo.bar](http://foo.bar) |
| »»» onFail | body | string | false | none |
| » output\_schema | body | [schema](https://guardrailsai.com/docs/guardrails_server_api/#schema) | false | none |
| »» definitions | body | object | false | none |
| »»» **additionalProperties** | body | any | false | none |
| »» dependencies | body | object | false | none |
| »»» **additionalProperties** | body | any | false | none |
| »»»» *anonymous* | body | any | false | none |
| »»»» *anonymous* | body | \[string] | false | none |
| »» *anonymous* | body | [core](https://guardrailsai.com/docs/guardrails_server_api/#core) | false | none |
| »»» \$anchor | body | string | false | none |
| »»» \$ref | body | string(uri-reference) | false | none |
| »»» \$dynamicRef | body | string(uri-reference) | false | none |
| »»» \$dynamicAnchor | body | string | false | none |
| »»» \$vocabulary | body | object | false | none |
| »»»» **additionalProperties** | body | boolean | false | none |
| »»» \$comment | body | string | false | none |
| »»» \$defs | body | object | false | none |
| »»»» **additionalProperties** | body | any | false | none |
| »» *anonymous* | body | [applicator](https://guardrailsai.com/docs/guardrails_server_api/#applicator) | false | none |
| »»» prefixItems | body | \[any] | false | none |
| »»» items | body | any | false | none |
| »»» contains | body | any | false | none |
| »»» additionalProperties | body | any | false | none |
| »»» properties | body | object | false | none |
| »»»» **additionalProperties** | body | any | false | none |
| »»» patternProperties | body | object | false | none |
| »»»» **additionalProperties** | body | any | false | none |
| »»» dependentSchemas | body | object | false | none |
| »»»» **additionalProperties** | body | any | false | none |
| »»» propertyNames | body | any | false | none |
| »»» if | body | any | false | none |
| »»» then | body | any | false | none |
| »»» else | body | any | false | none |
| »»» allOf | body | \[any] | false | none |
| »»» anyOf | body | \[any] | false | none |
| »»» oneOf | body | \[any] | false | none |
| »»» not | body | any | false | none |
| »» *anonymous* | body | [unevaluated](https://guardrailsai.com/docs/guardrails_server_api/#unevaluated) | false | none |
| »»» unevaluatedItems | body | any | false | none |
| »»» unevaluatedProperties | body | any | false | none |
| »» *anonymous* | body | [validation](https://guardrailsai.com/docs/guardrails_server_api/#validation) | false | none |
| »»» multipleOf | body | number | false | none |
| »»» maximum | body | number | false | none |
| »»» exclusiveMaximum | body | number | false | none |
| »»» minimum | body | number | false | none |
| »»» exclusiveMinimum | body | number | false | none |
| »»» maxLength | body | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none |
| »»» minLength | body | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none |
| »»» pattern | body | string(regex) | false | none |
| »»» maxItems | body | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none |
| »»» minItems | body | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none |
| »»» uniqueItems | body | boolean | false | none |
| »»» maxContains | body | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none |
| »»» minContains | body | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none |
| »»» maxProperties | body | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none |
| »»» minProperties | body | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none |
| »»» required | body | \[string] | false | none |
| »»» dependentRequired | body | object | false | none |
| »»»» **additionalProperties** | body | \[string] | false | none |
| »»» const | body | any | false | none |
| »»» enum | body | \[any] | false | none |
| »»» type | body | any | false | none |
| »»»» *anonymous* | body | any | false | none |
| »»»» *anonymous* | body | \[[simpleTypes](https://guardrailsai.com/docs/guardrails_server_api/#simpletypes)] | false | none |
| »» *anonymous* | body | [meta-data](https://guardrailsai.com/docs/guardrails_server_api/#meta-data) | false | none |
| »»» title | body | string | false | none |
| »»» description | body | string | false | none |
| »»» default | body | any | false | none |
| »»» deprecated | body | boolean | false | none |
| »»» readOnly | body | boolean | false | none |
| »»» writeOnly | body | boolean | false | none |
| »»» examples | body | \[any] | false | none |
| »» *anonymous* | body | [format-annotation](https://guardrailsai.com/docs/guardrails_server_api/#format-annotation) | false | none |
| »»» format | body | string | false | none |
| »» *anonymous* | body | [content](https://guardrailsai.com/docs/guardrails_server_api/#content) | false | none |
| »»» contentMediaType | body | string | false | none |
| »»» contentEncoding | body | string | false | none |
| »»» contentSchema | body | any | false | none |
| » history | body | \[[call](https://guardrailsai.com/docs/guardrails_server_api/#call)] | false | none |
| »» Call | body | [call](https://guardrailsai.com/docs/guardrails_server_api/#call) | false | none |
| »»» id | body | string | true | The unique identifier for this Call. Can be used as an identifier for a specific execution of a Guard. |
| »»» iterations | body | \[[iteration](https://guardrailsai.com/docs/guardrails_server_api/#iteration)] | false | none |
| »»»» Iteration | body | [iteration](https://guardrailsai.com/docs/guardrails_server_api/#iteration) | false | none |
| »»»»» id | body | string | true | The unique identifier for this Call. Can be used as an identifier for a specific execution of a Guard. |
| »»»»» index | body | integer | true | The zero-based index of this iteration within the current Call. |
| »»»»» callId | body | string | true | The unique identifier for the Call that this iteration is a part of. |
| »»»»» inputs | body | [inputs](https://guardrailsai.com/docs/guardrails_server_api/#inputs) | false | none |
| »»»»»» llmApi | body | string | false | The LLM resource targeted by the user. e.g. [openai.chat](http://openai.chat).completions.create |
| »»»»»» llmOutput | body | string | false | The string output from an external LLM call provided by the user via Guard.parse. |
| »»»»»» messages | body | \[object] | false | The message history for chat models. |
| »»»»»»» **additionalProperties** | body | any | false | none |
| »»»»»» promptParams | body | object | false | Parameters to be formatted into the prompt. |
| »»»»»»» **additionalProperties** | body | any | false | none |
| »»»»»» numReasks | body | integer | false | The total number of times the LLM can be called to correct output excluding the initial call. |
| »»»»»» metadata | body | object | false | Additional data to be used by Validators during execution time. |
| »»»»»»» **additionalProperties** | body | any | false | none |
| »»»»»» fullSchemaReask | body | boolean | false | Whether to perform reasks for the entire schema rather than for individual fields. |
| »»»»»» stream | body | boolean | false | Whether to use streaming. |
| »»»»» outputs | body | [outputs](https://guardrailsai.com/docs/guardrails_server_api/#outputs) | false | none |
| »»»»»» llmResponseInfo | body | [LLMResponse](https://guardrailsai.com/docs/guardrails_server_api/#llmresponse) | false | Information from the LLM response. |
| »»»»»»» promptTokenCount | body | integer | false | none |
| »»»»»»» responseTokenCount | body | integer | false | none |
| »»»»»»» output | body | string | true | none |
| »»»»»»» streamOutput | body | \[string] | false | none |
| »»»»»»» asyncStreamOutput | body | \[string] | false | none |
| »»»»»» rawOutput | body | string | false | The string content from the LLM response. |
| »»»»»» parsedOutput | body | any | false | none |
| »»»»»»» *anonymous* | body | string | false | none |
| »»»»»»» *anonymous* | body | object | false | none |
| »»»»»»»» **additionalProperties** | body | any | false | none |
| »»»»»»» *anonymous* | body | \[anyOf] | false | none |
| »»»»»»»» AnyType | body | any | false | none |
| »»»»»»»»» *anonymous* | body | any | false | none |
| »»»»»»»»»» *anonymous* | body | boolean | false | none |
| »»»»»»»»»» *anonymous* | body | integer | false | none |
| »»»»»»»»»» *anonymous* | body | null | false | none |
| »»»»»»»»»» *anonymous* | body | number | false | none |
| »»»»»»»»»» *anonymous* | body | string | false | none |
| »»»»»»»»» *anonymous* | body | [objects](https://guardrailsai.com/docs/guardrails_server_api/#objects) | false | none |
| »»»»»»»»»» **additionalProperties** | body | any | false | none |
| »»»»»»»»» *anonymous* | body | \[anyOf] | false | none |
| »»»»»»»»»» *anonymous* | body | any | false | none |
| »»»»»»»»»» *anonymous* | body | [objects](https://guardrailsai.com/docs/guardrails_server_api/#objects) | false | none |
| »»»»»» validationResponse | body | any | false | none |
| »»»»»»» *anonymous* | body | string | false | none |
| »»»»»»» *anonymous* | body | [reask](https://guardrailsai.com/docs/guardrails_server_api/#reask) | false | none |
| »»»»»»»» **additionalProperties** | body | any | false | none |
| »»»»»»»» incorrectValue | body | any | false | none |
| »»»»»»»» failResults | body | \[allOf] | false | none |
| »»»»»»»»» FailResult | body | [fail-result](https://guardrailsai.com/docs/guardrails_server_api/#fail-result) | false | The output from a single Validator. |
| »»»»»»»»»» outcome | body | any | true | none |
| »»»»»»»»»» errorMessage | body | string | true | none |
| »»»»»»»»»» fixValue | body | any | false | none |
| »»»»»»»»»» errorSpans | body | \[[error-span](https://guardrailsai.com/docs/guardrails_server_api/#error-span)] | false | none |
| »»»»»»»»»»» ErrorSpan | body | [error-span](https://guardrailsai.com/docs/guardrails_server_api/#error-span) | false | none |
| »»»»»»»»»»»» start | body | integer | true | none |
| »»»»»»»»»»»» end | body | integer | true | none |
| »»»»»»»»»»»» reason | body | string | true | The reason validation failed, specific to this chunk. |
| »»»»»»» *anonymous* | body | object | false | none |
| »»»»»»»» **additionalProperties** | body | any | false | none |
| »»»»»»» *anonymous* | body | \[anyOf] | false | none |
| »»»»»»»» AnyType | body | any | false | none |
| »»»»»» guardedOutput | body | any | false | none |
| »»»»»»» *anonymous* | body | string | false | none |
| »»»»»»» *anonymous* | body | object | false | none |
| »»»»»»»» **additionalProperties** | body | any | false | none |
| »»»»»»» *anonymous* | body | \[anyOf] | false | none |
| »»»»»»»» AnyType | body | any | false | none |
| »»»»»» reasks | body | \[[reask](https://guardrailsai.com/docs/guardrails_server_api/#reask)] | false | none |
| »»»»»»» ReAsk | body | [reask](https://guardrailsai.com/docs/guardrails_server_api/#reask) | false | none |
| »»»»»» validatorLogs | body | \[[validator-log](https://guardrailsai.com/docs/guardrails_server_api/#validator-log)] | false | none |
| »»»»»»» ValidatorLog | body | [validator-log](https://guardrailsai.com/docs/guardrails_server_api/#validator-log) | false | none |
| »»»»»»»» validatorName | body | string(PascalCase) | true | The class name of the validator. |
| »»»»»»»» registeredName | body | string(kebab-case) | true | The registry id of the validator. |
| »»»»»»»» instanceId | body | any | false | A unique identifier for the validator that produced this log within the session. |
| »»»»»»»»» *anonymous* | body | string | false | none |
| »»»»»»»»» *anonymous* | body | integer | false | none |
| »»»»»»»» propertyPath | body | string | true | The JSON path to the property which was validated that produced this log. |
| »»»»»»»» valueBeforeValidation | body | any | true | none |
| »»»»»»»» valueAfterValidation | body | any | false | none |
| »»»»»»»» validationResult | body | any | false | none |
| »»»»»»»»» *anonymous* | body | [pass-result](https://guardrailsai.com/docs/guardrails_server_api/#pass-result) | false | The output from a single Validator. |
| »»»»»»»»»» outcome | body | any | true | none |
| »»»»»»»»»» valueOverride | body | any | false | none |
| »»»»»»»»» *anonymous* | body | [fail-result](https://guardrailsai.com/docs/guardrails_server_api/#fail-result) | false | The output from a single Validator. |
| »»»»»»»»»» outcome | body | any | true | none |
| »»»»»»»»»» errorMessage | body | string | true | none |
| »»»»»»»»»» fixValue | body | any | false | none |
| »»»»»»»»»» errorSpans | body | \[[error-span](https://guardrailsai.com/docs/guardrails_server_api/#error-span)] | false | none |
| »»»»»»»» startTime | body | string(date-time) | false | none |
| »»»»»»»» endTime | body | string(date-time) | false | none |
| »»»»»» error | body | string | false | The error message from any exception which interrupted the Guard execution process. |
| »»» inputs | body | [CallInputs](https://guardrailsai.com/docs/guardrails_server_api/#callinputs) | false | none |
| »»»» *anonymous* | body | [inputs](https://guardrailsai.com/docs/guardrails_server_api/#inputs) | false | none |
| »»»» *anonymous* | body | [args-and-kwargs](https://guardrailsai.com/docs/guardrails_server_api/#args-and-kwargs) | false | none |
| »»»»» args | body | \[anyOf] | false | none |
| »»»»»» AnyType | body | any | false | none |
| »»»»» kwargs | body | object | false | none |
| »»»»»» **additionalProperties** | body | any | false | none |
| »»» exception | body | string | false | none |

#### **Enumerated Values**

| **Parameter** | **Value** |
| :- | :- |
| »»»» *anonymous* | messages |
| »»»» *anonymous* | output |
| »»» onFail | exception |
| »»» onFail | filter |
| »»» onFail | fix |
| »»» onFail | fix\_reask |
| »»» onFail | noop |
| »»» onFail | reask |
| »»» onFail | refrain |
| »»» onFail | custom |
| »»»» *anonymous* | array |
| »»»» *anonymous* | boolean |
| »»»» *anonymous* | integer |
| »»»» *anonymous* | null |
| »»»» *anonymous* | number |
| »»»» *anonymous* | object |
| »»»» *anonymous* | string |
| »»»» *anonymous* | array |
| »»»» *anonymous* | boolean |
| »»»» *anonymous* | integer |
| »»»» *anonymous* | null |
| »»»» *anonymous* | number |
| »»»» *anonymous* | object |
| »»»» *anonymous* | string |

> Example responses

> 200 Response

```python theme={null}
{
  "id": "string",
  "name": "string",
  "description": "string",
  "validators": [
    {
      "id": "string",
      "on": "messages",
      "onFail": "exception",
      "args": [
        true
      ],
      "kwargs": {
        "property1": null,
        "property2": null
      }
    }
  ],
  "output_schema": {
    "definitions": {},
    "dependencies": {
      "property1": {},
      "property2": {}
    },
    "$anchor": "string",
    "$ref": "../dictionary",
    "$dynamicRef": "../dictionary",
    "$dynamicAnchor": "string",
    "$vocabulary": {
      "property1": true,
      "property2": true
    },
    "$comment": "string",
    "$defs": {},
    "prefixItems": [
      null
    ],
    "items": null,
    "contains": null,
    "additionalProperties": null,
    "properties": {},
    "patternProperties": {},
    "dependentSchemas": {
      "property1": null,
      "property2": null
    },
    "propertyNames": null,
    "if": null,
    "then": null,
    "else": null,
    "allOf": [
      null
    ],
    "anyOf": [
      null
    ],
    "oneOf": [
      null
    ],
    "not": null,
    "unevaluatedItems": null,
    "unevaluatedProperties": null,
    "multipleOf": 0,
    "maximum": 0,
    "exclusiveMaximum": 0,
    "minimum": 0,
    "exclusiveMinimum": 0,
    "maxLength": 0,
    "minLength": 0,
    "pattern": "/regex/",
    "maxItems": 0,
    "minItems": 0,
    "uniqueItems": false,
    "maxContains": 0,
    "minContains": 0,
    "maxProperties": 0,
    "minProperties": 0,
    "required": [],
    "dependentRequired": {
      "property1": [],
      "property2": []
    },
    "const": null,
    "enum": [
      null
    ],
    "type": "array",
    "title": "string",
    "description": "string",
    "default": null,
    "deprecated": false,
    "readOnly": false,
    "writeOnly": false,
    "examples": [
      null
    ],
    "format": "string",
    "contentMediaType": "string",
    "contentEncoding": "string",
    "contentSchema": null
  },
  "history": [
    {
      "id": "string",
      "iterations": [],
      "inputs": {
        "llmApi": "string",
        "llmOutput": "string",
        "messages": [
          {
            "property1": null,
            "property2": null
          }
        ],
        "promptParams": {
          "property1": null,
          "property2": null
        },
        "numReasks": 0,
        "metadata": {
          "property1": null,
          "property2": null
        },
        "fullSchemaReask": true,
        "stream": true,
        "args": [
          true
        ],
        "kwargs": {
          "property1": null,
          "property2": null
        }
      },
      "exception": "string"
    }
  ]
}
```

### **Responses**

| **Status** | **Meaning** | **Description** | **Schema** |
| :- | :- | :- | :- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | the updated Guard | [guard](https://guardrailsai.com/docs/guardrails_server_api/#guard) |
| default | Default | Unexpected error | [HttpError](https://guardrailsai.com/docs/guardrails_server_api/#httperror) |

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**

| **Name** | **In** | **Type** | **Required** | **Description** |
| :- | :- | :- | :- | :- |
| guardName | path | string | true | Guard name |

> Example responses

> 200 Response

```python theme={null}
{
  "id": "string",
  "name": "string",
  "description": "string",
  "validators": [
    {
      "id": "string",
      "on": "messages",
      "onFail": "exception",
      "args": [
        true
      ],
      "kwargs": {
        "property1": null,
        "property2": null
      }
    }
  ],
  "output_schema": {
    "definitions": {},
    "dependencies": {
      "property1": {},
      "property2": {}
    },
    "$anchor": "string",
    "$ref": "../dictionary",
    "$dynamicRef": "../dictionary",
    "$dynamicAnchor": "string",
    "$vocabulary": {
      "property1": true,
      "property2": true
    },
    "$comment": "string",
    "$defs": {},
    "prefixItems": [
      null
    ],
    "items": null,
    "contains": null,
    "additionalProperties": null,
    "properties": {},
    "patternProperties": {},
    "dependentSchemas": {
      "property1": null,
      "property2": null
    },
    "propertyNames": null,
    "if": null,
    "then": null,
    "else": null,
    "allOf": [
      null
    ],
    "anyOf": [
      null
    ],
    "oneOf": [
      null
    ],
    "not": null,
    "unevaluatedItems": null,
    "unevaluatedProperties": null,
    "multipleOf": 0,
    "maximum": 0,
    "exclusiveMaximum": 0,
    "minimum": 0,
    "exclusiveMinimum": 0,
    "maxLength": 0,
    "minLength": 0,
    "pattern": "/regex/",
    "maxItems": 0,
    "minItems": 0,
    "uniqueItems": false,
    "maxContains": 0,
    "minContains": 0,
    "maxProperties": 0,
    "minProperties": 0,
    "required": [],
    "dependentRequired": {
      "property1": [],
      "property2": []
    },
    "const": null,
    "enum": [
      null
    ],
    "type": "array",
    "title": "string",
    "description": "string",
    "default": null,
    "deprecated": false,
    "readOnly": false,
    "writeOnly": false,
    "examples": [
      null
    ],
    "format": "string",
    "contentMediaType": "string",
    "contentEncoding": "string",
    "contentSchema": null
  },
  "history": [
    {
      "id": "string",
      "iterations": [],
      "inputs": {
        "llmApi": "string",
        "llmOutput": "string",
        "messages": [
          {
            "property1": null,
            "property2": null
          }
        ],
        "promptParams": {
          "property1": null,
          "property2": null
        },
        "numReasks": 0,
        "metadata": {
          "property1": null,
          "property2": null
        },
        "fullSchemaReask": true,
        "stream": true,
        "args": [
          true
        ],
        "kwargs": {
          "property1": null,
          "property2": null
        }
      },
      "exception": "string"
    }
  ]
}
```

### **Responses**

| **Status** | **Meaning** | **Description** | **Schema** |
| :- | :- | :- | :- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | the deleted Guard | [guard](https://guardrailsai.com/docs/guardrails_server_api/#guard) |
| default | Default | Unexpected error | [HttpError](https://guardrailsai.com/docs/guardrails_server_api/#httperror) |

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**

| **Name** | **In** | **Type** | **Required** | **Description** |
| :- | :- | :- | :- | :- |
| guardName | path | string | true | Guard name |
| callId | path | string | true | Call id |

> Example responses

> 200 Response

```python theme={null}
[
  {
    "id": "string",
    "iterations": [],
    "inputs": {
      "llmApi": "string",
      "llmOutput": "string",
      "messages": [
        {
          "property1": null,
          "property2": null
        }
      ],
      "promptParams": {
        "property1": null,
        "property2": null
      },
      "numReasks": 0,
      "metadata": {
        "property1": null,
        "property2": null
      },
      "fullSchemaReask": true,
      "stream": true,
      "args": [
        true
      ],
      "kwargs": {
        "property1": null,
        "property2": null
      }
    },
    "exception": "string"
  }
]
```

### **Responses**

| **Status** | **Meaning** | **Description** | **Schema** |
| :- | :- | :- | :- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | the fetched Guard History | Inline |
| default | Default | Unexpected error | [HttpError](https://guardrailsai.com/docs/guardrails_server_api/#httperror) |

### **Response Schema**

Status Code **200**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | \[[call](https://guardrailsai.com/docs/guardrails_server_api/#call)] | false | none | none |
| » Call | [call](https://guardrailsai.com/docs/guardrails_server_api/#call) | false | none | none |
| »» id | string | true | none | The unique identifier for this Call. Can be used as an identifier for a specific execution of a Guard. |
| »» iterations | \[[iteration](https://guardrailsai.com/docs/guardrails_server_api/#iteration)] | false | none | none |
| »»» Iteration | [iteration](https://guardrailsai.com/docs/guardrails_server_api/#iteration) | false | none | none |
| »»»» id | string | true | none | The unique identifier for this Call. Can be used as an identifier for a specific execution of a Guard. |
| »»»» index | integer | true | none | The zero-based index of this iteration within the current Call. |
| »»»» callId | string | true | none | The unique identifier for the Call that this iteration is a part of. |
| »»»» inputs | [inputs](https://guardrailsai.com/docs/guardrails_server_api/#inputs) | false | none | none |
| »»»»» llmApi | string | false | none | The LLM resource targeted by the user. e.g. [openai.chat](http://openai.chat).completions.create |
| »»»»» llmOutput | string | false | none | The string output from an external LLM call provided by the user via Guard.parse. |
| »»»»» messages | \[object] | false | none | The message history for chat models. |
| »»»»»» **additionalProperties** | any | false | none | none |
| »»»»» promptParams | object | false | none | Parameters to be formatted into the prompt. |
| »»»»»» **additionalProperties** | any | false | none | none |
| »»»»» numReasks | integer | false | none | The total number of times the LLM can be called to correct output excluding the initial call. |
| »»»»» metadata | object | false | none | Additional data to be used by Validators during execution time. |
| »»»»»» **additionalProperties** | any | false | none | none |
| »»»»» fullSchemaReask | boolean | false | none | Whether to perform reasks for the entire schema rather than for individual fields. |
| »»»»» stream | boolean | false | none | Whether to use streaming. |
| »»»» outputs | [outputs](https://guardrailsai.com/docs/guardrails_server_api/#outputs) | false | none | none |
| »»»»» llmResponseInfo | [LLMResponse](https://guardrailsai.com/docs/guardrails_server_api/#llmresponse) | false | none | Information from the LLM response. |
| »»»»»» promptTokenCount | integer | false | none | none |
| »»»»»» responseTokenCount | integer | false | none | none |
| »»»»»» output | string | true | none | none |
| »»»»»» streamOutput | \[string] | false | none | none |
| »»»»»» asyncStreamOutput | \[string] | false | none | none |
| »»»»» rawOutput | string | false | none | The string content from the LLM response. |
| »»»»» parsedOutput | any | false | none | none |

*anyOf*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»» *anonymous* | string | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»» *anonymous* | object | false | none | none |
| »»»»»»» **additionalProperties** | any | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»» *anonymous* | \[anyOf] | false | none | none |
| »»»»»»» AnyType | any | false | none | none |

*anyOf*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»» *anonymous* | any | false | none | none |

*anyOf*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»» *anonymous* | boolean | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»» *anonymous* | integer | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»» *anonymous* | null | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»» *anonymous* | number | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»» *anonymous* | string | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»» *anonymous* | [objects](https://guardrailsai.com/docs/guardrails_server_api/#objects) | false | none | none |
| »»»»»»»»» **additionalProperties** | any | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»» *anonymous* | \[anyOf] | false | none | none |

*anyOf*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»» *anonymous* | any | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»»» *anonymous* | [objects](https://guardrailsai.com/docs/guardrails_server_api/#objects) | false | none | none |

*continued*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»» validationResponse | any | false | none | none |

*anyOf*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»» *anonymous* | string | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»» *anonymous* | [reask](https://guardrailsai.com/docs/guardrails_server_api/#reask) | false | none | none |
| »»»»»»» **additionalProperties** | any | false | none | none |
| »»»»»»» incorrectValue | any | false | none | none |
| »»»»»»» failResults | \[allOf] | false | none | none |
| »»»»»»»» FailResult | [fail-result](https://guardrailsai.com/docs/guardrails_server_api/#fail-result) | false | none | The output from a single Validator. |
| »»»»»»»»» outcome | any | true | none | none |
| »»»»»»»»» errorMessage | string | true | none | none |
| »»»»»»»»» fixValue | any | false | none | none |
| »»»»»»»»» errorSpans | \[[error-span](https://guardrailsai.com/docs/guardrails_server_api/#error-span)] | false | none | none |
| »»»»»»»»»» ErrorSpan | [error-span](https://guardrailsai.com/docs/guardrails_server_api/#error-span) | false | none | none |
| »»»»»»»»»»» start | integer | true | none | none |
| »»»»»»»»»»» end | integer | true | none | none |
| »»»»»»»»»»» reason | string | true | none | The reason validation failed, specific to this chunk. |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»» *anonymous* | object | false | none | none |
| »»»»»»» **additionalProperties** | any | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»» *anonymous* | \[anyOf] | false | none | none |
| »»»»»»» AnyType | any | false | none | none |

*continued*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»» guardedOutput | any | false | none | none |

*anyOf*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»» *anonymous* | string | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»» *anonymous* | object | false | none | none |
| »»»»»»» **additionalProperties** | any | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»» *anonymous* | \[anyOf] | false | none | none |
| »»»»»»» AnyType | any | false | none | none |

*continued*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»» reasks | \[[reask](https://guardrailsai.com/docs/guardrails_server_api/#reask)] | false | none | none |
| »»»»»» ReAsk | [reask](https://guardrailsai.com/docs/guardrails_server_api/#reask) | false | none | none |
| »»»»» validatorLogs | \[[validator-log](https://guardrailsai.com/docs/guardrails_server_api/#validator-log)] | false | none | none |
| »»»»»» ValidatorLog | [validator-log](https://guardrailsai.com/docs/guardrails_server_api/#validator-log) | false | none | none |
| »»»»»»» validatorName | string(PascalCase) | true | none | The class name of the validator. |
| »»»»»»» registeredName | string(kebab-case) | true | none | The registry id of the validator. |
| »»»»»»» instanceId | any | false | none | A unique identifier for the validator that produced this log within the session. |

*anyOf*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»» *anonymous* | string | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»» *anonymous* | integer | false | none | none |

*continued*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»» propertyPath | string | true | none | The JSON path to the property which was validated that produced this log. |
| »»»»»»» valueBeforeValidation | any | true | none | none |
| »»»»»»» valueAfterValidation | any | false | none | none |
| »»»»»»» validationResult | any | false | none | none |

*anyOf*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»» *anonymous* | [pass-result](https://guardrailsai.com/docs/guardrails_server_api/#pass-result) | false | none | The output from a single Validator. |
| »»»»»»»»» outcome | any | true | none | none |
| »»»»»»»»» valueOverride | any | false | none | none |

*or*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»»» *anonymous* | [fail-result](https://guardrailsai.com/docs/guardrails_server_api/#fail-result) | false | none | The output from a single Validator. |
| »»»»»»»»» outcome | any | true | none | none |
| »»»»»»»»» errorMessage | string | true | none | none |
| »»»»»»»»» fixValue | any | false | none | none |
| »»»»»»»»» errorSpans | \[[error-span](https://guardrailsai.com/docs/guardrails_server_api/#error-span)] | false | none | none |

*continued*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»»»»»» startTime | string(date-time) | false | none | none |
| »»»»»»» endTime | string(date-time) | false | none | none |
| »»»»» error | string | false | none | The error message from any exception which interrupted the Guard execution process. |
| »» inputs | [CallInputs](https://guardrailsai.com/docs/guardrails_server_api/#callinputs) | false | none | none |

*allOf*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»» *anonymous* | [inputs](https://guardrailsai.com/docs/guardrails_server_api/#inputs) | false | none | none |

*and*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »»» *anonymous* | [args-and-kwargs](https://guardrailsai.com/docs/guardrails_server_api/#args-and-kwargs) | false | none | none |
| »»»» args | \[anyOf] | false | none | none |
| »»»»» AnyType | any | false | none | none |
| »»»» kwargs | object | false | none | none |
| »»»»» **additionalProperties** | any | false | none | none |

*continued*

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »» exception | string | false | none | none |

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

```python theme={null}
{
  "model": "gpt-3.5-turbo",
  "messages": [
    {
      "role": "string",
      "content": "string"
    }
  ],
  "max_tokens": 0,
  "temperature": 0
}
```

### **Parameters**

| **Name** | **In** | **Type** | **Required** | **Description** |
| :- | :- | :- | :- | :- |
| guardName | path | string | true | Guard name |
| body | body | [OpenAIChatCompletionPayload](https://guardrailsai.com/docs/guardrails_server_api/#openaichatcompletionpayload) | true | none |
| » model | body | string | false | The model to use for the completion |
| » messages | body | \[object] | false | The messages to use for the completion |
| »» role | body | string | false | The role of the message |
| »» content | body | string | false | The content of the message |
| » max\_tokens | body | integer | false | The maximum number of tokens to generate |
| » temperature | body | number | false | The sampling temperature |

> Example responses

> 200 Response

```python theme={null}
{
  "id": "string",
  "created": "string",
  "model_name": "string",
  "choices": [
    {
      "role": "string",
      "content": "string"
    }
  ]
}
```

### **Responses**

| **Status** | **Meaning** | **Description** | **Schema** |
| :- | :- | :- | :- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | The output of the completion | [OpenAIChatCompletion](https://guardrailsai.com/docs/guardrails_server_api/#openaichatcompletion) |
| default | Default | Unexpected error | [HttpError](https://guardrailsai.com/docs/guardrails_server_api/#httperror) |

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

```python theme={null}
{
  "llmOutput": "stubbed llm output",
  "numReasks": 0,
  "promptParams": {
    "property1": null,
    "property2": null
  },
  "llmApi": "openai.Completion.create",
  "property1": null,
  "property2": null
}
```

### **Parameters**

| **Name** | **In** | **Type** | **Required** | **Description** |
| :- | :- | :- | :- | :- |
| guardName | path | string | true | Guard name |
| x-openai-api-key | header | string(password) | false | A valid OpenAI API Key for calling LLM's on your behalf |
| body | body | [ValidatePayload](https://guardrailsai.com/docs/guardrails_server_api/#validatepayload) | true | none |
| » **additionalProperties** | body | any | false | none |
| » llmOutput | body | string | false | The LLM output as a string or the input prompts for the LLM |
| » numReasks | body | integer | false | An override for the number of re-asks to perform |
| » promptParams | body | object | false | additional params for llm prompts |
| »» **additionalProperties** | body | any | false | none |
| » llmApi | body | [LLMResource](https://guardrailsai.com/docs/guardrails_server_api/#llmresource) | false | none |

#### **Enumerated Values**

| **Parameter** | **Value** |
| :- | :- |
| » llmApi | openai.Completion.create |
| » llmApi | openai.completions.create |
| » llmApi | openai.ChatCompletion.create |
| » llmApi | [openai.chat](http://openai.chat).completions.create |
| » llmApi | openai.Completion.acreate |
| » llmApi | openai.ChatCompletion.acreate |
| » llmApi | litellm.completion |
| » llmApi | litellm.acompletion |

> Example responses

> 200 Response

```python theme={null}
{
  "callId": "string",
  "rawLlmOutput": "string",
  "validatedOutput": "string",
  "reask": {
    "incorrectValue": true,
    "failResults": [
      {
        "outcome": "pass",
        "errorMessage": "string",
        "fixValue": true,
        "errorSpans": [
          {
            "start": 0,
            "end": 0,
            "reason": "string"
          }
        ],
        "metadata": {
          "property1": null,
          "property2": null
        },
        "validatedChunk": true
      }
    ],
    "property1": null,
    "property2": null
  },
  "validationPassed": true,
  "error": "string"
}
```

### **Responses**

| **Status** | **Meaning** | **Description** | **Schema** |
| :- | :- | :- | :- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | The output of the validation | [validation-outcome](https://guardrailsai.com/docs/guardrails_server_api/#validation-outcome) |
| default | Default | Unexpected error | [HttpError](https://guardrailsai.com/docs/guardrails_server_api/#httperror) |

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

## **Schemas**

### **OpenAIChatCompletionPayload**

```python theme={null}
{
  "model": "gpt-3.5-turbo",
  "messages": [
    {
      "role": "string",
      "content": "string"
    }
  ],
  "max_tokens": 0,
  "temperature": 0
}
```

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| model | string | false | none | The model to use for the completion |
| messages | \[object] | false | none | The messages to use for the completion |
| » role | string | false | none | The role of the message |
| » content | string | false | none | The content of the message |
| max\_tokens | integer | false | none | The maximum number of tokens to generate |
| temperature | number | false | none | The sampling temperature |

### **OpenAIChatCompletion**

```python theme={null}
{
  "id": "string",
  "created": "string",
  "model_name": "string",
  "choices": [
    {
      "role": "string",
      "content": "string"
    }
  ]
}
```

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| id | string | true | none | The id |
| created | string | true | none | The created date |
| model\_name | string | true | none | The model name |
| choices | \[object] | true | none | none |
| » role | string | false | none | The role of the message |
| » content | string | false | none | The content of the message |

### **HttpError**

```python theme={null}
{
  "status": 0,
  "message": "string",
  "cause": "string",
  "fields": {
    "property1": [
      "string"
    ],
    "property2": [
      "string"
    ]
  },
  "context": "string"
}
```

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| status | integer | true | none | A valid http status code |
| message | string | true | none | A message explaining the status |
| cause | string | false | none | Used to describe the origin of an error if that original error has meaning to the client. This field should add specificity to 'message'. |
| fields | object | false | none | Used to identify specific fields in a JSON body that caused the error. Typically only used for 4xx type responses. The key should be the json path to the invalid property and the value should be a list of error messages specific to that property. |
| » **additionalProperties** | \[string] | false | none | none |
| context | string | false | none | Used to identify what part of the request caused the error for non-JSON payloads. |

### **HealthCheck**

```python theme={null}
{
  "status": 0,
  "message": "string"
}
```

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| status | integer | true | none | A valid http status code |
| message | string | true | none | A message explaining the status |

### **ValidationOutcome**

```python theme={null}
{
  "callId": "string",
  "rawLlmOutput": "string",
  "validatedOutput": "string",
  "reask": {
    "incorrectValue": true,
    "failResults": [
      {
        "outcome": "pass",
        "errorMessage": "string",
        "fixValue": true,
        "errorSpans": [
          {
            "start": 0,
            "end": 0,
            "reason": "string"
          }
        ],
        "metadata": {
          "property1": null,
          "property2": null
        },
        "validatedChunk": true
      }
    ],
    "property1": null,
    "property2": null
  },
  "validationPassed": true,
  "error": "string"
}
```

#### **Properties**

*None*

### **primitives**

```
true
```

#### **Properties**

anyOf

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | boolean | false | none | none |

or

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | integer | false | none | none |

or

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | null | false | none | none |

or

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | number | false | none | none |

or

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | string | false | none | none |

### **objects**

```
{
  "property1": null,
  "property2": null
}
```

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| **additionalProperties** | any | false | none | none |

### **arrays**

```
[
  true
]
```

#### **Properties**

anyOf

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | [primitives](https://guardrailsai.com/docs/guardrails_server_api/#primitives) | false | none | none |

or

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | [objects](https://guardrailsai.com/docs/guardrails_server_api/#objects) | false | none | none |

### **any-type**

```
true
```

AnyType

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| AnyType | any | false | none | none |

anyOf

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | [primitives](https://guardrailsai.com/docs/guardrails_server_api/#primitives) | false | none | none |

or

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | [objects](https://guardrailsai.com/docs/guardrails_server_api/#objects) | false | none | none |

or

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | [arrays](https://guardrailsai.com/docs/guardrails_server_api/#arrays) | false | none | none |

### **validation-result**

```python theme={null}
{
  "outcome": "pass",
  "metadata": {
    "property1": null,
    "property2": null
  },
  "validatedChunk": true
}
```

ValidationResult

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| outcome | string | true | none | none |
| metadata | object | false | none | none |
| » **additionalProperties** | any | false | none | none |
| validatedChunk | [any-type](https://guardrailsai.com/docs/guardrails_server_api/#any-type) | false | none | none |

#### **Enumerated Values**

| **Property** | **Value** |
| :- | :- |
| outcome | pass |
| outcome | fail |

### **error-span**

```python theme={null}
{
  "start": 0,
  "end": 0,
  "reason": "string"
}
```

ErrorSpan

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| start | integer | true | none | none |
| end | integer | true | none | none |
| reason | string | true | none | The reason validation failed, specific to this chunk. |

### **fail-result**

```python theme={null}
{
  "outcome": "pass",
  "errorMessage": "string",
  "fixValue": true,
  "errorSpans": [
    {
      "start": 0,
      "end": 0,
      "reason": "string"
    }
  ],
  "metadata": {
    "property1": null,
    "property2": null
  },
  "validatedChunk": true
}
```

FailResult

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| FailResult | [validation-result](https://guardrailsai.com/docs/guardrails_server_api/#validation-result) | false | none | The output from a single Validator. |
| outcome | any | true | none | none |
| errorMessage | string | true | none | none |
| fixValue | [any-type](https://guardrailsai.com/docs/guardrails_server_api/#any-type) | false | none | none |
| errorSpans | \[[error-span](https://guardrailsai.com/docs/guardrails_server_api/#error-span)] | false | none | none |

### **reask**

```python theme={null}
{
  "incorrectValue": true,
  "failResults": [
    {
      "outcome": "pass",
      "errorMessage": "string",
      "fixValue": true,
      "errorSpans": [
        {
          "start": 0,
          "end": 0,
          "reason": "string"
        }
      ],
      "metadata": {
        "property1": null,
        "property2": null
      },
      "validatedChunk": true
    }
  ],
  "property1": null,
  "property2": null
}
```

ReAsk

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| **additionalProperties** | any | false | none | none |
| incorrectValue | [any-type](https://guardrailsai.com/docs/guardrails_server_api/#any-type) | false | none | none |
| failResults | \[[fail-result](https://guardrailsai.com/docs/guardrails_server_api/#fail-result)] | false | none | none |

### **validation-outcome**

```python theme={null}
{
  "callId": "string",
  "rawLlmOutput": "string",
  "validatedOutput": "string",
  "reask": {
    "incorrectValue": true,
    "failResults": [
      {
        "outcome": "pass",
        "errorMessage": "string",
        "fixValue": true,
        "errorSpans": [
          {
            "start": 0,
            "end": 0,
            "reason": "string"
          }
        ],
        "metadata": {
          "property1": null,
          "property2": null
        },
        "validatedChunk": true
      }
    ],
    "property1": null,
    "property2": null
  },
  "validationPassed": true,
  "error": "string"
}
```

ValidationOutcome

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| callId | string | true | none | Foreign key to the most recent Call this resulted from. |
| rawLlmOutput | string | false | none | The raw, unchanged string content from the LLM call. |
| validatedOutput | any | false | none | The validated, and potentially fixed, output from the LLM call after undergoing validation. |

anyOf

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| » *anonymous* | string | false | none | none |

or

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| » *anonymous* | object | false | none | none |
| »» **additionalProperties** | any | false | none | none |

or

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| » *anonymous* | \[[any-type](https://guardrailsai.com/docs/guardrails_server_api/#any-type)] | false | none | none |

continued

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| reask | [reask](https://guardrailsai.com/docs/guardrails_server_api/#reask) | false | none | If validation continuously fails and all allocated reasks are used, this field will contain the final reask that would have been sent to the LLM if additional reasks were available. |
| validationPassed | boolean | false | none | A boolean to indicate whether or not the LLM output passed validation. If this is False, the validated\_output may be invalid. |
| error | string | false | none | If the validation process raised a handleable exception, this field will contain the error message. |

### **Guard**

```python theme={null}
{
  "id": "string",
  "name": "string",
  "description": "string",
  "validators": [
    {
      "id": "string",
      "on": "messages",
      "onFail": "exception",
      "args": [
        true
      ],
      "kwargs": {
        "property1": null,
        "property2": null
      }
    }
  ],
  "output_schema": {
    "definitions": {},
    "dependencies": {
      "property1": {},
      "property2": {}
    },
    "$anchor": "string",
    "$ref": "../dictionary",
    "$dynamicRef": "../dictionary",
    "$dynamicAnchor": "string",
    "$vocabulary": {
      "property1": true,
      "property2": true
    },
    "$comment": "string",
    "$defs": {},
    "prefixItems": [
      null
    ],
    "items": null,
    "contains": null,
    "additionalProperties": null,
    "properties": {},
    "patternProperties": {},
    "dependentSchemas": {
      "property1": null,
      "property2": null
    },
    "propertyNames": null,
    "if": null,
    "then": null,
    "else": null,
    "allOf": [
      null
    ],
    "anyOf": [
      null
    ],
    "oneOf": [
      null
    ],
    "not": null,
    "unevaluatedItems": null,
    "unevaluatedProperties": null,
    "multipleOf": 0,
    "maximum": 0,
    "exclusiveMaximum": 0,
    "minimum": 0,
    "exclusiveMinimum": 0,
    "maxLength": 0,
    "minLength": 0,
    "pattern": "/regex/",
    "maxItems": 0,
    "minItems": 0,
    "uniqueItems": false,
    "maxContains": 0,
    "minContains": 0,
    "maxProperties": 0,
    "minProperties": 0,
    "required": [],
    "dependentRequired": {
      "property1": [],
      "property2": []
    },
    "const": null,
    "enum": [
      null
    ],
    "type": "array",
    "title": "string",
    "description": "string",
    "default": null,
    "deprecated": false,
    "readOnly": false,
    "writeOnly": false,
    "examples": [
      null
    ],
    "format": "string",
    "contentMediaType": "string",
    "contentEncoding": "string",
    "contentSchema": null
  },
  "history": [
    {
      "id": "string",
      "iterations": [],
      "inputs": {
        "llmApi": "string",
        "llmOutput": "string",
        "messages": [
          {
            "property1": null,
            "property2": null
          }
        ],
        "promptParams": {
          "property1": null,
          "property2": null
        },
        "numReasks": 0,
        "metadata": {
          "property1": null,
          "property2": null
        },
        "fullSchemaReask": true,
        "stream": true,
        "args": [
          true
        ],
        "kwargs": {
          "property1": null,
          "property2": null
        }
      },
      "exception": "string"
    }
  ]
}
```

#### **Properties**

*None*

### **schemaArray**

```
[
  null
]
```

#### **Properties**

*None*

### **nonNegativeInteger**

```
0
```

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | integer | false | none | none |

### **nonNegativeIntegerDefault0**

```
0
```

#### **Properties**

*None*

### **simpleTypes**

```
"array"
```

#### **Properties**

*None*

### **stringArray**

```
[]
```

#### **Properties**

*None*

### **LLMResponse**

```python theme={null}
{
  "promptTokenCount": 0,
  "responseTokenCount": 0,
  "output": "string",
  "streamOutput": [
    "string"
  ],
  "asyncStreamOutput": [
    "string"
  ]
}
```

Information from the LLM response.

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| promptTokenCount | integer | false | none | none |
| responseTokenCount | integer | false | none | none |
| output | string | true | none | none |
| streamOutput | \[string] | false | none | none |
| asyncStreamOutput | \[string] | false | none | none |

### **CallInputs**

```python theme={null}
{
  "llmApi": "string",
  "llmOutput": "string",
  "messages": [
    {
      "property1": null,
      "property2": null
    }
  ],
  "promptParams": {
    "property1": null,
    "property2": null
  },
  "numReasks": 0,
  "metadata": {
    "property1": null,
    "property2": null
  },
  "fullSchemaReask": true,
  "stream": true,
  "args": [
    true
  ],
  "kwargs": {
    "property1": null,
    "property2": null
  }
}
```

CallInputs

#### **Properties**

allOf

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | [inputs](https://guardrailsai.com/docs/guardrails_server_api/#inputs) | false | none | none |

and

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | [args-and-kwargs](https://guardrailsai.com/docs/guardrails_server_api/#args-and-kwargs) | false | none | none |

### **ValidatorReference**

```python theme={null}
{
  "id": "string",
  "on": "messages",
  "onFail": "exception",
  "args": [
    true
  ],
  "kwargs": {
    "property1": null,
    "property2": null
  }
}
```

ValidatorReference

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| ValidatorReference | [args-and-kwargs](https://guardrailsai.com/docs/guardrails_server_api/#args-and-kwargs) | false | none | none |
| id | string | true | none | The unique identifier for this Validator; e.g. guardrails/regex\_match |
| on | any | false | none | A reference to the property this validator should be applied against. Can be a valid JSON path or a meta-property such as "prompt" or "output" |

anyOf

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| » *anonymous* | string | false | none | meta-property |

or

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| » *anonymous* | string | false | none | JSON path to property; e.g. \$.[foo.bar](http://foo.bar) |

continued

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| onFail | string | false | none | none |

#### **Enumerated Values**

| **Property** | **Value** |
| :- | :- |
| *anonymous* | prompt |
| *anonymous* | messages |
| *anonymous* | output |
| onFail | exception |
| onFail | filter |
| onFail | fix |
| onFail | fix\_reask |
| onFail | noop |
| onFail | reask |
| onFail | refrain |
| onFail | custom |

### **args-and-kwargs**

```python theme={null}
{
  "args": [
    true
  ],
  "kwargs": {
    "property1": null,
    "property2": null
  }
}
```

ArgsAndKwargs

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| args | \[[any-type](https://guardrailsai.com/docs/guardrails_server_api/#any-type)] | false | none | none |
| kwargs | object | false | none | none |
| » **additionalProperties** | any | false | none | none |

### **core**

```python theme={null}
{
  "$anchor": "string",
  "$ref": "../dictionary",
  "$dynamicRef": "../dictionary",
  "$dynamicAnchor": "string",
  "$vocabulary": {
    "property1": true,
    "property2": true
  },
  "$comment": "string",
  "$defs": {}
}
```

Core vocabulary meta-schema

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| Core vocabulary meta-schema | object,boolean | false | none | none |
| \$anchor | string | false | none | none |
| \$ref | string(uri-reference) | false | none | none |
| \$dynamicRef | string(uri-reference) | false | none | none |
| \$dynamicAnchor | string | false | none | none |
| \$vocabulary | object | false | none | none |
| » **additionalProperties** | boolean | false | none | none |
| \$comment | string | false | none | none |
| \$defs | object | false | none | none |
| » **additionalProperties** | any | false | none | none |

### **applicator**

```python theme={null}
{
  "prefixItems": [
    null
  ],
  "items": null,
  "contains": null,
  "additionalProperties": null,
  "properties": {},
  "patternProperties": {},
  "dependentSchemas": {
    "property1": null,
    "property2": null
  },
  "propertyNames": null,
  "if": null,
  "then": null,
  "else": null,
  "allOf": [
    null
  ],
  "anyOf": [
    null
  ],
  "oneOf": [
    null
  ],
  "not": null
}
```

Applicator vocabulary meta-schema

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| Applicator vocabulary meta-schema | object,boolean | false | none | none |
| prefixItems | [schemaArray](https://guardrailsai.com/docs/guardrails_server_api/#schemaarray) | false | none | none |
| items | any | false | none | none |
| contains | any | false | none | none |
| additionalProperties | any | false | none | none |
| properties | object | false | none | none |
| » **additionalProperties** | any | false | none | none |
| patternProperties | object | false | none | none |
| » **additionalProperties** | any | false | none | none |
| dependentSchemas | object | false | none | none |
| » **additionalProperties** | any | false | none | none |
| propertyNames | any | false | none | none |
| if | any | false | none | none |
| then | any | false | none | none |
| else | any | false | none | none |
| allOf | [schemaArray](https://guardrailsai.com/docs/guardrails_server_api/#schemaarray) | false | none | none |
| anyOf | [schemaArray](https://guardrailsai.com/docs/guardrails_server_api/#schemaarray) | false | none | none |
| oneOf | [schemaArray](https://guardrailsai.com/docs/guardrails_server_api/#schemaarray) | false | none | none |
| not | any | false | none | none |

### **unevaluated**

```python theme={null}
{
  "unevaluatedItems": null,
  "unevaluatedProperties": null
}
```

Unevaluated applicator vocabulary meta-schema

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| Unevaluated applicator vocabulary meta-schema | object,boolean | false | none | none |
| unevaluatedItems | any | false | none | none |
| unevaluatedProperties | any | false | none | none |

### **validation**

```python theme={null}
{
  "multipleOf": 0,
  "maximum": 0,
  "exclusiveMaximum": 0,
  "minimum": 0,
  "exclusiveMinimum": 0,
  "maxLength": 0,
  "minLength": 0,
  "pattern": "/regex/",
  "maxItems": 0,
  "minItems": 0,
  "uniqueItems": false,
  "maxContains": 0,
  "minContains": 0,
  "maxProperties": 0,
  "minProperties": 0,
  "required": [],
  "dependentRequired": {
    "property1": [],
    "property2": []
  },
  "const": null,
  "enum": [
    null
  ],
  "type": "array"
}
```

Validation vocabulary meta-schema

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| Validation vocabulary meta-schema | object,boolean | false | none | none |
| multipleOf | number | false | none | none |
| maximum | number | false | none | none |
| exclusiveMaximum | number | false | none | none |
| minimum | number | false | none | none |
| exclusiveMinimum | number | false | none | none |
| maxLength | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none | none |
| minLength | [nonNegativeIntegerDefault0](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeintegerdefault0) | false | none | none |
| pattern | string(regex) | false | none | none |
| maxItems | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none | none |
| minItems | [nonNegativeIntegerDefault0](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeintegerdefault0) | false | none | none |
| uniqueItems | boolean | false | none | none |
| maxContains | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none | none |
| minContains | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none | none |
| maxProperties | [nonNegativeInteger](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeinteger) | false | none | none |
| minProperties | [nonNegativeIntegerDefault0](https://guardrailsai.com/docs/guardrails_server_api/#nonnegativeintegerdefault0) | false | none | none |
| required | [stringArray](https://guardrailsai.com/docs/guardrails_server_api/#stringarray) | false | none | none |
| dependentRequired | object | false | none | none |
| » **additionalProperties** | [stringArray](https://guardrailsai.com/docs/guardrails_server_api/#stringarray) | false | none | none |
| const | any | false | none | none |
| enum | \[any] | false | none | none |
| type | any | false | none | none |

anyOf

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| » *anonymous* | [simpleTypes](https://guardrailsai.com/docs/guardrails_server_api/#simpletypes) | false | none | none |

or

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| » *anonymous* | \[[simpleTypes](https://guardrailsai.com/docs/guardrails_server_api/#simpletypes)] | false | none | none |

#### **meta-data**

```python theme={null}
{
  "title": "string",
  "description": "string",
  "default": null,
  "deprecated": false,
  "readOnly": false,
  "writeOnly": false,
  "examples": [
    null
  ]
}
```

Meta-data vocabulary meta-schema

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| Meta-data vocabulary meta-schema | object,boolean | false | none | none |
| title | string | false | none | none |
| description | string | false | none | none |
| default | any | false | none | none |
| deprecated | boolean | false | none | none |
| readOnly | boolean | false | none | none |
| writeOnly | boolean | false | none | none |
| examples | \[any] | false | none | none |

### **format-annotation**

```
{
  "format": "string"
}
```

Format vocabulary meta-schema for annotation results

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| Format vocabulary meta-schema for annotation results | object,boolean | false | none | none |
| format | string | false | none | none |

### **content**

```python theme={null}
{
  "contentMediaType": "string",
  "contentEncoding": "string",
  "contentSchema": null
}
```

Content vocabulary meta-schema

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| Content vocabulary meta-schema | object,boolean | false | none | none |
| contentMediaType | string | false | none | none |
| contentEncoding | string | false | none | none |
| contentSchema | any | false | none | none |

### **schema**

```python theme={null}
{
  "definitions": {},
  "dependencies": {
    "property1": {},
    "property2": {}
  },
  "$anchor": "string",
  "$ref": "../dictionary",
  "$dynamicRef": "../dictionary",
  "$dynamicAnchor": "string",
  "$vocabulary": {
    "property1": true,
    "property2": true
  },
  "$comment": "string",
  "$defs": {},
  "prefixItems": [
    null
  ],
  "items": null,
  "contains": null,
  "additionalProperties": null,
  "properties": {},
  "patternProperties": {},
  "dependentSchemas": {
    "property1": null,
    "property2": null
  },
  "propertyNames": null,
  "if": null,
  "then": null,
  "else": null,
  "allOf": [
    null
  ],
  "anyOf": [
    null
  ],
  "oneOf": [
    null
  ],
  "not": null,
  "unevaluatedItems": null,
  "unevaluatedProperties": null,
  "multipleOf": 0,
  "maximum": 0,
  "exclusiveMaximum": 0,
  "minimum": 0,
  "exclusiveMinimum": 0,
  "maxLength": 0,
  "minLength": 0,
  "pattern": "/regex/",
  "maxItems": 0,
  "minItems": 0,
  "uniqueItems": false,
  "maxContains": 0,
  "minContains": 0,
  "maxProperties": 0,
  "minProperties": 0,
  "required": [],
  "dependentRequired": {
    "property1": [],
    "property2": []
  },
  "const": null,
  "enum": [
    null
  ],
  "type": "array",
  "title": "string",
  "description": "string",
  "default": null,
  "deprecated": false,
  "readOnly": false,
  "writeOnly": false,
  "examples": [
    null
  ],
  "format": "string",
  "contentMediaType": "string",
  "contentEncoding": "string",
  "contentSchema": null
}
```

Core and Validation specifications meta-schema

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| Core and Validation specifications meta-schema | object,boolean | false | none | none |
| definitions | object | false | none | none |
| » **additionalProperties** | any | false | none | none |
| dependencies | object | false | none | none |
| » **additionalProperties** | any | false | none | none |

anyOf

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »» *anonymous* | any | false | none | none |

or

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| »» *anonymous* | [validation/definitions/stringArray](https://guardrailsai.com/docs/guardrails_server_api/#stringarray) | false | none | none |

allOf

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | [core](https://guardrailsai.com/docs/guardrails_server_api/#core) | false | none | none |

and

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | [applicator](https://guardrailsai.com/docs/guardrails_server_api/#applicator) | false | none | none |

and

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | [unevaluated](https://guardrailsai.com/docs/guardrails_server_api/#unevaluated) | false | none | none |

and

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | [validation](https://guardrailsai.com/docs/guardrails_server_api/#validation) | false | none | none |

and

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | [meta-data](https://guardrailsai.com/docs/guardrails_server_api/#meta-data) | false | none | none |

and

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | [format-annotation](https://guardrailsai.com/docs/guardrails_server_api/#format-annotation) | false | none | none |

and

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | [content](https://guardrailsai.com/docs/guardrails_server_api/#content) | false | none | none |

### **inputs**

```python theme={null}
{
  "llmApi": "string",
  "llmOutput": "string",
  "messages": [
    {
      "property1": null,
      "property2": null
    }
  ],
  "promptParams": {
    "property1": null,
    "property2": null
  },
  "numReasks": 0,
  "metadata": {
    "property1": null,
    "property2": null
  },
  "fullSchemaReask": true,
  "stream": true
}
```

Inputs

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| llmApi | string | false | none | The LLM resource targeted by the user. e.g. [openai.chat](http://openai.chat).completions.create |
| llmOutput | string | false | none | The string output from an external LLM call provided by the user via Guard.parse. |
| messages | \[object] | false | none | The message history for chat models. |
| » **additionalProperties** | any | false | none | none |
| promptParams | object | false | none | Parameters to be formatted into the prompt. |
| » **additionalProperties** | any | false | none | none |
| numReasks | integer | false | none | The total number of times the LLM can be called to correct output excluding the initial call. |
| metadata | object | false | none | Additional data to be used by Validators during execution time. |
| » **additionalProperties** | any | false | none | none |
| fullSchemaReask | boolean | false | none | Whether to perform reasks for the entire schema rather than for individual fields. |
| stream | boolean | false | none | Whether to use streaming. |

### **pass-result**

```python theme={null}
{
  "outcome": "pass",
  "valueOverride": true,
  "metadata": {
    "property1": null,
    "property2": null
  },
  "validatedChunk": true
}
```

PassResult

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| PassResult | [validation-result](https://guardrailsai.com/docs/guardrails_server_api/#validation-result) | false | none | The output from a single Validator. |
| outcome | any | true | none | none |
| valueOverride | [any-type](https://guardrailsai.com/docs/guardrails_server_api/#any-type) | false | none | none |

#### **validator-log**

```python theme={null}
{
  "validatorName": "string",
  "registeredName": "string",
  "instanceId": "string",
  "propertyPath": "string",
  "valueBeforeValidation": true,
  "valueAfterValidation": true,
  "validationResult": {
    "outcome": "pass",
    "valueOverride": true,
    "metadata": {
      "property1": null,
      "property2": null
    },
    "validatedChunk": true
  },
  "startTime": "2019-08-24T14:15:22Z",
  "endTime": "2019-08-24T14:15:22Z"
}
```

ValidatorLog

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| validatorName | string(PascalCase) | true | none | The class name of the validator. |
| registeredName | string(kebab-case) | true | none | The registry id of the validator. |
| instanceId | any | false | none | A unique identifier for the validator that produced this log within the session. |

anyOf

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| » *anonymous* | string | false | none | none |

or

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| » *anonymous* | integer | false | none | none |

continued

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| propertyPath | string | true | none | The JSON path to the property which was validated that produced this log. |
| valueBeforeValidation | [any-type](https://guardrailsai.com/docs/guardrails_server_api/#any-type) | true | none | none |
| valueAfterValidation | [any-type](https://guardrailsai.com/docs/guardrails_server_api/#any-type) | false | none | none |
| validationResult | any | false | none | none |

anyOf

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| » *anonymous* | [pass-result](https://guardrailsai.com/docs/guardrails_server_api/#pass-result) | false | none | none |

or

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| » *anonymous* | [fail-result](https://guardrailsai.com/docs/guardrails_server_api/#fail-result) | false | none | none |

continued

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| startTime | string(date-time) | false | none | none |
| endTime | string(date-time) | false | none | none |

### **outputs**

```python theme={null}
{
  "llmResponseInfo": {
    "promptTokenCount": 0,
    "responseTokenCount": 0,
    "output": "string",
    "streamOutput": [
      "string"
    ],
    "asyncStreamOutput": [
      "string"
    ]
  },
  "rawOutput": "string",
  "parsedOutput": "string",
  "validationResponse": "string",
  "guardedOutput": "string",
  "reasks": [
    {
      "incorrectValue": true,
      "failResults": [
        {
          "outcome": "pass",
          "errorMessage": "string",
          "fixValue": true,
          "errorSpans": [
            {
              "start": 0,
              "end": 0,
              "reason": "string"
            }
          ],
          "metadata": {
            "property1": null,
            "property2": null
          },
          "validatedChunk": true
        }
      ],
      "property1": null,
      "property2": null
    }
  ],
  "validatorLogs": [
    {
      "validatorName": "string",
      "registeredName": "string",
      "instanceId": "string",
      "propertyPath": "string",
      "valueBeforeValidation": true,
      "valueAfterValidation": true,
      "validationResult": {
        "outcome": "pass",
        "valueOverride": true,
        "metadata": {
          "property1": null,
          "property2": null
        },
        "validatedChunk": true
      },
      "startTime": "2019-08-24T14:15:22Z",
      "endTime": "2019-08-24T14:15:22Z"
    }
  ],
  "error": "string"
}
```

Outputs

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| llmResponseInfo | [LLMResponse](https://guardrailsai.com/docs/guardrails_server_api/#llmresponse) | false | none | Information from the LLM response. |
| rawOutput | string | false | none | The string content from the LLM response. |
| parsedOutput | any | false | none | none |

anyOf

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| » *anonymous* | string | false | none | none |

or

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| » *anonymous* | object | false | none | none |
| »» **additionalProperties** | any | false | none | none |

or

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| » *anonymous* | \[[any-type](https://guardrailsai.com/docs/guardrails_server_api/#any-type)] | false | none | none |

continued

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| validationResponse | any | false | none | none |

anyOf

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| » *anonymous* | string | false | none | none |

or

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| » *anonymous* | [reask](https://guardrailsai.com/docs/guardrails_server_api/#reask) | false | none | none |

or

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| » *anonymous* | object | false | none | none |
| »» **additionalProperties** | any | false | none | none |

or

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| » *anonymous* | \[[any-type](https://guardrailsai.com/docs/guardrails_server_api/#any-type)] | false | none | none |

continued

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| guardedOutput | any | false | none | none |

anyOf

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| » *anonymous* | string | false | none | none |

or

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| » *anonymous* | object | false | none | none |
| »» **additionalProperties** | any | false | none | none |

or

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| » *anonymous* | \[[any-type](https://guardrailsai.com/docs/guardrails_server_api/#any-type)] | false | none | none |

continued

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| reasks | \[[reask](https://guardrailsai.com/docs/guardrails_server_api/#reask)] | false | none | none |
| validatorLogs | \[[validator-log](https://guardrailsai.com/docs/guardrails_server_api/#validator-log)] | false | none | none |
| error | string | false | none | The error message from any exception which interrupted the Guard execution process. |

### **iteration**

```python theme={null}
{
  "id": "string",
  "index": 0,
  "callId": "string",
  "inputs": {
    "llmApi": "string",
    "llmOutput": "string",
    "messages": [
      {
        "property1": null,
        "property2": null
      }
    ],
    "promptParams": {
      "property1": null,
      "property2": null
    },
    "numReasks": 0,
    "metadata": {
      "property1": null,
      "property2": null
    },
    "fullSchemaReask": true,
    "stream": true
  },
  "outputs": {
    "llmResponseInfo": {
      "promptTokenCount": 0,
      "responseTokenCount": 0,
      "output": "string",
      "streamOutput": [
        "string"
      ],
      "asyncStreamOutput": [
        "string"
      ]
    },
    "rawOutput": "string",
    "parsedOutput": "string",
    "validationResponse": "string",
    "guardedOutput": "string",
    "reasks": [
      {
        "incorrectValue": true,
        "failResults": [
          {
            "outcome": "pass",
            "errorMessage": "string",
            "fixValue": true,
            "errorSpans": [
              {
                "start": 0,
                "end": 0,
                "reason": "string"
              }
            ],
            "metadata": {
              "property1": null,
              "property2": null
            },
            "validatedChunk": true
          }
        ],
        "property1": null,
        "property2": null
      }
    ],
    "validatorLogs": [
      {
        "validatorName": "string",
        "registeredName": "string",
        "instanceId": "string",
        "propertyPath": "string",
        "valueBeforeValidation": true,
        "valueAfterValidation": true,
        "validationResult": {
          "outcome": "pass",
          "valueOverride": true,
          "metadata": {
            "property1": null,
            "property2": null
          },
          "validatedChunk": true
        },
        "startTime": "2019-08-24T14:15:22Z",
        "endTime": "2019-08-24T14:15:22Z"
      }
    ],
    "error": "string"
  }
}
```

Iteration

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| id | string | true | none | The unique identifier for this Call. Can be used as an identifier for a specific execution of a Guard. |
| index | integer | true | none | The zero-based index of this iteration within the current Call. |
| callId | string | true | none | The unique identifier for the Call that this iteration is a part of. |
| inputs | [inputs](https://guardrailsai.com/docs/guardrails_server_api/#inputs) | false | none | none |
| outputs | [outputs](https://guardrailsai.com/docs/guardrails_server_api/#outputs) | false | none | none |

### **call**

```python theme={null}
{
  "id": "string",
  "iterations": [],
  "inputs": {
    "llmApi": "string",
    "llmOutput": "string",
    "messages": [
      {
        "property1": null,
        "property2": null
      }
    ],
    "promptParams": {
      "property1": null,
      "property2": null
    },
    "numReasks": 0,
    "metadata": {
      "property1": null,
      "property2": null
    },
    "fullSchemaReask": true,
    "stream": true,
    "args": [
      true
    ],
    "kwargs": {
      "property1": null,
      "property2": null
    }
  },
  "exception": "string"
}
```

Call

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| id | string | true | none | The unique identifier for this Call. Can be used as an identifier for a specific execution of a Guard. |
| iterations | \[[iteration](https://guardrailsai.com/docs/guardrails_server_api/#iteration)] | false | none | none |
| inputs | [CallInputs](https://guardrailsai.com/docs/guardrails_server_api/#callinputs) | false | none | none |
| exception | string | false | none | none |

### **guard**

```python theme={null}
{
  "id": "string",
  "name": "string",
  "description": "string",
  "validators": [
    {
      "id": "string",
      "on": "messages",
      "onFail": "exception",
      "args": [
        true
      ],
      "kwargs": {
        "property1": null,
        "property2": null
      }
    }
  ],
  "output_schema": {
    "definitions": {},
    "dependencies": {
      "property1": {},
      "property2": {}
    },
    "$anchor": "string",
    "$ref": "../dictionary",
    "$dynamicRef": "../dictionary",
    "$dynamicAnchor": "string",
    "$vocabulary": {
      "property1": true,
      "property2": true
    },
    "$comment": "string",
    "$defs": {},
    "prefixItems": [
      null
    ],
    "items": null,
    "contains": null,
    "additionalProperties": null,
    "properties": {},
    "patternProperties": {},
    "dependentSchemas": {
      "property1": null,
      "property2": null
    },
    "propertyNames": null,
    "if": null,
    "then": null,
    "else": null,
    "allOf": [
      null
    ],
    "anyOf": [
      null
    ],
    "oneOf": [
      null
    ],
    "not": null,
    "unevaluatedItems": null,
    "unevaluatedProperties": null,
    "multipleOf": 0,
    "maximum": 0,
    "exclusiveMaximum": 0,
    "minimum": 0,
    "exclusiveMinimum": 0,
    "maxLength": 0,
    "minLength": 0,
    "pattern": "/regex/",
    "maxItems": 0,
    "minItems": 0,
    "uniqueItems": false,
    "maxContains": 0,
    "minContains": 0,
    "maxProperties": 0,
    "minProperties": 0,
    "required": [],
    "dependentRequired": {
      "property1": [],
      "property2": []
    },
    "const": null,
    "enum": [
      null
    ],
    "type": "array",
    "title": "string",
    "description": "string",
    "default": null,
    "deprecated": false,
    "readOnly": false,
    "writeOnly": false,
    "examples": [
      null
    ],
    "format": "string",
    "contentMediaType": "string",
    "contentEncoding": "string",
    "contentSchema": null
  },
  "history": [
    {
      "id": "string",
      "iterations": [],
      "inputs": {
        "llmApi": "string",
        "llmOutput": "string",
        "messages": [
          {
            "property1": null,
            "property2": null
          }
        ],
        "promptParams": {
          "property1": null,
          "property2": null
        },
        "numReasks": 0,
        "metadata": {
          "property1": null,
          "property2": null
        },
        "fullSchemaReask": true,
        "stream": true,
        "args": [
          true
        ],
        "kwargs": {
          "property1": null,
          "property2": null
        }
      },
      "exception": "string"
    }
  ]
}
```

Guard

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| id | string(kebab-case) | true | none | The unique identifier for the Guard. |
| name | string | true | none | The name for the Guard. |
| description | string | false | none | A description that concisely states the expected behaviour or purpose of the Guard. |
| validators | \[[ValidatorReference](https://guardrailsai.com/docs/guardrails_server_api/#validatorreference)] | false | none | none |
| output\_schema | [schema](https://guardrailsai.com/docs/guardrails_server_api/#schema) | false | none | none |
| history | \[[call](https://guardrailsai.com/docs/guardrails_server_api/#call)] | false | read-only | none |

### **ValidatePayload**

```python theme={null}
{
  "llmOutput": "stubbed llm output",
  "numReasks": 0,
  "promptParams": {
    "property1": null,
    "property2": null
  },
  "llmApi": "openai.Completion.create",
  "property1": null,
  "property2": null
}
```

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| **additionalProperties** | any | false | none | none |
| llmOutput | string | false | none | The LLM output as a string or the input prompts for the LLM |
| numReasks | integer | false | none | An override for the number of re-asks to perform |
| promptParams | object | false | none | additional params for llm prompts |
| » **additionalProperties** | any | false | none | none |
| llmApi | [LLMResource](https://guardrailsai.com/docs/guardrails_server_api/#llmresource) | false | none | none |

### **LLMResource**

```
"openai.Completion.create"
```

#### **Properties**

| **Name** | **Type** | **Required** | **Restrictions** | **Description** |
| :- | :- | :- | :- | :- |
| *anonymous* | string | false | none | none |

#### **Enumerated Values**

| **Property** | **Value** |
| :- | :- |
| *anonymous* | openai.Completion.create |
| *anonymous* | openai.completions.create |
| *anonymous* | openai.ChatCompletion.create |
| *anonymous* | [openai.chat](http://openai.chat).completions.create |
| *anonymous* | openai.Completion.acreate |
| *anonymous* | openai.ChatCompletion.acreate |
| *anonymous* | litellm.completion |
| *anonymous* | litellm.acompletion |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.