> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo-helix/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo-helix/_mcp/server.

# Guardrail check request

POST /apis/guardrails/v2/workspaces/{workspace}/checks
Content-Type: application/json

Chat completion for the provided conversation.

Reference: https://docs.nvidia.com/nemo-helix/documentation/reference/api-reference/guardrails/check-apis-guardrails-v-2-workspaces-workspace-checks-post

## Request

### Path parameters

- `workspace` (string, required)

### Body (application/json)

This endpoint expects a GuardrailCheckRequest.

- `model` (string, required) — The model to use for completion. Must be one of the available models.
- `messages` (list of GuardrailCheckRequestMessagesItems, required) — A list of messages comprising the conversation so far
- `response_format` (map from string to any, optional) — Format of the response. Use \{'type': 'json\_object'} for JSON mode or \{'type': 'json\_schema', 'json\_schema': \{...}} for structured outputs.
- `max_tokens` (integer, optional) — The maximum number of tokens that can be generated in the chat completion.
- `n` (integer, optional) — How many chat completion choices to generate for each input message.
- `stream` (boolean, optional, default: false) — If set, partial message deltas will be sent, like in ChatGPT.
- `temperature` (double, optional) — What sampling temperature to use, between 0 and 2.
- `top_p` (double, optional) — An alternative to sampling with temperature, called nucleus sampling.
- `stop` (GuardrailCheckRequestStop, optional) — Up to 4 sequences where the API will stop generating further tokens.
- `frequency_penalty` (double, optional) — Positive values penalize new tokens based on their existing frequency in the text.
- `presence_penalty` (double, optional) — Positive values penalize new tokens based on whether they appear in the text so far.
- `function_call` (GuardrailCheckRequestFunctionCall, optional) — Deprecated in favor of tool\_choice. 'none' means the model will not call a function and instead generates a message. 'auto' means the model can pick between generating a message or calling a function. Specifying a particular function via \{'name': 'my\_function'} forces the model to call that function.
- `seed` (integer, optional) — If specified, attempts to sample deterministically.
- `logit_bias` (map from string to double, optional) — Modify the likelihood of specified tokens appearing in the completion. Maps token IDs (as strings) to bias values from -100 to 100.
- `top_logprobs` (integer, optional) — The number of most likely tokens to return at each token position.
- `logprobs` (boolean, optional) — Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message
- `tool_choice` (GuardrailCheckRequestToolChoice, optional) — Controls which (if any) tool is called by the model. 'none' means no tool is called, 'auto' lets the model decide, 'required' forces a tool call.
- `user` (string, optional) — A unique identifier representing your end-user, used by some providers for abuse monitoring.
- `tools` (list of map from string to any, optional) — A list of tools the model may call. Each tool is an object with a 'type' field and a 'function' definition.
- `ignore_eos` (boolean, optional) — Ignore the eos when running
- `reasoning_effort` (string, optional) — Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
- `max_completion_tokens` (integer, optional) — An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. Preferred over max_tokens for reasoning models.
- `stream_options` (map from string to boolean, optional) — Options for streaming response. Only set this when stream=True. Supports include_usage to receive token usage in the final stream chunk.
- `vision` (boolean, optional) — Whether this is a vision-capable request with image inputs.
- `guardrails` (GuardrailsDataInput, optional) — Guardrails specific options for the request.

## Response

### 200

Successful Response

- `status` (enum, required) — Overall status indicating if all rails passed or if any failed.
  - Allowed values: `blocked`, `success`, `unknown`
- `rails_status` (map from string to RailStatus, required) — Dictionary mapping each rail to its status.
- `guardrails_data` (GuardrailsDataOutput, optional) — Additional data related to guardrails.

## Errors

### 400 Bad Request Error

Invalid Request Body

- `any`

### 422 Unprocessable Entity Error

Validation Error

- `any`

### 500 Internal Server Error

Internal Server Error

- `any`

## Types

### GuardrailCheckRequestMessagesItems

### GuardrailCheckRequestStop

Up to 4 sequences where the API will stop generating further tokens.

### GuardrailCheckRequestFunctionCall

Deprecated in favor of tool\_choice. 'none' means the model will not call a function and instead generates a message. 'auto' means the model can pick between generating a message or calling a function. Specifying a particular function via \{'name': 'my\_function'} forces the model to call that function.

### GuardrailCheckRequestToolChoice

Controls which (if any) tool is called by the model. 'none' means no tool is called, 'auto' lets the model decide, 'required' forces a tool call.

### GuardrailsDataInput

- `config` (GuardrailsDataInputConfig, optional, default: system/default) — The id of the configuration or its dict representation to be used.
- `config_id` (string, optional, default: system/default) — The id of the configuration to be used.
- `config_ids` (list of string, optional) — The list of configuration ids to be used. If set, the configurations will be combined.
- `return_choice` (boolean, optional, default: false) — If set, guardrails data will be included as a JSON in the choices array.
- `context` (map from string to any, optional) — Additional context data to be added to the conversation.
- `stream` (boolean, optional, default: false) — If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message.
- `options` (GenerationOptions, optional) — Additional options for controlling the generation.
- `state` (map from string to any, optional) — A state object that should be used to continue the interaction.

### RailStatus

- `status` (enum, required) — Status of the individual rail.
  - Allowed values: `blocked`, `success`, `unknown`

### GuardrailsDataOutput

- `llm_output` (map from string to any, optional) — Contains any additional output coming from the LLM.
- `config_ids` (list of string, optional) — The list of configuration ids that were used.
- `output_data` (map from string to any, optional) — The output data, i.e. a dict with the values corresponding to the `output_vars`.
- `log` (GenerationLog, optional) — Additional logging information.

### ChatCompletionSystemMessageParam

System message parameter for chat completion.

- `content` (string, required) — The contents of the system message.
- `role` ("system", required) — The role of the messages author, in this case `system`.
- `name` (string, optional) — An optional name for the participant.

### ChatCompletionUserMessageParam

User message parameter for chat completion.

