curl --request POST \
--url https://api.enkryptai.com/guardrails/detect-image \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"text_input": "<string>",
"image_data": "<string>",
"detectors": {
"toxicity": {
"enabled": true
},
"nsfw": {
"enabled": true
},
"injection_attack": {
"enabled": true
},
"pii": {
"enabled": true,
"entities": [
"person",
"phone",
"email"
]
},
"policy_violation": {
"enabled": true,
"policy_text": "No violent or illegal content allowed.",
"need_explanation": true
}
},
"user_metadata": {
"request_id": "abc-123",
"source": "mobile-app"
}
}
'import requests
url = "https://api.enkryptai.com/guardrails/detect-image"
payload = {
"text_input": "<string>",
"image_data": "<string>",
"detectors": {
"toxicity": { "enabled": True },
"nsfw": { "enabled": True },
"injection_attack": { "enabled": True },
"pii": {
"enabled": True,
"entities": ["person", "phone", "email"]
},
"policy_violation": {
"enabled": True,
"policy_text": "No violent or illegal content allowed.",
"need_explanation": True
}
},
"user_metadata": {
"request_id": "abc-123",
"source": "mobile-app"
}
}
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({
text_input: '<string>',
image_data: '<string>',
detectors: {
toxicity: {enabled: true},
nsfw: {enabled: true},
injection_attack: {enabled: true},
pii: {enabled: true, entities: ['person', 'phone', 'email']},
policy_violation: {
enabled: true,
policy_text: 'No violent or illegal content allowed.',
need_explanation: true
}
},
user_metadata: {request_id: 'abc-123', source: 'mobile-app'}
})
};
fetch('https://api.enkryptai.com/guardrails/detect-image', 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/detect-image",
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([
'text_input' => '<string>',
'image_data' => '<string>',
'detectors' => [
'toxicity' => [
'enabled' => true
],
'nsfw' => [
'enabled' => true
],
'injection_attack' => [
'enabled' => true
],
'pii' => [
'enabled' => true,
'entities' => [
'person',
'phone',
'email'
]
],
'policy_violation' => [
'enabled' => true,
'policy_text' => 'No violent or illegal content allowed.',
'need_explanation' => true
]
],
'user_metadata' => [
'request_id' => 'abc-123',
'source' => 'mobile-app'
]
]),
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/detect-image"
payload := strings.NewReader("{\n \"text_input\": \"<string>\",\n \"image_data\": \"<string>\",\n \"detectors\": {\n \"toxicity\": {\n \"enabled\": true\n },\n \"nsfw\": {\n \"enabled\": true\n },\n \"injection_attack\": {\n \"enabled\": true\n },\n \"pii\": {\n \"enabled\": true,\n \"entities\": [\n \"person\",\n \"phone\",\n \"email\"\n ]\n },\n \"policy_violation\": {\n \"enabled\": true,\n \"policy_text\": \"No violent or illegal content allowed.\",\n \"need_explanation\": true\n }\n },\n \"user_metadata\": {\n \"request_id\": \"abc-123\",\n \"source\": \"mobile-app\"\n }\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/detect-image")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text_input\": \"<string>\",\n \"image_data\": \"<string>\",\n \"detectors\": {\n \"toxicity\": {\n \"enabled\": true\n },\n \"nsfw\": {\n \"enabled\": true\n },\n \"injection_attack\": {\n \"enabled\": true\n },\n \"pii\": {\n \"enabled\": true,\n \"entities\": [\n \"person\",\n \"phone\",\n \"email\"\n ]\n },\n \"policy_violation\": {\n \"enabled\": true,\n \"policy_text\": \"No violent or illegal content allowed.\",\n \"need_explanation\": true\n }\n },\n \"user_metadata\": {\n \"request_id\": \"abc-123\",\n \"source\": \"mobile-app\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enkryptai.com/guardrails/detect-image")
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 \"text_input\": \"<string>\",\n \"image_data\": \"<string>\",\n \"detectors\": {\n \"toxicity\": {\n \"enabled\": true\n },\n \"nsfw\": {\n \"enabled\": true\n },\n \"injection_attack\": {\n \"enabled\": true\n },\n \"pii\": {\n \"enabled\": true,\n \"entities\": [\n \"person\",\n \"phone\",\n \"email\"\n ]\n },\n \"policy_violation\": {\n \"enabled\": true,\n \"policy_text\": \"No violent or illegal content allowed.\",\n \"need_explanation\": true\n }\n },\n \"user_metadata\": {\n \"request_id\": \"abc-123\",\n \"source\": \"mobile-app\"\n }\n}"
response = http.request(request)
puts response.read_bodyDetect Image
Analyze an image with text using individual multimodal guardrails detectors
curl --request POST \
--url https://api.enkryptai.com/guardrails/detect-image \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"text_input": "<string>",
"image_data": "<string>",
"detectors": {
"toxicity": {
"enabled": true
},
"nsfw": {
"enabled": true
},
"injection_attack": {
"enabled": true
},
"pii": {
"enabled": true,
"entities": [
"person",
"phone",
"email"
]
},
"policy_violation": {
"enabled": true,
"policy_text": "No violent or illegal content allowed.",
"need_explanation": true
}
},
"user_metadata": {
"request_id": "abc-123",
"source": "mobile-app"
}
}
'import requests
url = "https://api.enkryptai.com/guardrails/detect-image"
payload = {
"text_input": "<string>",
"image_data": "<string>",
"detectors": {
"toxicity": { "enabled": True },
"nsfw": { "enabled": True },
"injection_attack": { "enabled": True },
"pii": {
"enabled": True,
"entities": ["person", "phone", "email"]
},
"policy_violation": {
"enabled": True,
"policy_text": "No violent or illegal content allowed.",
"need_explanation": True
}
},
"user_metadata": {
"request_id": "abc-123",
"source": "mobile-app"
}
}
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({
text_input: '<string>',
image_data: '<string>',
detectors: {
toxicity: {enabled: true},
nsfw: {enabled: true},
injection_attack: {enabled: true},
pii: {enabled: true, entities: ['person', 'phone', 'email']},
policy_violation: {
enabled: true,
policy_text: 'No violent or illegal content allowed.',
need_explanation: true
}
},
user_metadata: {request_id: 'abc-123', source: 'mobile-app'}
})
};
fetch('https://api.enkryptai.com/guardrails/detect-image', 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/detect-image",
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([
'text_input' => '<string>',
'image_data' => '<string>',
'detectors' => [
'toxicity' => [
'enabled' => true
],
'nsfw' => [
'enabled' => true
],
'injection_attack' => [
'enabled' => true
],
'pii' => [
'enabled' => true,
'entities' => [
'person',
'phone',
'email'
]
],
'policy_violation' => [
'enabled' => true,
'policy_text' => 'No violent or illegal content allowed.',
'need_explanation' => true
]
],
'user_metadata' => [
'request_id' => 'abc-123',
'source' => 'mobile-app'
]
]),
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/detect-image"
payload := strings.NewReader("{\n \"text_input\": \"<string>\",\n \"image_data\": \"<string>\",\n \"detectors\": {\n \"toxicity\": {\n \"enabled\": true\n },\n \"nsfw\": {\n \"enabled\": true\n },\n \"injection_attack\": {\n \"enabled\": true\n },\n \"pii\": {\n \"enabled\": true,\n \"entities\": [\n \"person\",\n \"phone\",\n \"email\"\n ]\n },\n \"policy_violation\": {\n \"enabled\": true,\n \"policy_text\": \"No violent or illegal content allowed.\",\n \"need_explanation\": true\n }\n },\n \"user_metadata\": {\n \"request_id\": \"abc-123\",\n \"source\": \"mobile-app\"\n }\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/detect-image")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text_input\": \"<string>\",\n \"image_data\": \"<string>\",\n \"detectors\": {\n \"toxicity\": {\n \"enabled\": true\n },\n \"nsfw\": {\n \"enabled\": true\n },\n \"injection_attack\": {\n \"enabled\": true\n },\n \"pii\": {\n \"enabled\": true,\n \"entities\": [\n \"person\",\n \"phone\",\n \"email\"\n ]\n },\n \"policy_violation\": {\n \"enabled\": true,\n \"policy_text\": \"No violent or illegal content allowed.\",\n \"need_explanation\": true\n }\n },\n \"user_metadata\": {\n \"request_id\": \"abc-123\",\n \"source\": \"mobile-app\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enkryptai.com/guardrails/detect-image")
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 \"text_input\": \"<string>\",\n \"image_data\": \"<string>\",\n \"detectors\": {\n \"toxicity\": {\n \"enabled\": true\n },\n \"nsfw\": {\n \"enabled\": true\n },\n \"injection_attack\": {\n \"enabled\": true\n },\n \"pii\": {\n \"enabled\": true,\n \"entities\": [\n \"person\",\n \"phone\",\n \"email\"\n ]\n },\n \"policy_violation\": {\n \"enabled\": true,\n \"policy_text\": \"No violent or illegal content allowed.\",\n \"need_explanation\": true\n }\n },\n \"user_metadata\": {\n \"request_id\": \"abc-123\",\n \"source\": \"mobile-app\"\n }\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Body
The text prompt to accompany the image for analysis.
Base64-encoded image file content.
Configuration for multimodal detectors. Each key is a detector name with an object specifying its settings. Supported detectors: toxicity, nsfw, injection_attack, pii, policy_violation.
Show child attributes
Show child attributes
{ "toxicity": { "enabled": true }, "nsfw": { "enabled": true }, "injection_attack": { "enabled": true }, "pii": { "enabled": true, "entities": ["person", "phone", "email"] }, "policy_violation": { "enabled": true, "policy_text": "No violent or illegal content allowed.", "need_explanation": true } }
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
Multimodal image detection results.
Per-detector integer flags (1 = detected, 0 = not detected).
Show child attributes
Show child attributes
{ "toxicity": 0, "nsfw": 0, "pii": 1, "injection_attack": 0, "policy_violation": 0 }
Per-detector detail objects containing human-readable results and any extra fields (e.g. entities for PII, explanation for policy_violation).
Show child attributes
Show child attributes
{ "toxicity": { "toxicity": "Toxicity Not Detected" }, "nsfw": { "nsfw": "NSFW Not Detected" }, "pii": { "entities": { "person": { "John Doe": "<person_0>" } } }, "injection_attack": { "injection_attack": "Injection Attack Not Detected" }, "policy_violation": { "policy_violation": "Policy Violation Not Detected" } }
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" }

