> This page is for version v0.25.0.
> For other versions, use one of these documentation indexes:
> - Latest (default): https://docs.nvidia.com/nemo/guardrails/latest/llms.txt
> - v0.25.0: https://docs.nvidia.com/nemo/guardrails/v0.25.0/llms.txt
> - v0.24.1: https://docs.nvidia.com/nemo/guardrails/v0.24.1/llms.txt
> - v0.24.0: https://docs.nvidia.com/nemo/guardrails/v0.24.0/llms.txt
> - v0.23.0: https://docs.nvidia.com/nemo/guardrails/v0.23.0/llms.txt
> - v0.22.0: https://docs.nvidia.com/nemo/guardrails/v0.22.0/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/guardrails/llms.txt.

# Check Content

POST http://localhost:8000/v1/checks
Content-Type: application/json

Guardrail check request.

Returns 422 when ``rail_types`` includes a type with no configured flows, when
the serving engine cannot run a tool check it was asked for: a tool rail type, or
``tools``, on a config the IORails engine does not serve, or when ``tools`` holds an
entry that isn't a function tool.

Reference: https://docs.nvidia.com/nemo/guardrails/reference/guardrails-api-server/checks/check-content

## Request

### Body (application/json)

This endpoint expects a GuardrailCheckRequest.

- `model` (string, required) — The LLM model to use for chat completion (e.g., 'gpt-4o', 'llama-3.1-8b').
- `frequency_penalty` (double, optional, nullable) — Frequency penalty parameter.
- `guardrails` (GuardrailCheckDataInput, optional) — Guardrails specific options for the request.
- `logit_bias` (map from string to any, optional, nullable) — Logit bias parameter.
- `logprobs` (boolean, optional, nullable) — Log probabilities parameter.
- `max_completion_tokens` (integer, optional, nullable) — The maximum number of completion tokens to generate, including reasoning tokens.
- `max_tokens` (integer, optional, nullable) — The maximum number of tokens to generate.
- `messages` (list of GuardrailCheckRequestMessagesItems, optional, nullable) — The list of messages in the current conversation.
- `parallel_tool_calls` (boolean, optional, nullable) — Whether to allow parallel tool calls during tool use.
- `presence_penalty` (double, optional, nullable) — Presence penalty parameter.
- `stop` (GuardrailCheckRequestStop, optional, nullable) — Stop sequences.
- `stream` (boolean, optional, nullable, default: false) — If set, partial message deltas will be sent as server-sent events.
- `temperature` (double, optional, nullable) — Sampling temperature to use.
- `tool_choice` (GuardrailCheckRequestToolChoice, optional, nullable) — Tool choice parameter.
- `tools` (list of map from string to any, optional, nullable) — Tools that `tool_call` rails validate calls against: the allowlist and each tool's argument schema. Each entry is a Chat Completions function tool, with a `function` object and a non-empty `name`; any other entry returns 422. Only the IORails engine runs tool checks; on LLMRails a request with `tools` returns 422.
- `top_p` (double, optional, nullable) — Top-p sampling parameter.

## Response

### 200

Successful Response

- `content` (string, required) — Content after rails processing.
- `status` (string, required) — Overall check result: passed, modified, or blocked.
- `rail` (string, optional, nullable) — Name of the blocking rail, if any.
- `reason` (string, optional, nullable) — Why the rail blocked the content, if the engine reports it.
- `tool_violations` (list of ToolViolation, optional, nullable) — The tool calls or tool results a tool rail blocked, each with a `violation_type` to switch on. Present only when a tool rail blocked (IORails).

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `error` (ErrorResponseError, required)

## Types

### GuardrailCheckDataInput

Guardrails input options specific to the /v1/checks endpoint.

- `config_id` (string, optional, nullable) — The guardrails configuration ID to use.
- `config_ids` (list of string, optional, nullable) — List of configuration IDs to combine.
- `context` (map from string to any, optional, nullable) — Additional context data for the conversation.
- `options` (GenerationOptions, optional) — Additional generation options.
- `rail_types` (list of enum, optional, nullable) — Rail types to run. When omitted, input and output rails are auto-detected from message roles. `tool_call` and `tool_result` run only when named, and only on the IORails engine.
  - Allowed values: `input`, `output`, `tool_call`, `tool_result`
- `thread_id` (string, optional, nullable) — The ID of an existing thread to continue.