- `content` (ChatCompletionUserMessageParamContent, required) — The contents of the user message.
- `role` ("user", required) — The role of the messages author, in this case `user`.
- `name` (string, optional) — An optional name for the participant.

### ChatCompletionAssistantMessageParam

Assistant message parameter for chat completion.

- `role` ("assistant", required) — The role of the messages author, in this case `assistant`.
- `content` (string, optional) — The contents of the assistant message.
- `function_call` (FunctionCall, optional) — Deprecated and replaced by `tool_calls`.
- `name` (string, optional) — An optional name for the participant.
- `tool_calls` (list of ChatCompletionMessageToolCallParam, optional) — The tool calls generated by the model, such as function calls.

### ChatCompletionToolMessageParam

Tool message parameter for chat completion.

- `content` (string, required) — The contents of the tool message.
- `role` ("tool", required) — The role of the messages author, in this case `tool`.
- `tool_call_id` (string, required) — Tool call that this message is responding to.

### ChatCompletionFunctionMessageParam

Function message parameter for chat completion.

- `content` (string, required) — The contents of the function message.
- `name` (string, required) — The name of the function to call.
- `role` ("function", required) — The role of the messages author, in this case `function`.

### GuardrailsDataInputConfig

The id of the configuration or its dict representation to be used.

### GenerationOptions

A set of options that should be applied during a generation. The GenerationOptions control various things such as what rails are enabled, additional parameters for the main LLM, whether the rails should be enforced or ran in parallel, what to be included in the generation log, etc.

- `rails` (GenerationRailsOptions, optional) — Options for which rails should be applied for the generation. By default, all rails are enabled.
- `llm_params` (map from string to any, optional) — Additional parameters that should be used for the LLM call
- `llm_output` (boolean, optional, default: false) — Whether the response should also include any custom LLM output.
- `output_vars` (GenerationOptionsOutputVars, optional) — Whether additional context information should be returned. When True is specified, the whole context is returned. Otherwise, a list of key names can be specified.
- `log` (GenerationLogOptions, optional) — Options about what to include in the log. By default, nothing is included.

### GenerationLog

Contains additional logging information associated with a generation call.

- `activated_rails` (list of ActivatedRail, optional) — The list of rails that were activated during generation.
- `stats` (GenerationStats, optional) — General stats about the generation process.
- `llm_calls` (list of LLMCallInfo, optional) — The list of LLM calls that have been made to fulfill the generation request.
- `internal_events` (list of map from string to any, optional) — The complete sequence of internal events generated.
- `colang_history` (string, optional) — The Colang history associated with the generation.

### ChatCompletionUserMessageParamContent

The contents of the user message.

### FunctionCall

Function call information.

- `arguments` (string, required) — The arguments to call the function with, as generated by the model in JSON format.
- `name` (string, required) — The name of the function to call.

### ChatCompletionMessageToolCallParam

Tool call parameter for chat completion messages.

- `id` (string, required) — The ID of the tool call.
- `function` (Function, required) — The function that the model called.
- `type` ("function", required) — The type of the tool. Currently, only `function` is supported.

### RailsConfig

Configuration object for the models and the rails.

- `models` (list of Model, optional) — The list of models used by the rails configuration.
- `instructions` (list of Instruction, optional, default: [{"type":"general","content":"Below is a conversation between a helpful AI assistant and a user. The bot is designed to generate human-like text based on the input that it receives. The bot is talkative and provides lots of specific details. If the bot does not know the answer to a question, it truthfully says it does not know."}]) — List of instructions in natural language that the LLM should use.
- `actions_server_url` (string, optional) — The URL of the actions server that should be used for the rails.
- `sample_conversation` (string, optional, default: user "Hello there!"
  express greeting
bot express greeting
  "Hello! How can I assist you today?"
user "What can you do for me?"
  ask about capabilities
bot respond about capabilities
  "As an AI assistant, I can help you with a wide range of tasks. This includes question answering on various topics, generating text for various purposes and providing suggestions based on your preferences."
user "Tell me a bit about the history of NVIDIA."
  ask general question
bot response for general question
  "NVIDIA is a technology company that specializes in designing and manufacturing graphics processing units (GPUs) and other computer hardware. The company was founded in 1993 by Jen-Hsun Huang, Chris Malachowsky, and Curtis Priem."
user "tell me more"
  request more information
bot provide more information
  "Initially, the company focused on developing 3D graphics processing technology for the PC gaming market. In 1999, NVIDIA released the GeForce 256, the world's first GPU, which was a major breakthrough for the gaming industry. The company continued to innovate in the GPU space, releasing new products and expanding into other markets such as professional graphics, mobile devices, and artificial intelligence."
user "thanks"
  express appreciation
bot express appreciation and offer additional help
  "You're welcome. If you have any more questions or if there's anything else I can help you with, please don't hesitate to ask."
) — The sample conversation that should be used inside the prompts.
- `prompts` (list of TaskPrompt, optional) — The prompts that should be used for the various LLM tasks.
- `prompting_mode` (string, optional, default: standard) — Allows choosing between different prompting strategies.
- `lowest_temperature` (double, optional, default: 0.001) — The lowest temperature that should be used for the LLM.
- `enable_multi_step_generation` (boolean, optional, default: false) — Whether to enable multi-step generation for the LLM.
- `colang_version` (string, optional, default: 1.0) — The Colang version to use.
- `custom_data` (map from string to any, optional) — Any custom configuration data that might be needed.
- `rails` (Rails, optional) — Configuration for the various rails (input, output, etc.).
- `enable_rails_exceptions` (boolean, optional, default: false) — If set, the pre-defined guardrails raise exceptions instead of returning pre-defined messages.
- `passthrough` (boolean, optional) — Whether the original prompt should pass through the guardrails configuration as is. This means it will not be altered in any way.
- `tracing` (TracingConfig, optional) — Configuration for tracing.

### GenerationRailsOptions

Options for what rails should be used during the generation.

