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

# Evaluate Request

POST https://api.hiddenlayer.ai/detection/v2/request-evaluations
Content-Type: application/json

[BETA] This endpoint is not GA or Production ready and is subject to changes at any time. Breaking changes may occur.

Analyzes an LLM request payload for security threats before it is sent to the model.

Accepts any valid provider request payload and returns:
- If detect or redact action: the request payload (potentially modified) in the provider's request format
- If block action: a canned block message in the provider's response format

Use this endpoint inline in your LLM pipeline to evaluate prompts before they reach the model.

Supported provider formats:
- [OpenAI Chat Completions](https://platform.openai.com/docs/api-reference/chat)
- [OpenAI Responses](https://platform.openai.com/docs/api-reference/responses)
- [Anthropic Messages](https://docs.anthropic.com/en/api/messages)


Reference: https://hiddenlayer.ferndocs.com/api-reference/llm-proxy-api/runtime/evaluate-request

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.hiddenlayer.ai` (ProdUs, default)
- `https://api.eu.hiddenlayer.ai` (ProdEu)

## Request

### Headers

- `HL-Project-Id` (string, optional) — The ID or alias for the Project to govern the request processing.
- `HL-Runtime-Session-Id` (string, optional) — An externally-defined session identifier to group interactions in separate requests into a single session. The identifier should be unique across the all sessions.

### Body (application/json)

This endpoint expects a map from string to any.

- `map from string to any`

## Response

### 200

Successful evaluation. Returns the (potentially modified) provider request payload, or if a block action was taken, a provider response payload.

- `map from string to any`

## Examples

### OpenAI Chat Completion Request

**Request**

```json
{
  "model": "gpt-4",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant."
    },
    {
      "role": "user",
      "content": "What is the capital of France?"
    }
  ],
  "max_tokens": 1000,
  "temperature": 0.7
}
```

**Response**

```json
{
  "model": "gpt-4",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant."
    },
    {
      "role": "user",
      "content": "What is the capital of France?"
    }
  ],
  "max_tokens": 1000,
  "temperature": 0.7
}
```

**SDK Code**

```python OpenAI Chat Completion Request
import requests

url = "https://api.hiddenlayer.ai/detection/v2/request-evaluations"

payload = {
    "model": "gpt-4",
    "messages": [
        {
            "role": "system",
            "content": "You are a helpful assistant."
        },
        {
            "role": "user",
            "content": "What is the capital of France?"
        }
    ],
    "max_tokens": 1000,
    "temperature": 0.7
}
headers = {
    "HL-Project-Id": "internal-search-chatbot",
    "HL-Runtime-Session-Id": "sess_4b8cde94604f4c389406a0b2f806069a",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript OpenAI Chat Completion Request
const url = 'https://api.hiddenlayer.ai/detection/v2/request-evaluations';
const options = {
  method: 'POST',
  headers: {
    'HL-Project-Id': 'internal-search-chatbot',
    'HL-Runtime-Session-Id': 'sess_4b8cde94604f4c389406a0b2f806069a',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"model":"gpt-4","messages":[{"role":"system","content":"You are a helpful assistant."},{"role":"user","content":"What is the capital of France?"}],"max_tokens":1000,"temperature":0.7}'
};

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

```go OpenAI Chat Completion Request
package main

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

func main() {

	url := "https://api.hiddenlayer.ai/detection/v2/request-evaluations"

	payload := strings.NewReader("{\n  \"model\": \"gpt-4\",\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"You are a helpful assistant.\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"What is the capital of France?\"\n    }\n  ],\n  \"max_tokens\": 1000,\n  \"temperature\": 0.7\n}")

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

	req.Header.Add("HL-Project-Id", "internal-search-chatbot")
	req.Header.Add("HL-Runtime-Session-Id", "sess_4b8cde94604f4c389406a0b2f806069a")
	req.Header.Add("Authorization", "Bearer <token>")
	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 OpenAI Chat Completion Request
require 'uri'
require 'net/http'

url = URI("https://api.hiddenlayer.ai/detection/v2/request-evaluations")

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

request = Net::HTTP::Post.new(url)
request["HL-Project-Id"] = 'internal-search-chatbot'
request["HL-Runtime-Session-Id"] = 'sess_4b8cde94604f4c389406a0b2f806069a'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"model\": \"gpt-4\",\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"You are a helpful assistant.\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"What is the capital of France?\"\n    }\n  ],\n  \"max_tokens\": 1000,\n  \"temperature\": 0.7\n}"

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

```java OpenAI Chat Completion Request
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.hiddenlayer.ai/detection/v2/request-evaluations")
  .header("HL-Project-Id", "internal-search-chatbot")
  .header("HL-Runtime-Session-Id", "sess_4b8cde94604f4c389406a0b2f806069a")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"model\": \"gpt-4\",\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"You are a helpful assistant.\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"What is the capital of France?\"\n    }\n  ],\n  \"max_tokens\": 1000,\n  \"temperature\": 0.7\n}")
  .asString();
```

```php OpenAI Chat Completion Request
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.hiddenlayer.ai/detection/v2/request-evaluations', [
  'body' => '{
  "model": "gpt-4",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant."
    },
    {
      "role": "user",
      "content": "What is the capital of France?"
    }
  ],
  "max_tokens": 1000,
  "temperature": 0.7
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'HL-Project-Id' => 'internal-search-chatbot',
    'HL-Runtime-Session-Id' => 'sess_4b8cde94604f4c389406a0b2f806069a',
  ],
]);

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

```csharp OpenAI Chat Completion Request
using RestSharp;

var client = new RestClient("https://api.hiddenlayer.ai/detection/v2/request-evaluations");
var request = new RestRequest(Method.POST);
request.AddHeader("HL-Project-Id", "internal-search-chatbot");
request.AddHeader("HL-Runtime-Session-Id", "sess_4b8cde94604f4c389406a0b2f806069a");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"model\": \"gpt-4\",\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"You are a helpful assistant.\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"What is the capital of France?\"\n    }\n  ],\n  \"max_tokens\": 1000,\n  \"temperature\": 0.7\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift OpenAI Chat Completion Request
import Foundation

let headers = [
  "HL-Project-Id": "internal-search-chatbot",
  "HL-Runtime-Session-Id": "sess_4b8cde94604f4c389406a0b2f806069a",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "model": "gpt-4",
  "messages": [
    [
      "role": "system",
      "content": "You are a helpful assistant."
    ],
    [
      "role": "user",
      "content": "What is the capital of France?"
    ]
  ],
  "max_tokens": 1000,
  "temperature": 0.7
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.hiddenlayer.ai/detection/v2/request-evaluations")! 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()
```

### OpenAI Responses API Request

**Request**

```json
{
  "model": "gpt-4o",
  "input": [
    {
      "type": "message",
      "role": "user",
      "content": "What is the capital of France?"
    }
  ],
  "instructions": "You are a helpful assistant.",
  "max_output_tokens": 1000,
  "temperature": 0.7
}
```

**Response**

```json
{
  "model": "gpt-4o",
  "input": [
    {
      "type": "message",
      "role": "user",
      "content": "What is the capital of France?"
    }
  ],
  "instructions": "You are a helpful assistant.",
  "max_output_tokens": 1000,
  "temperature": 0.7
}
```

**SDK Code**

```python OpenAI Responses API Request
import requests

url = "https://api.hiddenlayer.ai/detection/v2/request-evaluations"

payload = {
    "model": "gpt-4o",
    "input": [
        {
            "type": "message",
            "role": "user",
            "content": "What is the capital of France?"
        }
    ],
    "instructions": "You are a helpful assistant.",
    "max_output_tokens": 1000,
    "temperature": 0.7
}
headers = {
    "HL-Project-Id": "internal-search-chatbot",
    "HL-Runtime-Session-Id": "sess_4b8cde94604f4c389406a0b2f806069a",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript OpenAI Responses API Request
const url = 'https://api.hiddenlayer.ai/detection/v2/request-evaluations';
const options = {
  method: 'POST',
  headers: {
    'HL-Project-Id': 'internal-search-chatbot',
    'HL-Runtime-Session-Id': 'sess_4b8cde94604f4c389406a0b2f806069a',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"model":"gpt-4o","input":[{"type":"message","role":"user","content":"What is the capital of France?"}],"instructions":"You are a helpful assistant.","max_output_tokens":1000,"temperature":0.7}'
};

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

```go OpenAI Responses API Request
package main

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

func main() {

	url := "https://api.hiddenlayer.ai/detection/v2/request-evaluations"

	payload := strings.NewReader("{\n  \"model\": \"gpt-4o\",\n  \"input\": [\n    {\n      \"type\": \"message\",\n      \"role\": \"user\",\n      \"content\": \"What is the capital of France?\"\n    }\n  ],\n  \"instructions\": \"You are a helpful assistant.\",\n  \"max_output_tokens\": 1000,\n  \"temperature\": 0.7\n}")

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

	req.Header.Add("HL-Project-Id", "internal-search-chatbot")
	req.Header.Add("HL-Runtime-Session-Id", "sess_4b8cde94604f4c389406a0b2f806069a")
	req.Header.Add("Authorization", "Bearer <token>")
	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 OpenAI Responses API Request
require 'uri'
require 'net/http'

url = URI("https://api.hiddenlayer.ai/detection/v2/request-evaluations")

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

request = Net::HTTP::Post.new(url)
request["HL-Project-Id"] = 'internal-search-chatbot'
request["HL-Runtime-Session-Id"] = 'sess_4b8cde94604f4c389406a0b2f806069a'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"model\": \"gpt-4o\",\n  \"input\": [\n    {\n      \"type\": \"message\",\n      \"role\": \"user\",\n      \"content\": \"What is the capital of France?\"\n    }\n  ],\n  \"instructions\": \"You are a helpful assistant.\",\n  \"max_output_tokens\": 1000,\n  \"temperature\": 0.7\n}"

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

```java OpenAI Responses API Request
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.hiddenlayer.ai/detection/v2/request-evaluations")
  .header("HL-Project-Id", "internal-search-chatbot")
  .header("HL-Runtime-Session-Id", "sess_4b8cde94604f4c389406a0b2f806069a")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"model\": \"gpt-4o\",\n  \"input\": [\n    {\n      \"type\": \"message\",\n      \"role\": \"user\",\n      \"content\": \"What is the capital of France?\"\n    }\n  ],\n  \"instructions\": \"You are a helpful assistant.\",\n  \"max_output_tokens\": 1000,\n  \"temperature\": 0.7\n}")
  .asString();
```

```php OpenAI Responses API Request
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.hiddenlayer.ai/detection/v2/request-evaluations', [
  'body' => '{
  "model": "gpt-4o",
  "input": [
    {
      "type": "message",
      "role": "user",
      "content": "What is the capital of France?"
    }
  ],
  "instructions": "You are a helpful assistant.",
  "max_output_tokens": 1000,
  "temperature": 0.7
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'HL-Project-Id' => 'internal-search-chatbot',
    'HL-Runtime-Session-Id' => 'sess_4b8cde94604f4c389406a0b2f806069a',
  ],
]);

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

```csharp OpenAI Responses API Request
using RestSharp;

var client = new RestClient("https://api.hiddenlayer.ai/detection/v2/request-evaluations");
var request = new RestRequest(Method.POST);
request.AddHeader("HL-Project-Id", "internal-search-chatbot");
request.AddHeader("HL-Runtime-Session-Id", "sess_4b8cde94604f4c389406a0b2f806069a");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"model\": \"gpt-4o\",\n  \"input\": [\n    {\n      \"type\": \"message\",\n      \"role\": \"user\",\n      \"content\": \"What is the capital of France?\"\n    }\n  ],\n  \"instructions\": \"You are a helpful assistant.\",\n  \"max_output_tokens\": 1000,\n  \"temperature\": 0.7\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift OpenAI Responses API Request
import Foundation

let headers = [
  "HL-Project-Id": "internal-search-chatbot",
  "HL-Runtime-Session-Id": "sess_4b8cde94604f4c389406a0b2f806069a",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "model": "gpt-4o",
  "input": [
    [
      "type": "message",
      "role": "user",
      "content": "What is the capital of France?"
    ]
  ],
  "instructions": "You are a helpful assistant.",
  "max_output_tokens": 1000,
  "temperature": 0.7
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.hiddenlayer.ai/detection/v2/request-evaluations")! 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()
```

### Anthropic Messages Request

**Request**

```json
{
  "model": "claude-3-sonnet-20240229",
  "max_tokens": 1024,
  "system": "You are a helpful assistant.",
  "messages": [
    {
      "role": "user",
      "content": "What is the capital of France?"
    }
  ]
}
```

**Response**

```json
{
  "model": "claude-3-sonnet-20240229",
  "max_tokens": 1024,
  "system": "You are a helpful assistant.",
  "messages": [
    {
      "role": "user",
      "content": "What is the capital of France?"
    }
  ]
}
```

**SDK Code**

```python Anthropic Messages Request
import requests

url = "https://api.hiddenlayer.ai/detection/v2/request-evaluations"

payload = {
    "model": "claude-3-sonnet-20240229",
    "max_tokens": 1024,
    "system": "You are a helpful assistant.",
    "messages": [
        {
            "role": "user",
            "content": "What is the capital of France?"
        }
    ]
}
headers = {
    "HL-Project-Id": "internal-search-chatbot",
    "HL-Runtime-Session-Id": "sess_4b8cde94604f4c389406a0b2f806069a",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Anthropic Messages Request
const url = 'https://api.hiddenlayer.ai/detection/v2/request-evaluations';
const options = {
  method: 'POST',
  headers: {
    'HL-Project-Id': 'internal-search-chatbot',
    'HL-Runtime-Session-Id': 'sess_4b8cde94604f4c389406a0b2f806069a',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"model":"claude-3-sonnet-20240229","max_tokens":1024,"system":"You are a helpful assistant.","messages":[{"role":"user","content":"What is the capital of France?"}]}'
};

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

```go Anthropic Messages Request
package main

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

func main() {

	url := "https://api.hiddenlayer.ai/detection/v2/request-evaluations"

	payload := strings.NewReader("{\n  \"model\": \"claude-3-sonnet-20240229\",\n  \"max_tokens\": 1024,\n  \"system\": \"You are a helpful assistant.\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"What is the capital of France?\"\n    }\n  ]\n}")

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

	req.Header.Add("HL-Project-Id", "internal-search-chatbot")
	req.Header.Add("HL-Runtime-Session-Id", "sess_4b8cde94604f4c389406a0b2f806069a")
	req.Header.Add("Authorization", "Bearer <token>")
	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 Anthropic Messages Request
require 'uri'
require 'net/http'

url = URI("https://api.hiddenlayer.ai/detection/v2/request-evaluations")

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

request = Net::HTTP::Post.new(url)
request["HL-Project-Id"] = 'internal-search-chatbot'
request["HL-Runtime-Session-Id"] = 'sess_4b8cde94604f4c389406a0b2f806069a'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"model\": \"claude-3-sonnet-20240229\",\n  \"max_tokens\": 1024,\n  \"system\": \"You are a helpful assistant.\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"What is the capital of France?\"\n    }\n  ]\n}"

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

```java Anthropic Messages Request
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.hiddenlayer.ai/detection/v2/request-evaluations")
  .header("HL-Project-Id", "internal-search-chatbot")
  .header("HL-Runtime-Session-Id", "sess_4b8cde94604f4c389406a0b2f806069a")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"model\": \"claude-3-sonnet-20240229\",\n  \"max_tokens\": 1024,\n  \"system\": \"You are a helpful assistant.\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"What is the capital of France?\"\n    }\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.hiddenlayer.ai/detection/v2/request-evaluations', [
  'body' => '{
  "model": "claude-3-sonnet-20240229",
  "max_tokens": 1024,
  "system": "You are a helpful assistant.",
  "messages": [
    {
      "role": "user",
      "content": "What is the capital of France?"
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'HL-Project-Id' => 'internal-search-chatbot',
    'HL-Runtime-Session-Id' => 'sess_4b8cde94604f4c389406a0b2f806069a',
  ],
]);

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

```csharp Anthropic Messages Request
using RestSharp;

var client = new RestClient("https://api.hiddenlayer.ai/detection/v2/request-evaluations");
var request = new RestRequest(Method.POST);
request.AddHeader("HL-Project-Id", "internal-search-chatbot");
request.AddHeader("HL-Runtime-Session-Id", "sess_4b8cde94604f4c389406a0b2f806069a");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"model\": \"claude-3-sonnet-20240229\",\n  \"max_tokens\": 1024,\n  \"system\": \"You are a helpful assistant.\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"What is the capital of France?\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Anthropic Messages Request
import Foundation

let headers = [
  "HL-Project-Id": "internal-search-chatbot",
  "HL-Runtime-Session-Id": "sess_4b8cde94604f4c389406a0b2f806069a",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "model": "claude-3-sonnet-20240229",
  "max_tokens": 1024,
  "system": "You are a helpful assistant.",
  "messages": [
    [
      "role": "user",
      "content": "What is the capital of France?"
    ]
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.hiddenlayer.ai/detection/v2/request-evaluations")! 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()
```