curl --request POST \
--url https://api.enkryptai.com/guardrails/adherence \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data @- <<EOF
{
"llm_answer": "C.V. Raman won the Nobel Prize for Physics in 1930 for his work on making some science stuff or cooking stuff",
"context": "Indian scientists have made significant contributions to various scientific fields. C.V. Raman won the Nobel Prize for Physics in 1930 for his work on light scattering. Other notable scientists include Srinivasa Ramanujan, a mathematical genius, and A.P.J. Abdul Kalam, a key figure in India's aerospace and nuclear programs."
}
EOFimport requests
url = "https://api.enkryptai.com/guardrails/adherence"
payload = {
"llm_answer": "C.V. Raman won the Nobel Prize for Physics in 1930 for his work on making some science stuff or cooking stuff",
"context": "Indian scientists have made significant contributions to various scientific fields. C.V. Raman won the Nobel Prize for Physics in 1930 for his work on light scattering. Other notable scientists include Srinivasa Ramanujan, a mathematical genius, and A.P.J. Abdul Kalam, a key figure in India's aerospace and nuclear programs."
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
llm_answer: 'C.V. Raman won the Nobel Prize for Physics in 1930 for his work on making some science stuff or cooking stuff',
context: 'Indian scientists have made significant contributions to various scientific fields. C.V. Raman won the Nobel Prize for Physics in 1930 for his work on light scattering. Other notable scientists include Srinivasa Ramanujan, a mathematical genius, and A.P.J. Abdul Kalam, a key figure in India\'s aerospace and nuclear programs.'
})
};
fetch('https://api.enkryptai.com/guardrails/adherence', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.enkryptai.com/guardrails/adherence",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'llm_answer' => 'C.V. Raman won the Nobel Prize for Physics in 1930 for his work on making some science stuff or cooking stuff',
'context' => 'Indian scientists have made significant contributions to various scientific fields. C.V. Raman won the Nobel Prize for Physics in 1930 for his work on light scattering. Other notable scientists include Srinivasa Ramanujan, a mathematical genius, and A.P.J. Abdul Kalam, a key figure in India\'s aerospace and nuclear programs.'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.enkryptai.com/guardrails/adherence"
payload := strings.NewReader("{\n \"llm_answer\": \"C.V. Raman won the Nobel Prize for Physics in 1930 for his work on making some science stuff or cooking stuff\",\n \"context\": \"Indian scientists have made significant contributions to various scientific fields. C.V. Raman won the Nobel Prize for Physics in 1930 for his work on light scattering. Other notable scientists include Srinivasa Ramanujan, a mathematical genius, and A.P.J. Abdul Kalam, a key figure in India's aerospace and nuclear programs.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.enkryptai.com/guardrails/adherence")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"llm_answer\": \"C.V. Raman won the Nobel Prize for Physics in 1930 for his work on making some science stuff or cooking stuff\",\n \"context\": \"Indian scientists have made significant contributions to various scientific fields. C.V. Raman won the Nobel Prize for Physics in 1930 for his work on light scattering. Other notable scientists include Srinivasa Ramanujan, a mathematical genius, and A.P.J. Abdul Kalam, a key figure in India's aerospace and nuclear programs.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enkryptai.com/guardrails/adherence")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"llm_answer\": \"C.V. Raman won the Nobel Prize for Physics in 1930 for his work on making some science stuff or cooking stuff\",\n \"context\": \"Indian scientists have made significant contributions to various scientific fields. C.V. Raman won the Nobel Prize for Physics in 1930 for his work on light scattering. Other notable scientists include Srinivasa Ramanujan, a mathematical genius, and A.P.J. Abdul Kalam, a key figure in India's aerospace and nuclear programs.\"\n}"
response = http.request(request)
puts response.read_body{
"adherence_score": 0.5
}Guardrails Adherence
curl --request POST \
--url https://api.enkryptai.com/guardrails/adherence \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data @- <<EOF
{
"llm_answer": "C.V. Raman won the Nobel Prize for Physics in 1930 for his work on making some science stuff or cooking stuff",
"context": "Indian scientists have made significant contributions to various scientific fields. C.V. Raman won the Nobel Prize for Physics in 1930 for his work on light scattering. Other notable scientists include Srinivasa Ramanujan, a mathematical genius, and A.P.J. Abdul Kalam, a key figure in India's aerospace and nuclear programs."
}
EOFimport requests
url = "https://api.enkryptai.com/guardrails/adherence"
payload = {
"llm_answer": "C.V. Raman won the Nobel Prize for Physics in 1930 for his work on making some science stuff or cooking stuff",
"context": "Indian scientists have made significant contributions to various scientific fields. C.V. Raman won the Nobel Prize for Physics in 1930 for his work on light scattering. Other notable scientists include Srinivasa Ramanujan, a mathematical genius, and A.P.J. Abdul Kalam, a key figure in India's aerospace and nuclear programs."
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
llm_answer: 'C.V. Raman won the Nobel Prize for Physics in 1930 for his work on making some science stuff or cooking stuff',
context: 'Indian scientists have made significant contributions to various scientific fields. C.V. Raman won the Nobel Prize for Physics in 1930 for his work on light scattering. Other notable scientists include Srinivasa Ramanujan, a mathematical genius, and A.P.J. Abdul Kalam, a key figure in India\'s aerospace and nuclear programs.'
})
};
fetch('https://api.enkryptai.com/guardrails/adherence', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.enkryptai.com/guardrails/adherence",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'llm_answer' => 'C.V. Raman won the Nobel Prize for Physics in 1930 for his work on making some science stuff or cooking stuff',
'context' => 'Indian scientists have made significant contributions to various scientific fields. C.V. Raman won the Nobel Prize for Physics in 1930 for his work on light scattering. Other notable scientists include Srinivasa Ramanujan, a mathematical genius, and A.P.J. Abdul Kalam, a key figure in India\'s aerospace and nuclear programs.'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.enkryptai.com/guardrails/adherence"
payload := strings.NewReader("{\n \"llm_answer\": \"C.V. Raman won the Nobel Prize for Physics in 1930 for his work on making some science stuff or cooking stuff\",\n \"context\": \"Indian scientists have made significant contributions to various scientific fields. C.V. Raman won the Nobel Prize for Physics in 1930 for his work on light scattering. Other notable scientists include Srinivasa Ramanujan, a mathematical genius, and A.P.J. Abdul Kalam, a key figure in India's aerospace and nuclear programs.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.enkryptai.com/guardrails/adherence")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"llm_answer\": \"C.V. Raman won the Nobel Prize for Physics in 1930 for his work on making some science stuff or cooking stuff\",\n \"context\": \"Indian scientists have made significant contributions to various scientific fields. C.V. Raman won the Nobel Prize for Physics in 1930 for his work on light scattering. Other notable scientists include Srinivasa Ramanujan, a mathematical genius, and A.P.J. Abdul Kalam, a key figure in India's aerospace and nuclear programs.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enkryptai.com/guardrails/adherence")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"llm_answer\": \"C.V. Raman won the Nobel Prize for Physics in 1930 for his work on making some science stuff or cooking stuff\",\n \"context\": \"Indian scientists have made significant contributions to various scientific fields. C.V. Raman won the Nobel Prize for Physics in 1930 for his work on light scattering. Other notable scientists include Srinivasa Ramanujan, a mathematical genius, and A.P.J. Abdul Kalam, a key figure in India's aerospace and nuclear programs.\"\n}"
response = http.request(request)
puts response.read_body{
"adherence_score": 0.5
}Authorizations
Body
Optional arbitrary metadata object echoed back in the response. Limits: at most 16 top-level keys, key names up to 64 characters, nesting depth up to 3, total serialized size up to 4 KB. When provided and valid, this object is also echoed as a top-level user_metadata key on error responses (4xx/5xx) of endpoints that accept it; invalid or oversized metadata is never echoed, including on the 422 response it causes.
{
"request_id": "abc-123",
"source": "mobile-app"
}
Response
Successful Response
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Optional arbitrary metadata object echoed back in the response. Limits: at most 16 top-level keys, key names up to 64 characters, nesting depth up to 3, total serialized size up to 4 KB. When provided and valid, this object is also echoed as a top-level user_metadata key on error responses (4xx/5xx) of endpoints that accept it; invalid or oversized metadata is never echoed, including on the 422 response it causes.
{
"request_id": "abc-123",
"source": "mobile-app"
}