- `input` (GenerationRailsOptionsInput, optional, default: true) — Whether the input rails are enabled or not. If a list of names is specified, then only the specified input rails will be applied.
- `output` (GenerationRailsOptionsOutput, optional, default: true) — Whether the output rails are enabled or not. If a list of names is specified, then only the specified output rails will be applied.
- `retrieval` (GenerationRailsOptionsRetrieval, optional, default: true) — Whether the retrieval rails are enabled or not. If a list of names is specified, then only the specified retrieval rails will be applied.
- `dialog` (boolean, optional, default: true) — Whether the dialog rails are enabled or not.

### GenerationOptionsOutputVars

Whether additional context information should be returned. When True is specified, the whole context is returned. Otherwise, a list of key names can be specified.

### GenerationLogOptions

Options for what should be included in the generation log.

- `activated_rails` (boolean, optional, default: false) — Include detailed information about the rails that were activated during generation.
- `llm_calls` (boolean, optional, default: false) — Include information about all the LLM calls that were made. This includes: prompt, completion, token usage, raw response, etc.
- `internal_events` (boolean, optional, default: false) — Include the array of internal generated events.
- `colang_history` (boolean, optional, default: false) — Include the history of the conversation in Colang format.
- `stats` (boolean, optional, default: false) — Include generation statistics — rail durations, LLM call counts, and token usage.

### ActivatedRail

A rail that was activated during the generation.

- `type` (string, required) — The type of the rail that was activated, e.g., input, output, dialog.
- `name` (string, required) — The name of the rail, i.e., the name of the flow implementing the rail.
- `decisions` (list of string, optional) — A sequence of decisions made by the rail, e.g., 'bot refuse to respond', 'stop', 'continue'.
- `executed_actions` (list of ExecutedAction, optional) — The list of actions executed by the rail.
- `stop` (boolean, optional, default: false) — Whether the rail decided to stop any further processing.
- `additional_info` (map from string to any, optional) — Additional information coming from rail.
- `started_at` (double, optional) — Timestamp for when the rail started.
- `finished_at` (double, optional) — Timestamp for when the rail finished.
- `duration` (double, optional) — The duration in seconds for applying the rail. Some rails are applied instantly, e.g., dialog rails, so they don't have a duration.

### GenerationStats

General stats about the generation.

- `input_rails_duration` (double, optional) — The time in seconds spent in processing the input rails.
- `dialog_rails_duration` (double, optional) — The time in seconds spent in processing the dialog rails.
- `generation_rails_duration` (double, optional) — The time in seconds spent in generation rails.
- `output_rails_duration` (double, optional) — The time in seconds spent in processing the output rails.
- `total_duration` (double, optional) — The total time in seconds.
- `llm_calls_duration` (double, optional, default: 0) — The time in seconds spent in LLM calls.
- `llm_calls_count` (integer, optional, default: 0) — The number of LLM calls in total.
- `llm_calls_total_prompt_tokens` (integer, optional, default: 0) — The total number of prompt tokens.
- `llm_calls_total_completion_tokens` (integer, optional, default: 0) — The total number of completion tokens.
- `llm_calls_total_tokens` (integer, optional, default: 0) — The total number of tokens.

### LLMCallInfo

- `task` (string, optional) — The internal task that made the call.
- `duration` (double, optional) — The duration in seconds.
- `total_tokens` (integer, optional) — The total number of used tokens.
- `prompt_tokens` (integer, optional) — The number of input tokens.
- `completion_tokens` (integer, optional) — The number of output tokens.
- `started_at` (double, optional, default: 0) — The timestamp for when the LLM call started.
- `finished_at` (double, optional, default: 0) — The timestamp for when the LLM call finished.
- `id` (string, optional) — The unique prompt identifier.
- `prompt` (string, optional) — The prompt that was used for the LLM call.
- `completion` (string, optional) — The completion generated by the LLM.
- `raw_response` (map from string to any, optional) — The raw response received from the LLM. May contain additional information, e.g. logprobs.
- `llm_model_name` (string, optional, default: unknown) — The name of the model use for the LLM call.

### Function

Function definition for tool calls.

- `arguments` (string, required) — The arguments to call the function with, as generated by the model in JSON format.
- `name` (string, required) — The name of the function to call.

### Model

Configuration of a model used by the rails engine. If using Inference Gateway, the `model` field should be a Model Entity reference ('workspace/model_name').

- `type` (string, required)
- `engine` (string, required)
- `model` (string, optional) — The model name. If using Inference Gateway, this should be the Model Entity reference ('workspace/model_name').
- `parameters` (ModelParameters, optional) — Additional parameters to configure how to interact with the model.
- `mode` (enum, optional, default: chat) — Whether the mode is 'text' completion or 'chat' completion. Allowed values are 'chat' or 'text'.
  - Allowed values: `chat`, `text`
- `cache` (ModelCacheConfig, optional) — Cache configuration for this specific model (primarily used for content safety models)

### Instruction

Configuration for instructions in natural language that should be passed to the LLM.

- `type` (string, required)
- `content` (string, required)

### TaskPrompt

Configuration for prompts that will be used for a specific task.

- `task` (string, required) — The id of the task associated with this prompt.
- `content` (string, optional) — The content of the prompt, if it's a string.
- `messages` (list of TaskPromptMessagesItems, optional) — The list of messages included in the prompt. Used for chat models.
- `models` (list of string, optional) — If specified, the prompt will be used only for the given LLM engines/models. The format is a list of strings with the format: \<engine> or \<engine>/\<model>.
- `output_parser` (string, optional) — The name of the output parser to use for this prompt.
- `max_length` (integer, optional, default: 16000) — The maximum length of the prompt in number of characters.
- `mode` (string, optional, default: standard) — Corresponds to the `prompting_mode` for which this prompt is fetched. Default is 'standard'.
- `stop` (list of string, optional) — If specified, will be configure stop tokens for models that support this.
- `max_tokens` (integer, optional) — The maximum number of tokens that can be generated in the chat completion.

### Rails

Configuration of specific rails.