### GuardrailCheckRequestMessagesItems

- _OpenAIDeveloperMessageSchema: _OpenAIDeveloperMessageSchema
- _OpenAISystemMessageSchema: _OpenAISystemMessageSchema
- _OpenAIUserMessageSchema: _OpenAIUserMessageSchema
- _OpenAIAssistantMessageSchema: _OpenAIAssistantMessageSchema
- _OpenAIToolMessageSchema: _OpenAIToolMessageSchema
- _OpenAIFunctionMessageSchema: _OpenAIFunctionMessageSchema
- _GuardrailsContextMessageSchema: _GuardrailsContextMessageSchema

### GuardrailCheckRequestStop

Stop sequences.

- string
- list of string

### GuardrailCheckRequestToolChoice

Tool choice parameter.

- string
- map from string to any

### ToolViolation

One tool call or tool result a tool rail blocked, identified so a caller can act on it.

- `kind` (enum, required) — Whether a tool call or a tool result was blocked.
  - Allowed values: `tool_call`, `tool_result`
- `reason` (string, required) — Why it was blocked. Never contains argument values or tool-result content.
- `violation_type` (enum, required) — What the call or result violated. Switch on this, never on `reason`.
  - Allowed values: `tool_not_allowed`, `arguments_invalid`, `unexpected_arguments`, `invalid_tool_schema`, `malformed_arguments`, `malformed_tool_call`, `legacy_function_call`, `invalid_toolset`, `missing_call_id`, `unknown_call_id`, `duplicate_result`, `duplicate_prior_call_id`, `name_mismatch`, `malformed_content`, `unlinkable_result`, `extraction_failed`, `rail_failed`, `per_tool_rail`
- `argument_path` (string, optional, nullable) — JSON Pointer to the failing argument (`arguments_invalid` only).
- `index` (integer, optional, nullable) — For a call, its position in the last assistant message's `tool_calls`. For a result, its message's position in `messages`.
- `rail` (string, optional, nullable) — The rail that blocked or failed (`per_tool_rail` and `rail_failed` only).
- `schema_keyword` (string, optional, nullable) — The JSON Schema keyword that failed (`arguments_invalid` only).
- `tool_call_id` (string, optional, nullable) — The call's id, or the id the result links to.
- `tool_name` (string, optional, nullable) — The tool called. For a result, taken from the call it links to.

### ErrorResponseError

- `message` (string, required) — Human-readable error message, with secrets and upstream URLs redacted.
- `type` (string, required) — OpenAI error category, derived from the HTTP status (for example `invalid_request_error`, `authentication_error`, `permission_error`, `not_found_error`, `rate_limit_error`, `server_error`).
- `param` (string, required, nullable) — The request field the error relates to, when known.
- `code` (ErrorResponseErrorCode, required, nullable) — Provider-supplied error code when available. Streaming error events use an integer downstream HTTP status or a string generation error code.

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

- `llm_output` (boolean, optional, default: false) — Whether the response should also include any custom LLM output.
- `llm_params` (map from string to any, optional, nullable) — Additional parameters that should be used for the LLM call
- `log` (GenerationLogOptions, optional) — Options about what to include in the log. By default, nothing is included.
- `output_vars` (GenerationOptionsOutputVars, optional, nullable) — 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.
- `rails` (GenerationRailsOptions, optional) — Options for which rails should be applied for the generation. By default, all rails are enabled.

### _OpenAIDeveloperMessageSchema

- `content` (OpenAiDeveloperMessageSchemaContent, required)
- `role` ("developer", required)
- `name` (string, optional, nullable)

### _OpenAISystemMessageSchema

- `content` (OpenAiSystemMessageSchemaContent, required)
- `role` ("system", required)
- `name` (string, optional, nullable)

### _OpenAIUserMessageSchema

- `content` (OpenAiUserMessageSchemaContent, required)
- `role` ("user", required)
- `name` (string, optional, nullable)

### _OpenAIAssistantMessageSchema

- `role` ("assistant", required)
- `content` (OpenAiAssistantMessageSchemaContent, optional, nullable)
- `function_call` (_OpenAIFunctionCallSchema, optional, nullable)
- `name` (string, optional, nullable)
- `refusal` (string, optional, nullable)
- `tool_calls` (list of _OpenAIFunctionToolCallSchema, optional, nullable)

### _OpenAIToolMessageSchema

