curl --request POST \
--url https://gateway.app.clavata.ai:8443/v1/labels/evaluate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contentData": {
"text": "<string>",
"image": "aSDinaTvuI8gbWludGxpZnk=",
"imageUrl": "<string>",
"metadata": {}
},
"threshold": 123,
"labelVersionIds": [
"<string>"
],
"labelEvalOptions": {
"bypassCache": true,
"expedited": true,
"bundleSize": 123,
"threshold": 123,
"stack": "<string>"
},
"globalContext": "<string>"
}
'import requests
url = "https://gateway.app.clavata.ai:8443/v1/labels/evaluate"
payload = {
"contentData": {
"text": "<string>",
"image": "aSDinaTvuI8gbWludGxpZnk=",
"imageUrl": "<string>",
"metadata": {}
},
"threshold": 123,
"labelVersionIds": ["<string>"],
"labelEvalOptions": {
"bypassCache": True,
"expedited": True,
"bundleSize": 123,
"threshold": 123,
"stack": "<string>"
},
"globalContext": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contentData: {
text: '<string>',
image: 'aSDinaTvuI8gbWludGxpZnk=',
imageUrl: '<string>',
metadata: {}
},
threshold: 123,
labelVersionIds: ['<string>'],
labelEvalOptions: {
bypassCache: true,
expedited: true,
bundleSize: 123,
threshold: 123,
stack: '<string>'
},
globalContext: '<string>'
})
};
fetch('https://gateway.app.clavata.ai:8443/v1/labels/evaluate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8443",
CURLOPT_URL => "https://gateway.app.clavata.ai:8443/v1/labels/evaluate",
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([
'contentData' => [
'text' => '<string>',
'image' => 'aSDinaTvuI8gbWludGxpZnk=',
'imageUrl' => '<string>',
'metadata' => [
]
],
'threshold' => 123,
'labelVersionIds' => [
'<string>'
],
'labelEvalOptions' => [
'bypassCache' => true,
'expedited' => true,
'bundleSize' => 123,
'threshold' => 123,
'stack' => '<string>'
],
'globalContext' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://gateway.app.clavata.ai:8443/v1/labels/evaluate"
payload := strings.NewReader("{\n \"contentData\": {\n \"text\": \"<string>\",\n \"image\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"imageUrl\": \"<string>\",\n \"metadata\": {}\n },\n \"threshold\": 123,\n \"labelVersionIds\": [\n \"<string>\"\n ],\n \"labelEvalOptions\": {\n \"bypassCache\": true,\n \"expedited\": true,\n \"bundleSize\": 123,\n \"threshold\": 123,\n \"stack\": \"<string>\"\n },\n \"globalContext\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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(string(body))
}HttpResponse<String> response = Unirest.post("https://gateway.app.clavata.ai:8443/v1/labels/evaluate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contentData\": {\n \"text\": \"<string>\",\n \"image\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"imageUrl\": \"<string>\",\n \"metadata\": {}\n },\n \"threshold\": 123,\n \"labelVersionIds\": [\n \"<string>\"\n ],\n \"labelEvalOptions\": {\n \"bypassCache\": true,\n \"expedited\": true,\n \"bundleSize\": 123,\n \"threshold\": 123,\n \"stack\": \"<string>\"\n },\n \"globalContext\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.app.clavata.ai:8443/v1/labels/evaluate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contentData\": {\n \"text\": \"<string>\",\n \"image\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"imageUrl\": \"<string>\",\n \"metadata\": {}\n },\n \"threshold\": 123,\n \"labelVersionIds\": [\n \"<string>\"\n ],\n \"labelEvalOptions\": {\n \"bypassCache\": true,\n \"expedited\": true,\n \"bundleSize\": 123,\n \"threshold\": 123,\n \"stack\": \"<string>\"\n },\n \"globalContext\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"contentHash": "<string>",
"results": [
{
"labelId": "<string>",
"labelVersionId": "<string>",
"jobUuid": "<string>",
"evaluation": {
"score": 123,
"outcome": "OUTCOME_UNSPECIFIED",
"threshold": 123,
"report": {
"policyId": "<string>",
"policyKey": "<string>",
"policyVersionId": "<string>",
"result": "OUTCOME_UNSPECIFIED",
"sectionEvaluationReports": [
{
"name": "<string>",
"result": "OUTCOME_UNSPECIFIED",
"message": "<string>",
"assertionEvaluationReports": [
{
"result": "OUTCOME_UNSPECIFIED",
"message": "<string>",
"score": 123
}
],
"exceptionEvaluationReport": {
"result": "OUTCOME_UNSPECIFIED",
"assertionEvaluationReports": [
{
"result": "OUTCOME_UNSPECIFIED",
"message": "<string>",
"score": 123
}
],
"reviewResult": {
"outcome": "OUTCOME_UNSPECIFIED",
"score": 123
}
},
"reviewResult": {
"outcome": "OUTCOME_UNSPECIFIED",
"score": 123
}
}
],
"exceptionEvaluationReport": {
"result": "OUTCOME_UNSPECIFIED",
"assertionEvaluationReports": [
{
"result": "OUTCOME_UNSPECIFIED",
"message": "<string>",
"score": 123
}
],
"reviewResult": {
"outcome": "OUTCOME_UNSPECIFIED",
"score": 123
}
},
"contentHash": "<string>",
"contentMetadata": {},
"reviewResult": {
"outcome": "OUTCOME_UNSPECIFIED",
"score": 123
},
"threshold": 123,
"labelMatches": {},
"tokenUsage": {
"inputTokens": 123,
"billedTokens": 123,
"multiplier": 123
},
"labelId": "<string>",
"labelVersionId": "<string>"
}
},
"error": "<string>"
}
]
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Evaluate labels
Evaluate content against one or more published label versions. Returns one result per version, in request order. A label-first account is required to use this endpoint.
curl --request POST \
--url https://gateway.app.clavata.ai:8443/v1/labels/evaluate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contentData": {
"text": "<string>",
"image": "aSDinaTvuI8gbWludGxpZnk=",
"imageUrl": "<string>",
"metadata": {}
},
"threshold": 123,
"labelVersionIds": [
"<string>"
],
"labelEvalOptions": {
"bypassCache": true,
"expedited": true,
"bundleSize": 123,
"threshold": 123,
"stack": "<string>"
},
"globalContext": "<string>"
}
'import requests
url = "https://gateway.app.clavata.ai:8443/v1/labels/evaluate"
payload = {
"contentData": {
"text": "<string>",
"image": "aSDinaTvuI8gbWludGxpZnk=",
"imageUrl": "<string>",
"metadata": {}
},
"threshold": 123,
"labelVersionIds": ["<string>"],
"labelEvalOptions": {
"bypassCache": True,
"expedited": True,
"bundleSize": 123,
"threshold": 123,
"stack": "<string>"
},
"globalContext": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contentData: {
text: '<string>',
image: 'aSDinaTvuI8gbWludGxpZnk=',
imageUrl: '<string>',
metadata: {}
},
threshold: 123,
labelVersionIds: ['<string>'],
labelEvalOptions: {
bypassCache: true,
expedited: true,
bundleSize: 123,
threshold: 123,
stack: '<string>'
},
globalContext: '<string>'
})
};
fetch('https://gateway.app.clavata.ai:8443/v1/labels/evaluate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8443",
CURLOPT_URL => "https://gateway.app.clavata.ai:8443/v1/labels/evaluate",
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([
'contentData' => [
'text' => '<string>',
'image' => 'aSDinaTvuI8gbWludGxpZnk=',
'imageUrl' => '<string>',
'metadata' => [
]
],
'threshold' => 123,
'labelVersionIds' => [
'<string>'
],
'labelEvalOptions' => [
'bypassCache' => true,
'expedited' => true,
'bundleSize' => 123,
'threshold' => 123,
'stack' => '<string>'
],
'globalContext' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://gateway.app.clavata.ai:8443/v1/labels/evaluate"
payload := strings.NewReader("{\n \"contentData\": {\n \"text\": \"<string>\",\n \"image\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"imageUrl\": \"<string>\",\n \"metadata\": {}\n },\n \"threshold\": 123,\n \"labelVersionIds\": [\n \"<string>\"\n ],\n \"labelEvalOptions\": {\n \"bypassCache\": true,\n \"expedited\": true,\n \"bundleSize\": 123,\n \"threshold\": 123,\n \"stack\": \"<string>\"\n },\n \"globalContext\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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(string(body))
}HttpResponse<String> response = Unirest.post("https://gateway.app.clavata.ai:8443/v1/labels/evaluate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contentData\": {\n \"text\": \"<string>\",\n \"image\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"imageUrl\": \"<string>\",\n \"metadata\": {}\n },\n \"threshold\": 123,\n \"labelVersionIds\": [\n \"<string>\"\n ],\n \"labelEvalOptions\": {\n \"bypassCache\": true,\n \"expedited\": true,\n \"bundleSize\": 123,\n \"threshold\": 123,\n \"stack\": \"<string>\"\n },\n \"globalContext\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.app.clavata.ai:8443/v1/labels/evaluate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contentData\": {\n \"text\": \"<string>\",\n \"image\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"imageUrl\": \"<string>\",\n \"metadata\": {}\n },\n \"threshold\": 123,\n \"labelVersionIds\": [\n \"<string>\"\n ],\n \"labelEvalOptions\": {\n \"bypassCache\": true,\n \"expedited\": true,\n \"bundleSize\": 123,\n \"threshold\": 123,\n \"stack\": \"<string>\"\n },\n \"globalContext\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"contentHash": "<string>",
"results": [
{
"labelId": "<string>",
"labelVersionId": "<string>",
"jobUuid": "<string>",
"evaluation": {
"score": 123,
"outcome": "OUTCOME_UNSPECIFIED",
"threshold": 123,
"report": {
"policyId": "<string>",
"policyKey": "<string>",
"policyVersionId": "<string>",
"result": "OUTCOME_UNSPECIFIED",
"sectionEvaluationReports": [
{
"name": "<string>",
"result": "OUTCOME_UNSPECIFIED",
"message": "<string>",
"assertionEvaluationReports": [
{
"result": "OUTCOME_UNSPECIFIED",
"message": "<string>",
"score": 123
}
],
"exceptionEvaluationReport": {
"result": "OUTCOME_UNSPECIFIED",
"assertionEvaluationReports": [
{
"result": "OUTCOME_UNSPECIFIED",
"message": "<string>",
"score": 123
}
],
"reviewResult": {
"outcome": "OUTCOME_UNSPECIFIED",
"score": 123
}
},
"reviewResult": {
"outcome": "OUTCOME_UNSPECIFIED",
"score": 123
}
}
],
"exceptionEvaluationReport": {
"result": "OUTCOME_UNSPECIFIED",
"assertionEvaluationReports": [
{
"result": "OUTCOME_UNSPECIFIED",
"message": "<string>",
"score": 123
}
],
"reviewResult": {
"outcome": "OUTCOME_UNSPECIFIED",
"score": 123
}
},
"contentHash": "<string>",
"contentMetadata": {},
"reviewResult": {
"outcome": "OUTCOME_UNSPECIFIED",
"score": 123
},
"threshold": 123,
"labelMatches": {},
"tokenUsage": {
"inputTokens": 123,
"billedTokens": 123,
"multiplier": 123
},
"labelId": "<string>",
"labelVersionId": "<string>"
}
},
"error": "<string>"
}
]
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
A single piece of content to be processed by the Clavata.ai API.
Show child attributes
Show child attributes
The threshold to use for truthiness. If not set a default value will be used.
IDs of the published label versions to evaluate against. Maximum 10 per request.
LabelEvalOptions are options that can be set per-label to control evaluation behavior. Field numbers/types intentionally mirror PolicyEvalOptions for parity.
Show child attributes
Show child attributes
Optional global context override for this evaluation call.
Was this page helpful?