- `config` (RailsConfigData, optional) — Configuration data for specific rails that are supported out-of-the-box.
- `input` (InputRails, optional) — Configuration of the input rails.
- `output` (OutputRails, optional) — Configuration of the output rails.
- `retrieval` (RetrievalRails, optional) — Configuration of the retrieval rails.
- `dialog` (DialogRails, optional) — Configuration of the dialog rails.
- `actions` (ActionRails, optional) — Configuration of action rails.
- `tool_output` (ToolOutputRails, optional) — Configuration of tool output rails.
- `tool_input` (ToolInputRails, optional) — Configuration of tool input rails.

### TracingConfig

- `enabled` (boolean, optional, default: false)
- `adapters` (list of LogAdapterConfig, optional) — The list of tracing adapters to use. If not specified, the default adapters are used.
- `span_format` (string, optional, default: opentelemetry) — The span format to use. Options are 'legacy' (simple metrics) or 'opentelemetry' (OpenTelemetry semantic conventions).
- `enable_content_capture` (boolean, optional, default: false) — Capture prompts and responses (user/assistant/tool message content) in tracing/telemetry events. Disabled by default for privacy and alignment with OpenTelemetry GenAI semantic conventions. WARNING: Enabling this may include PII and sensitive data in your telemetry backend.

### GenerationRailsOptionsInput

Whether the input rails are enabled or not. If a list of names is specified, then only the specified input rails will be applied.

### GenerationRailsOptionsOutput

Whether the output rails are enabled or not. If a list of names is specified, then only the specified output rails will be applied.

### GenerationRailsOptionsRetrieval

Whether the retrieval rails are enabled or not. If a list of names is specified, then only the specified retrieval rails will be applied.

### ExecutedAction

Information about an action that was executed.

- `action_name` (string, required) — The name of the action that was executed.
- `action_params` (map from string to any, optional) — The parameters for the action.
- `return_value` (any, optional) — The value returned by the action.
- `llm_calls` (list of LLMCallInfo, optional) — Information about the LLM calls made by the action.
- `started_at` (double, optional) — Timestamp for when the action started.
- `finished_at` (double, optional) — Timestamp for when the action finished.
- `duration` (double, optional) — How long the action took to execute, in seconds.

### ModelParameters

Parameters for configuring how to interact with a model in a guardrails config.

- `base_url` (string, optional) — The URL to use for inference with this model.
- `default_headers` (map from string to string, optional) — Custom HTTP headers to include in requests to this model. Each key-value pair represents a header name (key) and its default value (value). You can override the default value for a header by populating it in the request headers.

### ModelCacheConfig

Configuration for model caching.

- `enabled` (boolean, optional, default: false) — Whether caching is enabled (default: False - no caching)
- `maxsize` (integer, optional, default: 50000) — Maximum number of entries in the cache per model
- `stats` (CacheStatsConfig, optional) — Configuration for cache statistics tracking and logging

### TaskPromptMessagesItems

### RailsConfigData

Configuration data for specific rails that are supported out-of-the-box.

- `fact_checking` (FactCheckingRailConfig, optional) — Configuration data for the fact-checking rail.
- `autoalign` (AutoAlignRailConfig, optional) — Configuration data for the AutoAlign guardrails API.
- `patronus` (PatronusRailConfig, optional) — Configuration data for the Patronus Evaluate API.
- `sensitive_data_detection` (SensitiveDataDetection, optional) — Configuration for detecting sensitive data.
- `regex_detection` (RegexDetection, optional) — Configuration for regex pattern detection.
- `jailbreak_detection` (JailbreakDetectionConfig, optional) — Configuration for jailbreak detection.
- `injection_detection` (InjectionDetection, optional) — Configuration for injection detection.
- `privateai` (PrivateAIDetection, optional) — Configuration for Private AI.
- `gliner` (GLiNERDetection, optional) — Configuration for GLiNER PII detection.
- `polygraf` (PolygrafDetection, optional) — Configuration for Polygraf PII detection.
- `fiddler` (FiddlerGuardrails, optional) — Configuration for Fiddler Guardrails.
- `clavata` (ClavataRailConfig, optional) — Configuration for Clavata.
- `crowdstrike_aidr` (CrowdStrikeAIDRRailConfig, optional) — Configuration for CrowdStrike AIDR.
- `pangea` (PangeaRailConfig, optional) — Configuration for Pangea.
- `guardrails_ai` (GuardrailsAIRailConfig, optional) — Configuration for Guardrails AI validators.
- `trend_micro` (TrendMicroRailConfig, optional) — Configuration for Trend Micro.
- `ai_defense` (AIDefenseRailConfig, optional) — Configuration for Cisco AI Defense.
- `content_safety` (ContentSafetyConfig, optional) — Configuration for content safety rails.
- `hf_classifier` (map from string to RailsConfigDataHfClassifier, optional) — Named HF classifier configurations. Keys are classifier names referenced by flows.
- `context_bloat_detection` (ContextBloatDetectionConfig, optional) — Configuration for context bloat / context manipulation detection.

### InputRails

Configuration of input rails.

- `parallel` (boolean, optional, default: false) — If True, the input rails are executed in parallel.
- `flows` (list of string, optional) — The names of all the flows that implement input rails.

### OutputRails

Configuration of output rails.

- `parallel` (boolean, optional, default: false) — If True, the output rails are executed in parallel.
- `flows` (list of string, optional) — The names of all the flows that implement output rails.
- `streaming` (OutputRailsStreamingConfig, optional) — Configuration for streaming output rails.
- `apply_to_reasoning_traces` (boolean, optional, default: false) — If True, output rails will apply guardrails to both reasoning traces and output response. If False, output rails will only apply guardrails to the output response excluding the reasoning traces, thus keeping reasoning traces unaltered.

### RetrievalRails

Configuration of retrieval rails.

- `flows` (list of string, optional) — The names of all the flows that implement retrieval rails.

### DialogRails

Configuration of topical rails.

- `single_call` (SingleCallConfig, optional) — Configuration for the single LLM call option.
- `user_messages` (UserMessagesConfig, optional) — Configuration for how the user messages are interpreted.