- `content` (OpenAiToolMessageSchemaContent, required)
- `role` ("tool", required)
- `tool_call_id` (string, required)

### _OpenAIFunctionMessageSchema

- `content` (string, required, nullable)
- `name` (string, required)
- `role` ("function", required)

### _GuardrailsContextMessageSchema

- `content` (map from string to any, required)
- `role` ("context", required)

### ErrorResponseErrorCode

Provider-supplied error code when available. Streaming error events use an integer downstream HTTP status or a string generation error code.

- string
- integer

### 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.
- `colang_history` (boolean, optional, default: false) — Include the history of the conversation in Colang format.
- `internal_events` (boolean, optional, default: false) — Include the array of internal generated events.
- `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.

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

- boolean
- list of string

### GenerationRailsOptions

Options for what rails should be used during the generation.

- `dialog` (boolean, optional, default: true) — Whether the dialog rails are enabled or not.
- `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.
- `tool_call` (GenerationRailsOptionsToolCall, optional, default: true) — Whether the tool call rails are enabled or not. If a list of names is specified, then only the specified tool call rails will be applied.
- `tool_result` (GenerationRailsOptionsToolResult, optional, default: true) — Whether the tool result rails are enabled or not. If a list of names is specified, then only the specified tool result rails will be applied.
- `tool_input` (GenerationRailsOptionsToolInput, optional, default: true, deprecated) — DEPRECATED: Use tool_result instead.
- `tool_output` (GenerationRailsOptionsToolOutput, optional, default: true, deprecated) — DEPRECATED: Use tool_call instead.

### OpenAiDeveloperMessageSchemaContent

- string
- list of _OpenAITextContentPartSchema

### OpenAiSystemMessageSchemaContent

- string
- list of _OpenAITextContentPartSchema

### OpenAiUserMessageSchemaContent

- string
- list of OpenAiUserMessageSchemaContentOneOf1Items

### OpenAiAssistantMessageSchemaContent

- string
- list of OpenAiAssistantMessageSchemaContentOneOf1Items

### _OpenAIFunctionCallSchema

- `arguments` (string, required)
- `name` (string, required)

### _OpenAIFunctionToolCallSchema

- `function` (_OpenAIFunctionCallSchema, required)
- `id` (string, required)
- `type` ("function", required)

### OpenAiToolMessageSchemaContent

- string
- list of _OpenAITextContentPartSchema

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

- boolean
- list of string

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

- boolean
- list of string

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

- boolean
- list of string

### GenerationRailsOptionsToolCall

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

- boolean
- list of string

### GenerationRailsOptionsToolResult

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

- boolean
- list of string

### GenerationRailsOptionsToolInput

DEPRECATED: Use tool_result instead.

- boolean
- list of string

### GenerationRailsOptionsToolOutput

DEPRECATED: Use tool_call instead.

- boolean
- list of string

### _OpenAITextContentPartSchema

- `text` (string, required)
- `type` ("text", required)
- `prompt_cache_breakpoint` (_OpenAIPromptCacheBreakpointSchema, optional, nullable)

### OpenAiUserMessageSchemaContentOneOf1Items

- _OpenAITextContentPartSchema: _OpenAITextContentPartSchema
- _OpenAIImageContentPartSchema: _OpenAIImageContentPartSchema
- _OpenAIFileContentPartSchema: _OpenAIFileContentPartSchema

### OpenAiAssistantMessageSchemaContentOneOf1Items

- _OpenAITextContentPartSchema: _OpenAITextContentPartSchema
- _OpenAIRefusalContentPartSchema: _OpenAIRefusalContentPartSchema

### _OpenAIPromptCacheBreakpointSchema

- `mode` ("explicit", required)

### _OpenAIImageContentPartSchema

- `image_url` (_OpenAIImageURLSchema, required)
- `type` ("image_url", required)
- `prompt_cache_breakpoint` (_OpenAIPromptCacheBreakpointSchema, optional, nullable)

### _OpenAIFileContentPartSchema

- `file` (_OpenAIFileSchema, required)
- `type` ("file", required)
- `prompt_cache_breakpoint` (_OpenAIPromptCacheBreakpointSchema, optional, nullable)

### _OpenAIRefusalContentPartSchema

- `refusal` (string, required)
- `type` ("refusal", required)

### _OpenAIImageURLSchema

- `url` (string, required)
- `detail` (enum, optional, nullable)
  - Allowed values: `auto`, `low`, `high`

