API Documentation
Guardian

<POST> Chat API

3min
response field definitions the table below provides a comprehensive breakdown of all the fields included in the api response it describes each field's purpose, type, and possible values to help you understand how to interpret the api's output effectively field type description api status code integer http status code of the api response possible values 200 (success), 401 (access denied), 412 (precondition failed), 500 (internal server error) api status message string message indicating the status of the api call (e g , "successful", "llm connectivity issue", "internal server error", "access denied") app prompt string the user's application specific prompt app prompt context string context provided alongside the user's prompt this field is currently an empty string input dictionary details about the input, including guardrails metadata input configuration, number of active and inactive guardrails num tokens number of tokens processed in the input violated policies policies violated, if any, or an empty string latency/sec given user's prompt processing time in sec output dictionary details about the output, including guardrails metadata output configuration, number of active and inactive guardrails num tokens number of tokens processed in the input violated policies policies violated, if any, or an empty string latency/sec llm response processing time in sec metadata dictionary metadata about the api call, including api version api version (e g , v1 5) app name application name event id unique identifier for the api call execution mode mode of operation (e g , block) timestamp time of the api call in gmt redacted prompt string sanitized or redacted version of the user prompt if pii redaction is enabled, or an empty string otherwise siem dictionary security information and event management (siem) details, including active siem list of active siem systems inactive siem list of inactive siem systems status code status code for siem processing possible values 200 (success) , 500 (internal server error), null or empty is not needed to send message to siem status message status message for siem processing (e g , "successful", "internal server error", empty string ) violation exist boolean indicates if any policy violations occurred ( true or false ) violation on string indicates whether the policy violation occurred due to the user's prompt ( input ) or the llm response( output ) connecting to the chat api this below gist provides a detailed example of how to connect to the chat api, including how to structure the request, handle the response, and customize the api call based on your specific needs to get started with integrating the chat api , you can refer to the following github gist for a step by step guide and example code