### ActionRails

Configuration of action rails. Action rails control various options related to the execution of actions. Currently, only In the future multiple options will be added, e.g., what input validation should be performed per action, output validation, throttling, disabling, etc.

- `instant_actions` (list of string, optional) — The names of all actions which should finish instantly.

### ToolOutputRails

Configuration of tool output rails. Tool output rails are applied to tool calls before they are executed. They can validate tool names, parameters, and context to ensure safe tool usage.

- `flows` (list of string, optional) — The names of all the flows that implement tool output rails.
- `parallel` (boolean, optional, default: false) — If True, the tool output rails are executed in parallel.

### ToolInputRails

Configuration of tool input rails. Tool input rails are applied to tool results before they are processed. They can validate, filter, or transform tool outputs for security and safety.

- `flows` (list of string, optional) — The names of all the flows that implement tool input rails.
- `parallel` (boolean, optional, default: false) — If True, the tool input rails are executed in parallel.

### LogAdapterConfig

- `name` (string, optional, default: FileSystem) — The name of the adapter.

### CacheStatsConfig

Configuration for cache statistics tracking and logging.

- `enabled` (boolean, optional, default: false) — Whether cache statistics tracking is enabled
- `log_interval` (double, optional) — Seconds between periodic cache stats logging to logs (None disables logging)

### MessageTemplate

Template for a message structure.

- `type` (string, required) — The type of message, e.g., 'assistant', 'user', 'system'.
- `content` (string, required) — The content of the message.

### FactCheckingRailConfig

Configuration data for the fact-checking rail.

- `parameters` (map from string to any, optional)
- `fallback_to_self_check` (boolean, optional, default: false) — Whether to fall back to self-check if another method fail.

### AutoAlignRailConfig

Configuration data for the AutoAlign API

- `parameters` (map from string to any, optional)
- `input` (AutoAlignOptions, optional) — Input configuration for AutoAlign guardrails
- `output` (AutoAlignOptions, optional) — Output configuration for AutoAlign guardrails

### PatronusRailConfig

Configuration data for the Patronus Evaluate API

- `input` (PatronusEvaluateConfig, optional) — Patronus Evaluate API configuration for an Input Guardrail
- `output` (PatronusEvaluateConfig, optional) — Patronus Evaluate API configuration for an Output Guardrail

### SensitiveDataDetection

Configuration of what sensitive data should be detected.

- `recognizers` (list of map from string to any, optional) — Additional custom recognizers. Check out https://microsoft.github.io/presidio/tutorial/08_no_code/ for more details.
- `input` (SensitiveDataDetectionOptions, optional) — Configuration of the entities to be detected on the user input.
- `output` (SensitiveDataDetectionOptions, optional) — Configuration of the entities to be detected on the bot output.
- `retrieval` (SensitiveDataDetectionOptions, optional) — Configuration of the entities to be detected on retrieved relevant chunks.

### RegexDetection

Configuration for regex pattern detection.

- `input` (RegexDetectionOptions, optional) — Configuration for regex patterns to detect on user input.
- `output` (RegexDetectionOptions, optional) — Configuration for regex patterns to detect on bot output.
- `retrieval` (RegexDetectionOptions, optional) — Configuration for regex patterns to detect on retrieved relevant chunks.

### JailbreakDetectionConfig

Configuration data for jailbreak detection.

- `server_endpoint` (string, optional) — The endpoint for the jailbreak detection heuristics/model container.
- `length_per_perplexity_threshold` (double, optional, default: 89.79) — The length/perplexity threshold.
- `prefix_suffix_perplexity_threshold` (double, optional, default: 1845.65) — The prefix/suffix perplexity threshold.
- `nim_base_url` (string, optional) — Base URL for jailbreak detection model. Example: http://localhost:8000/v1
- `nim_server_endpoint` (string, optional, default: classify) — Classification path uri. Defaults to 'classify' for NemoGuard JailbreakDetect.
- `api_key` (string, optional) — Secret String with API key for use in Jailbreak requests. Takes precedence over api_key_env_var
- `api_key_env_var` (string, optional) — Environment variable containing API key for jailbreak detection model
- `nim_url` (string, optional, deprecated) — DEPRECATED: Use nim_base_url instead
- `nim_port` (integer, optional, deprecated) — DEPRECATED: Include port in nim_base_url instead
- `embedding` (string, optional, deprecated)

### InjectionDetection

- `injections` (list of string, optional) — The list of injection types to detect. Options are 'sqli', 'template', 'code', 'xss'.Currently, only SQL injection, template injection, code injection, and markdown cross-site scripting are supported. Custom rules can be added, provided they are in the `yara_path` and have a `.yara` file extension.
- `action` (string, optional, default: reject) — Action to take. Options are 'reject' to offer a rejection message, 'omit' to mask the offending content, and 'sanitize' to pass the content as-is in the safest way. These options are listed in descending order of relative safety. 'sanitize' is not implemented at this time.
- `yara_rules` (map from string to string, optional) — Dictionary mapping rule names to YARA rule strings. If provided, these rules will be used instead of loading rules from yara_path. Each rule should be a valid YARA rule string.

### PrivateAIDetection

Configuration for Private AI.

- `server_endpoint` (string, optional) — The endpoint for the private AI detection server.
- `input` (PrivateAIDetectionOptions, optional) — Configuration of the entities to be detected on the user input.
- `output` (PrivateAIDetectionOptions, optional) — Configuration of the entities to be detected on the bot output.
- `retrieval` (PrivateAIDetectionOptions, optional) — Configuration of the entities to be detected on retrieved relevant chunks.

### GLiNERDetection

Configuration for GLiNER PII detection.

