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>",
"imageDetailLevel": "IMAGE_DETAIL_LEVEL_UNSPECIFIED"
},
"globalContext": "<string>",
"abstain": true
}
'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>",
"imageDetailLevel": "IMAGE_DETAIL_LEVEL_UNSPECIFIED"
},
"globalContext": "<string>",
"abstain": True
}
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>',
imageDetailLevel: 'IMAGE_DETAIL_LEVEL_UNSPECIFIED'
},
globalContext: '<string>',
abstain: true
})
};
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>',
'imageDetailLevel' => 'IMAGE_DETAIL_LEVEL_UNSPECIFIED'
],
'globalContext' => '<string>',
'abstain' => true
]),
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 \"imageDetailLevel\": \"IMAGE_DETAIL_LEVEL_UNSPECIFIED\"\n },\n \"globalContext\": \"<string>\",\n \"abstain\": true\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 \"imageDetailLevel\": \"IMAGE_DETAIL_LEVEL_UNSPECIFIED\"\n },\n \"globalContext\": \"<string>\",\n \"abstain\": true\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 \"imageDetailLevel\": \"IMAGE_DETAIL_LEVEL_UNSPECIFIED\"\n },\n \"globalContext\": \"<string>\",\n \"abstain\": true\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>"
}
],
"choice": {
"abstained": true,
"labelId": "<string>",
"labelVersionId": "<string>",
"index": 123,
"confidence": 123,
"probabilities": {}
},
"ordinal": {
"abstained": true,
"labelId": "<string>",
"labelVersionId": "<string>",
"index": 123,
"confidence": 123,
"probabilities": {},
"score": 123
},
"priority": {
"matched": true,
"labelId": "<string>",
"labelVersionId": "<string>",
"index": 123,
"score": 123,
"threshold": 123
},
"aggregateError": {
"code": "<string>",
"message": "<string>",
"labelVersionId": "<string>"
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Evaluate labels
Evaluate content against published label versions. Returns one result per version in request order. Optional response_kind adds choice, ordinal, or priority aggregation; score is the default. Requires a label-first account; other accounts receive FAILED_PRECONDITION.
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>",
"imageDetailLevel": "IMAGE_DETAIL_LEVEL_UNSPECIFIED"
},
"globalContext": "<string>",
"abstain": true
}
'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>",
"imageDetailLevel": "IMAGE_DETAIL_LEVEL_UNSPECIFIED"
},
"globalContext": "<string>",
"abstain": True
}
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>',
imageDetailLevel: 'IMAGE_DETAIL_LEVEL_UNSPECIFIED'
},
globalContext: '<string>',
abstain: true
})
};
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>',
'imageDetailLevel' => 'IMAGE_DETAIL_LEVEL_UNSPECIFIED'
],
'globalContext' => '<string>',
'abstain' => true
]),
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 \"imageDetailLevel\": \"IMAGE_DETAIL_LEVEL_UNSPECIFIED\"\n },\n \"globalContext\": \"<string>\",\n \"abstain\": true\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 \"imageDetailLevel\": \"IMAGE_DETAIL_LEVEL_UNSPECIFIED\"\n },\n \"globalContext\": \"<string>\",\n \"abstain\": true\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 \"imageDetailLevel\": \"IMAGE_DETAIL_LEVEL_UNSPECIFIED\"\n },\n \"globalContext\": \"<string>\",\n \"abstain\": true\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>"
}
],
"choice": {
"abstained": true,
"labelId": "<string>",
"labelVersionId": "<string>",
"index": 123,
"confidence": 123,
"probabilities": {}
},
"ordinal": {
"abstained": true,
"labelId": "<string>",
"labelVersionId": "<string>",
"index": 123,
"confidence": 123,
"probabilities": {},
"score": 123
},
"priority": {
"matched": true,
"labelId": "<string>",
"labelVersionId": "<string>",
"index": 123,
"score": 123,
"threshold": 123
},
"aggregateError": {
"code": "<string>",
"message": "<string>",
"labelVersionId": "<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 25 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.
Aggregation over the evaluated label versions. Omit for independent scores.
score, choice, ordinal, priority Whether choice and ordinal abstain when no label evaluation has outcome TRUE. Defaults to true; set false to force selection.
Response
A successful response.
The hash of the content that was evaluated.
Ordered results, one per requested label_version_ids entry.
These retain the independent evaluations for every response kind.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?