### _OpenAIFileSchema

- `file_data` (string, optional, nullable)
- `file_id` (string, optional, nullable)
- `filename` (string, optional, nullable)

## Examples

### Check a user message

**Request**

```json
{
  "model": "meta/llama-3.1-8b-instruct",
  "guardrails": {
    "config_id": "content_safety",
    "rail_types": [
      "input"
    ]
  },
  "messages": [
    {
      "content": "What is the capital of France?",
      "role": "user"
    }
  ]
}
```

**Response**

```json
{
  "content": "What is the capital of France?",
  "status": "passed"
}
```

**SDK Code**

```python Check a user message
import requests

url = "http://localhost:8000/v1/checks"

payload = {
    "model": "meta/llama-3.1-8b-instruct",
    "guardrails": {
        "config_id": "content_safety",
        "rail_types": ["input"]
    },
    "messages": [
        {
            "content": "What is the capital of France?",
            "role": "user"
        }
    ]
}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript Check a user message
const url = 'http://localhost:8000/v1/checks';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"model":"meta/llama-3.1-8b-instruct","guardrails":{"config_id":"content_safety","rail_types":["input"]},"messages":[{"content":"What is the capital of France?","role":"user"}]}'
};

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

```go Check a user message
package main

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

func main() {

	url := "http://localhost:8000/v1/checks"

	payload := strings.NewReader("{\n  \"model\": \"meta/llama-3.1-8b-instruct\",\n  \"guardrails\": {\n    \"config_id\": \"content_safety\",\n    \"rail_types\": [\n      \"input\"\n    ]\n  },\n  \"messages\": [\n    {\n      \"content\": \"What is the capital of France?\",\n      \"role\": \"user\"\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 Check a user message
require 'uri'
require 'net/http'

url = URI("http://localhost:8000/v1/checks")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"model\": \"meta/llama-3.1-8b-instruct\",\n  \"guardrails\": {\n    \"config_id\": \"content_safety\",\n    \"rail_types\": [\n      \"input\"\n    ]\n  },\n  \"messages\": [\n    {\n      \"content\": \"What is the capital of France?\",\n      \"role\": \"user\"\n    }\n  ]\n}"

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

```java Check a user message
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("http://localhost:8000/v1/checks")
  .header("Content-Type", "application/json")
  .body("{\n  \"model\": \"meta/llama-3.1-8b-instruct\",\n  \"guardrails\": {\n    \"config_id\": \"content_safety\",\n    \"rail_types\": [\n      \"input\"\n    ]\n  },\n  \"messages\": [\n    {\n      \"content\": \"What is the capital of France?\",\n      \"role\": \"user\"\n    }\n  ]\n}")
  .asString();
```

```php Check a user message
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://localhost:8000/v1/checks', [
  'body' => '{
  "model": "meta/llama-3.1-8b-instruct",
  "guardrails": {
    "config_id": "content_safety",
    "rail_types": [
      "input"
    ]
  },
  "messages": [
    {
      "content": "What is the capital of France?",
      "role": "user"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Check a user message
using RestSharp;

var client = new RestClient("http://localhost:8000/v1/checks");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"model\": \"meta/llama-3.1-8b-instruct\",\n  \"guardrails\": {\n    \"config_id\": \"content_safety\",\n    \"rail_types\": [\n      \"input\"\n    ]\n  },\n  \"messages\": [\n    {\n      \"content\": \"What is the capital of France?\",\n      \"role\": \"user\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Check a user message
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "model": "meta/llama-3.1-8b-instruct",
  "guardrails": [
    "config_id": "content_safety",
    "rail_types": ["input"]
  ],
  "messages": [
    [
      "content": "What is the capital of France?",
      "role": "user"
    ]
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8000/v1/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()
```

### Check a call to an undeclared tool

**Request**

```json
{
  "model": "meta/llama-3.1-8b-instruct",
  "guardrails": {
    "config_id": "tools",
    "rail_types": [
      "tool_call"
    ]
  },
  "messages": [
    {
      "content": "What's the weather in Paris?",
      "role": "user"
    },
    {
      "content": null,
      "role": "assistant",
      "tool_calls": [
        {
          "function": {
            "arguments": "{}",
            "name": "delete_files"
          },
          "id": "call_1",
          "type": "function"
        }
      ]
    }
  ],
  "tools": [
    {
      "function": {
        "name": "get_weather",
        "parameters": {
          "properties": {
            "city": {
              "type": "string"
            }
          },
          "required": [
            "city"
          ],
          "type": "object"
        }
      },
      "type": "function"
    }
  ]
}
```

**Response**

```json
{
  "content": "I'm sorry, I can't respond to that.",
  "status": "blocked",
  "rail": "tool call validation",
  "reason": "tool call 'delete_files' is not an allowed tool",
  "tool_violations": [
    {
      "kind": "tool_call",
      "reason": "tool call 'delete_files' is not an allowed tool",
      "violation_type": "tool_not_allowed",
      "index": 0,
      "tool_call_id": "call_1",
      "tool_name": "delete_files"
    }
  ]
}
```

**SDK Code**

```python Check a call to an undeclared tool
import requests

url = "http://localhost:8000/v1/checks"

payload = {
    "model": "meta/llama-3.1-8b-instruct",
    "guardrails": {
        "config_id": "tools",
        "rail_types": ["tool_call"]
    },
    "messages": [
        {
            "content": "What's the weather in Paris?",
            "role": "user"
        },
        {
            "content": None,
            "role": "assistant",
            "tool_calls": [
                {
                    "function": {
                        "arguments": "{}",
                        "name": "delete_files"
                    },
                    "id": "call_1",
                    "type": "function"
                }
            ]
        }
    ],
    "tools": [
        {
            "function": {
                "name": "get_weather",
                "parameters": {
                    "properties": { "city": { "type": "string" } },
                    "required": ["city"],
                    "type": "object"
                }
            },
            "type": "function"
        }
    ]
}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript Check a call to an undeclared tool
const url = 'http://localhost:8000/v1/checks';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"model":"meta/llama-3.1-8b-instruct","guardrails":{"config_id":"tools","rail_types":["tool_call"]},"messages":[{"content":"What\'s the weather in Paris?","role":"user"},{"content":null,"role":"assistant","tool_calls":[{"function":{"arguments":"{}","name":"delete_files"},"id":"call_1","type":"function"}]}],"tools":[{"function":{"name":"get_weather","parameters":{"properties":{"city":{"type":"string"}},"required":["city"],"type":"object"}},"type":"function"}]}'
};

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

```go Check a call to an undeclared tool
package main

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

func main() {

	url := "http://localhost:8000/v1/checks"

	payload := strings.NewReader("{\n  \"model\": \"meta/llama-3.1-8b-instruct\",\n  \"guardrails\": {\n    \"config_id\": \"tools\",\n    \"rail_types\": [\n      \"tool_call\"\n    ]\n  },\n  \"messages\": [\n    {\n      \"content\": \"What's the weather in Paris?\",\n      \"role\": \"user\"\n    },\n    {\n      \"content\": null,\n      \"role\": \"assistant\",\n      \"tool_calls\": [\n        {\n          \"function\": {\n            \"arguments\": \"{}\",\n            \"name\": \"delete_files\"\n          },\n          \"id\": \"call_1\",\n          \"type\": \"function\"\n        }\n      ]\n    }\n  ],\n  \"tools\": [\n    {\n      \"function\": {\n        \"name\": \"get_weather\",\n        \"parameters\": {\n          \"properties\": {\n            \"city\": {\n              \"type\": \"string\"\n            }\n          },\n          \"required\": [\n            \"city\"\n          ],\n          \"type\": \"object\"\n        }\n      },\n      \"type\": \"function\"\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 Check a call to an undeclared tool
require 'uri'
require 'net/http'

url = URI("http://localhost:8000/v1/checks")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"model\": \"meta/llama-3.1-8b-instruct\",\n  \"guardrails\": {\n    \"config_id\": \"tools\",\n    \"rail_types\": [\n      \"tool_call\"\n    ]\n  },\n  \"messages\": [\n    {\n      \"content\": \"What's the weather in Paris?\",\n      \"role\": \"user\"\n    },\n    {\n      \"content\": null,\n      \"role\": \"assistant\",\n      \"tool_calls\": [\n        {\n          \"function\": {\n            \"arguments\": \"{}\",\n            \"name\": \"delete_files\"\n          },\n          \"id\": \"call_1\",\n          \"type\": \"function\"\n        }\n      ]\n    }\n  ],\n  \"tools\": [\n    {\n      \"function\": {\n        \"name\": \"get_weather\",\n        \"parameters\": {\n          \"properties\": {\n            \"city\": {\n              \"type\": \"string\"\n            }\n          },\n          \"required\": [\n            \"city\"\n          ],\n          \"type\": \"object\"\n        }\n      },\n      \"type\": \"function\"\n    }\n  ]\n}"

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

```java Check a call to an undeclared tool
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("http://localhost:8000/v1/checks")
  .header("Content-Type", "application/json")
  .body("{\n  \"model\": \"meta/llama-3.1-8b-instruct\",\n  \"guardrails\": {\n    \"config_id\": \"tools\",\n    \"rail_types\": [\n      \"tool_call\"\n    ]\n  },\n  \"messages\": [\n    {\n      \"content\": \"What's the weather in Paris?\",\n      \"role\": \"user\"\n    },\n    {\n      \"content\": null,\n      \"role\": \"assistant\",\n      \"tool_calls\": [\n        {\n          \"function\": {\n            \"arguments\": \"{}\",\n            \"name\": \"delete_files\"\n          },\n          \"id\": \"call_1\",\n          \"type\": \"function\"\n        }\n      ]\n    }\n  ],\n  \"tools\": [\n    {\n      \"function\": {\n        \"name\": \"get_weather\",\n        \"parameters\": {\n          \"properties\": {\n            \"city\": {\n              \"type\": \"string\"\n            }\n          },\n          \"required\": [\n            \"city\"\n          ],\n          \"type\": \"object\"\n        }\n      },\n      \"type\": \"function\"\n    }\n  ]\n}")
  .asString();
```

```php Check a call to an undeclared tool
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://localhost:8000/v1/checks', [
  'body' => '{
  "model": "meta/llama-3.1-8b-instruct",
  "guardrails": {
    "config_id": "tools",
    "rail_types": [
      "tool_call"
    ]
  },
  "messages": [
    {
      "content": "What\'s the weather in Paris?",
      "role": "user"
    },
    {
      "content": null,
      "role": "assistant",
      "tool_calls": [
        {
          "function": {
            "arguments": "{}",
            "name": "delete_files"
          },
          "id": "call_1",
          "type": "function"
        }
      ]
    }
  ],
  "tools": [
    {
      "function": {
        "name": "get_weather",
        "parameters": {
          "properties": {
            "city": {
              "type": "string"
            }
          },
          "required": [
            "city"
          ],
          "type": "object"
        }
      },
      "type": "function"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Check a call to an undeclared tool
using RestSharp;

var client = new RestClient("http://localhost:8000/v1/checks");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"model\": \"meta/llama-3.1-8b-instruct\",\n  \"guardrails\": {\n    \"config_id\": \"tools\",\n    \"rail_types\": [\n      \"tool_call\"\n    ]\n  },\n  \"messages\": [\n    {\n      \"content\": \"What's the weather in Paris?\",\n      \"role\": \"user\"\n    },\n    {\n      \"content\": null,\n      \"role\": \"assistant\",\n      \"tool_calls\": [\n        {\n          \"function\": {\n            \"arguments\": \"{}\",\n            \"name\": \"delete_files\"\n          },\n          \"id\": \"call_1\",\n          \"type\": \"function\"\n        }\n      ]\n    }\n  ],\n  \"tools\": [\n    {\n      \"function\": {\n        \"name\": \"get_weather\",\n        \"parameters\": {\n          \"properties\": {\n            \"city\": {\n              \"type\": \"string\"\n            }\n          },\n          \"required\": [\n            \"city\"\n          ],\n          \"type\": \"object\"\n        }\n      },\n      \"type\": \"function\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Check a call to an undeclared tool
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "model": "meta/llama-3.1-8b-instruct",
  "guardrails": [
    "config_id": "tools",
    "rail_types": ["tool_call"]
  ],
  "messages": [
    [
      "content": "What's the weather in Paris?",
      "role": "user"
    ],
    [
      "content": ,
      "role": "assistant",
      "tool_calls": [
        [
          "function": [
            "arguments": "{}",
            "name": "delete_files"
          ],
          "id": "call_1",
          "type": "function"
        ]
      ]
    ]
  ],
  "tools": [
    [
      "function": [
        "name": "get_weather",
        "parameters": [
          "properties": ["city": ["type": "string"]],
          "required": ["city"],
          "type": "object"
        ]
      ],
      "type": "function"
    ]
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8000/v1/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()
```