- `server_endpoint` (string, optional, default: http://localhost:8000/v1/chat/completions) — The endpoint for the GLiNER detection server. By default, this is for a locally hosted NIM instance running the GLiNER model. Changed from http://localhost:1235/v1/extract (custom server) to http://localhost:8000/v1/chat/completions (NIM) in this release. If you use the custom gliner_server, set this explicitly to http://localhost:1235/v1/extract.
- `model` (string, optional, default: nvidia/gliner-pii) — Model identifier sent in NIM API requests (only used when server_endpoint ends with /v1/chat/completions).
- `api_key_env_var` (string, optional) — Name of the environment variable containing the API key for authenticated endpoints (e.g., NVIDIA_API_KEY).
- `threshold` (double, optional, default: 0.5) — Confidence threshold for entity detection (0.0 to 1.0).
- `chunk_length` (integer, optional, default: 384) — Length of text chunks for processing.
- `overlap` (integer, optional, default: 128) — Overlap between chunks.
- `flat_ner` (boolean, optional, default: false) — Whether to use flat NER mode. Setting to False allows for nested entities.
- `input` (GLiNERDetectionOptions, optional) — Configuration of the entities to be detected on the user input.
- `output` (GLiNERDetectionOptions, optional) — Configuration of the entities to be detected on the bot output.
- `retrieval` (GLiNERDetectionOptions, optional) — Configuration of the entities to be detected on retrieved relevant chunks.

### PolygrafDetection

Configuration for Polygraf PII detection.

- `server_endpoint` (string, optional, default: http://localhost:8000/v1/pii/text-detect) — The endpoint for the Polygraf detection server.
- `input` (PolygrafDetectionOptions, optional) — Configuration of the entities to be detected on the user input.
- `output` (PolygrafDetectionOptions, optional) — Configuration of the entities to be detected on the bot output.
- `retrieval` (PolygrafDetectionOptions, optional) — Configuration of the entities to be detected on retrieved relevant chunks.

### FiddlerGuardrails

Configuration for Fiddler Guardrails.

- `fiddler_endpoint` (string, optional, default: http://localhost:8080/process/text) — The global endpoint for Fiddler Guardrails requests.
- `safety_threshold` (double, optional, default: 0.1) — Fiddler Guardrails safety detection threshold.
- `faithfulness_threshold` (double, optional, default: 0.05) — Fiddler Guardrails faithfulness detection threshold.

### ClavataRailConfig

Configuration data for the Clavata API

- `server_endpoint` (string, optional, default: https://gateway.app.clavata.ai:8443) — The endpoint for the Clavata API
- `policies` (map from string to string, optional) — A dictionary of policy aliases and their corresponding IDs.
- `label_match_logic` (enum, optional, default: ANY) — The logic to use when deciding whether the evaluation matched. If ANY, only one of the configured labels needs to be found in the input or output. If ALL, all configured labels must be found in the input or output.
  - Allowed values: `ANY`, `ALL`
- `input` (ClavataRailOptions, optional) — Clavata configuration for an Input Guardrail
- `output` (ClavataRailOptions, optional) — Clavata configuration for an Output Guardrail

### CrowdStrikeAIDRRailConfig

Configuration data for the CrowdStrike AIDR API

- `timeout` (double, optional, default: 30) — Timeout in seconds for API requests to CrowdStrike AIDR

### PangeaRailConfig

Configuration data for the Pangea AI Guard API

- `input` (PangeaRailOptions, optional) — Pangea configuration for an Input Guardrail
- `output` (PangeaRailOptions, optional) — Pangea configuration for an Output Guardrail

### GuardrailsAIRailConfig

Configuration data for Guardrails AI integration.

- `validators` (list of GuardrailsAIValidatorConfig, optional) — List of Guardrails AI validators to apply. Each validator can have its own parameters and metadata.

### TrendMicroRailConfig

Configuration data for the Trend Micro AI Guard API

- `v1_url` (string, optional, default: https://api.xdr.trendmicro.com/v3.0/aiSecurity/applyGuardrails) — The endpoint for the Trend Micro AI Guard API. For other regions, use: [https://api.\{region}.xdr.trendmicro.com/v3.0/aiSecurity/applyGuardrails](https://api.\{region}.xdr.trendmicro.com/v3.0/aiSecurity/applyGuardrails) where region is eu, jp, au, in, sg, or mea.
- `api_key_env_var` (string, optional) — Environment variable containing API key for Trend Micro AI Guard
- `application_name` (string, optional, default: nemo-guardrails) — Application name for TMV1-Application-Name header (REQUIRED). Must contain only letters, numbers, hyphens, and underscores, with a maximum length of 64 characters.
- `detailed_response` (boolean, optional, default: false) — If True, returns detailed AI Guard results with confidence scores (Prefer: return=representation). If False, returns minimal response with only action and reasons (Prefer: return=minimal).

### AIDefenseRailConfig

Configuration data for the Cisco AI Defense API

- `timeout` (double, optional, default: 30) — Timeout in seconds for API requests to AI Defense service
- `fail_open` (boolean, optional, default: false) — If True, allow content when AI Defense API call fails (fail open). If False, block content when API call fails (fail closed). Does not affect missing configuration validation.

### ContentSafetyConfig

Configuration data for content safety rails.

- `multilingual` (MultilingualConfig, optional) — Configuration for multilingual refusal messages.
- `reasoning` (ReasoningConfig, optional) — Configuration for reasoning mode in content safety models.

### RailsConfigDataHfClassifier

- `engine`: `fms` (RemoteHFClassifierConfig)
  - `base_url` (string, required) — Base URL for the inference server (e.g. 'http://host:8000').
  - `model` (string, required) — HF model ID, local path, or server-side model identifier.
  - `api_key_env_var` (string, optional) — Environment variable name holding the API key. Resolved at runtime to an Authorization: Bearer header.
  - `blocked_labels` (list of string, optional) — Labels that should trigger blocking when detected above threshold.
  - `parameters` (map from string to any, optional) — Remote backend parameters: 'timeout' (float, seconds), 'verify_ssl' (bool), 'ca_cert'/'client_cert'/'client_key' (str, paths). Note: 'ca_cert' replaces (not extends) system CAs; use a concatenated bundle to include both custom and system CAs.
  - `threshold` (double, optional, default: 0.5) — Minimum score for a detection to trigger blocking.
- `engine`: `kserve` (RemoteHFClassifierConfig)
  - `base_url` (string, required) — Base URL for the inference server (e.g. 'http://host:8000').
  - `model` (string, required) — HF model ID, local path, or server-side model identifier.
  - `api_key_env_var` (string, optional) — Environment variable name holding the API key. Resolved at runtime to an Authorization: Bearer header.
  - `blocked_labels` (list of string, optional) — Labels that should trigger blocking when detected above threshold.
  - `parameters` (map from string to any, optional) — Remote backend parameters: 'timeout' (float, seconds), 'verify_ssl' (bool), 'ca_cert'/'client_cert'/'client_key' (str, paths). Note: 'ca_cert' replaces (not extends) system CAs; use a concatenated bundle to include both custom and system CAs.
  - `threshold` (double, optional, default: 0.5) — Minimum score for a detection to trigger blocking.
- `engine`: `local` (LocalHFClassifierConfig)
  - `model` (string, required) — HF model ID, local path, or server-side model identifier.
  - `blocked_labels` (list of string, optional) — Labels that should trigger blocking when detected above threshold.
  - `parameters` (map from string to any, optional) — Forwarded as kwargs to transformers.pipeline() (e.g. device, dtype, trust_remote_code, token, revision, aggregation_strategy).
  - `task` (enum, optional, default: text-classification) — HuggingFace pipeline task type.
    - Allowed values: `text-classification`, `token-classification`
  - `threshold` (double, optional, default: 0.5) — Minimum score for a detection to trigger blocking.
- `engine`: `vllm` (RemoteHFClassifierConfig)
  - `base_url` (string, required) — Base URL for the inference server (e.g. 'http://host:8000').
  - `model` (string, required) — HF model ID, local path, or server-side model identifier.
  - `api_key_env_var` (string, optional) — Environment variable name holding the API key. Resolved at runtime to an Authorization: Bearer header.
  - `blocked_labels` (list of string, optional) — Labels that should trigger blocking when detected above threshold.
  - `parameters` (map from string to any, optional) — Remote backend parameters: 'timeout' (float, seconds), 'verify_ssl' (bool), 'ca_cert'/'client_cert'/'client_key' (str, paths). Note: 'ca_cert' replaces (not extends) system CAs; use a concatenated bundle to include both custom and system CAs.
  - `threshold` (double, optional, default: 0.5) — Minimum score for a detection to trigger blocking.

### ContextBloatDetectionConfig

Configuration for context bloat / context manipulation detection.

- `max_chars` (integer, optional, default: 5000) — Size cap in characters. Inputs exceeding this are flagged.
- `min_chars` (integer, optional, default: 50) — Minimum characters before entropy/run/repetition checks apply. Shorter texts are only checked against size cap.
- `min_entropy` (double, optional, default: 3.5) — Shannon entropy floor (bits/char). English prose is ~4.0-4.5.
- `max_repetition_ratio` (double, optional, default: 0.4) — Max fraction of repeated n-grams (0.0-1.0).
- `ngram_size` (integer, optional, default: 3) — Size of n-grams used for repetition detection.
- `max_run_ratio` (double, optional, default: 0.1) — Max fraction of text that is the longest single-char run.
- `action` (enum, optional, default: reject) — Action on detection: 'reject', 'truncate', or 'warn'.
  - Allowed values: `reject`, `truncate`, `warn`

### OutputRailsStreamingConfig

Configuration for managing streaming output of LLM tokens.

- `enabled` (boolean, optional, default: true) — Enables streaming mode when True.
- `chunk_size` (integer, optional, default: 200) — The number of tokens in each processing chunk. This is the size of the token block on which output rails are applied.
- `context_size` (integer, optional, default: 50) — The number of tokens carried over from the previous chunk to provide context for continuity in processing.
- `stream_first` (boolean, optional, default: true) — If True, token chunks are streamed immediately before output rails are applied.

### SingleCallConfig

Configuration for the single LLM call option for topical rails.

- `enabled` (boolean, optional, default: false)
- `fallback_to_multiple_calls` (boolean, optional, default: true) — Whether to fall back to multiple calls if a single call is not possible.

### UserMessagesConfig

Configuration for how the user messages are interpreted.

- `embeddings_only` (boolean, optional, default: false) — Whether to use only embeddings for computing the user canonical form messages.
- `embeddings_only_similarity_threshold` (double, optional) — The similarity threshold to use when using only embeddings for computing the user canonical form messages.
- `embeddings_only_fallback_intent` (string, optional) — Defines the fallback intent when the similarity is below the threshold. If set to None, the user intent is computed normally using the LLM. If set to a string value, that string is used as the intent.

### AutoAlignOptions

List of guardrails that are activated

- `guardrails_config` (map from string to any, optional) — The guardrails configuration that is passed to the AutoAlign endpoint

### PatronusEvaluateConfig

Config for the Patronus Evaluate API call

- `evaluate_config` (PatronusEvaluateApiParams, optional) — Configuration passed to the Patronus Evaluate API

### SensitiveDataDetectionOptions

- `entities` (list of string, optional) — The list of entities that should be detected. Check out https://microsoft.github.io/presidio/supported_entities/ forthe list of supported entities.
- `mask_token` (string, optional, default: *) — The token that should be used to mask the sensitive data.
- `score_threshold` (double, optional, default: 0.2) — The score threshold that should be used to detect the sensitive data.

### RegexDetectionOptions

Configuration options for regex pattern detection on a specific source.

- `patterns` (list of string, optional) — List of regex patterns to match against the text.
- `case_insensitive` (boolean, optional, default: false) — Whether to perform case-insensitive matching.

### PrivateAIDetectionOptions

Configuration options for Private AI.

- `entities` (list of string, optional) — The list of entities that should be detected.

### GLiNERDetectionOptions

Configuration options for GLiNER.

- `entities` (list of string, optional) — The list of entity labels to detect (e.g., 'email', 'phone_number', 'ssn').

### PolygrafDetectionOptions

Configuration options for Polygraf.

- `entities` (list of string, optional) — The list of entities that should be detected.

### ClavataRailOptions

Configuration data for the Clavata API

- `policy` (string, required) — The policy alias to use when evaluating inputs or outputs.
- `labels` (list of string, optional) — A list of labels to match against the policy. If no labels are provided, the overall policy result will be returned. If labels are provided, only hits on the provided labels will be considered a hit.

### PangeaRailOptions

Configuration data for the Pangea AI Guard API

- `recipe` (string, required) — Recipe key of a configuration of data types and settings defined in the Pangea User Console. It specifies the rules that are to be applied to the text, such as defang malicious URLs.

### GuardrailsAIValidatorConfig

Configuration for a single Guardrails AI validator.

- `name` (string, required) — Unique identifier or import path for the Guardrails AI validator (e.g., 'toxic_language', 'pii', 'regex_match', or 'guardrails/competitor_check').
- `parameters` (map from string to any, optional) — Parameters to pass to the validator during initialization (e.g., threshold, regex pattern).
- `metadata` (map from string to any, optional) — Metadata to pass to the validator during validation (e.g., valid_topics, context).

### MultilingualConfig

Configuration for multilingual refusal messages.

- `enabled` (boolean, optional, default: false) — If True, detect the language of user input and return refusal messages in the same language. Supported languages: en (English), es (Spanish), zh (Chinese), de (German), fr (French), hi (Hindi), ja (Japanese), ar (Arabic), th (Thai).
- `refusal_messages` (map from string to string, optional) — Custom refusal messages per language code. If not specified, built-in defaults are used. Example: \{'en': 'Sorry, I cannot help.', 'es': 'Lo siento, no puedo ayudar.'}

### ReasoningConfig

Configuration for reasoning mode in content safety models.

- `enabled` (boolean, optional, default: false) — If True, enable reasoning mode (with \<think> traces) for content safety models. If False, use low-latency mode without reasoning traces.

### PatronusEvaluateApiParams

Config to parameterize the Patronus Evaluate API call

- `success_strategy` (enum, optional, default: all_pass) — Strategy to determine whether the Patronus Evaluate API Guardrail passes or not.
  - Allowed values: `all_pass`, `any_pass`
- `params` (map from string to any, optional) — Parameters to the Patronus Evaluate API

## Examples

**Request**

```json
{
  "model": "string",
  "messages": [
    {
      "content": "string",
      "role": "string"
    }
  ]
}
```

**Response**

```json
{
  "status": "blocked",
  "rails_status": {},
  "guardrails_data": {
    "llm_output": {},
    "config_ids": [
      "string"
    ],
    "output_data": {},
    "log": {
      "activated_rails": [
        {
          "type": "string",
          "name": "string",
          "decisions": [
            "string"
          ],
          "executed_actions": [
            {
              "action_name": "string",
              "action_params": {},
              "return_value": null,
              "llm_calls": [
                {
                  "task": "string",
                  "duration": 1.1,
                  "total_tokens": 1,
                  "prompt_tokens": 1,
                  "completion_tokens": 1,
                  "started_at": 0,
                  "finished_at": 0,
                  "id": "string",
                  "prompt": "string",
                  "completion": "string",
                  "raw_response": {},
                  "llm_model_name": "unknown"
                }
              ],
              "started_at": 1.1,
              "finished_at": 1.1,
              "duration": 1.1
            }
          ],
          "stop": false,
          "additional_info": {},
          "started_at": 1.1,
          "finished_at": 1.1,
          "duration": 1.1
        }
      ],
      "stats": {
        "input_rails_duration": 1.1,
        "dialog_rails_duration": 1.1,
        "generation_rails_duration": 1.1,
        "output_rails_duration": 1.1,
        "total_duration": 1.1,
        "llm_calls_duration": 0,
        "llm_calls_count": 0,
        "llm_calls_total_prompt_tokens": 0,
        "llm_calls_total_completion_tokens": 0,
        "llm_calls_total_tokens": 0
      },
      "llm_calls": [
        {
          "task": "string",
          "duration": 1.1,
          "total_tokens": 1,
          "prompt_tokens": 1,
          "completion_tokens": 1,
          "started_at": 0,
          "finished_at": 0,
          "id": "string",
          "prompt": "string",
          "completion": "string",
          "raw_response": {},
          "llm_model_name": "unknown"
        }
      ],
      "internal_events": [
        {}
      ],
      "colang_history": "string"
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/apis/guardrails/v2/workspaces/workspace/checks"

payload = {
    "model": "string",
    "messages": [
        {
            "content": "string",
            "role": "string"
        }
    ]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.example.com/apis/guardrails/v2/workspaces/workspace/checks';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"model":"string","messages":[{"content":"string","role":"string"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/apis/guardrails/v2/workspaces/workspace/checks"

	payload := strings.NewReader("{\n  \"model\": \"string\",\n  \"messages\": [\n    {\n      \"content\": \"string\",\n      \"role\": \"string\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.example.com/apis/guardrails/v2/workspaces/workspace/checks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"model\": \"string\",\n  \"messages\": [\n    {\n      \"content\": \"string\",\n      \"role\": \"string\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.example.com/apis/guardrails/v2/workspaces/workspace/checks")
  .header("Content-Type", "application/json")
  .body("{\n  \"model\": \"string\",\n  \"messages\": [\n    {\n      \"content\": \"string\",\n      \"role\": \"string\"\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.example.com/apis/guardrails/v2/workspaces/workspace/checks', [
  'body' => '{
  "model": "string",
  "messages": [
    {
      "content": "string",
      "role": "string"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/apis/guardrails/v2/workspaces/workspace/checks");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"model\": \"string\",\n  \"messages\": [\n    {\n      \"content\": \"string\",\n      \"role\": \"string\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "model": "string",
  "messages": [
    [
      "content": "string",
      "role": "string"
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/apis/guardrails/v2/workspaces/workspace/checks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```