Python SDK
import httpx
# Score every trace from a manifest in one call.
resp = httpx.post(
"https://api.decimal.ai/api/v1/traces/batch-decision",
headers={"Authorization": "Bearer dai_sk_..."},
json={"manifest_id": "mfst_abc123"},
)
resp.raise_for_status()
print(resp.json()["verdict_counts"])curl --request POST \
--url https://api.decimal.ai/api/v1/traces/batch-decision \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"trace_ids": [
"<string>"
],
"manifest_id": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({trace_ids: ['<string>'], manifest_id: '<string>'})
};
fetch('https://api.decimal.ai/api/v1/traces/batch-decision', 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.decimal.ai/api/v1/traces/batch-decision",
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([
'trace_ids' => [
'<string>'
],
'manifest_id' => '<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://api.decimal.ai/api/v1/traces/batch-decision"
payload := strings.NewReader("{\n \"trace_ids\": [\n \"<string>\"\n ],\n \"manifest_id\": \"<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://api.decimal.ai/api/v1/traces/batch-decision")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"trace_ids\": [\n \"<string>\"\n ],\n \"manifest_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decimal.ai/api/v1/traces/batch-decision")
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 \"trace_ids\": [\n \"<string>\"\n ],\n \"manifest_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"decisions": [
{
"trace_id": "trc_001",
"verdict": "keep",
"quality_avg": 0.92,
"compat_avg": 0.95,
"quality_scores": [],
"compat_scores": [],
"reasons": []
}
],
"total": 1,
"verdict_counts": {
"keep": 1,
"repair": 0,
"replay": 0,
"drop": 0
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}eval-scores
Batch compute unified verdicts
Batch compute unified verdicts for multiple traces.
Provide either trace_ids or manifest_id (to score all traces from that manifest).
POST
/
api
/
v1
/
traces
/
batch-decision
Python SDK
import httpx
# Score every trace from a manifest in one call.
resp = httpx.post(
"https://api.decimal.ai/api/v1/traces/batch-decision",
headers={"Authorization": "Bearer dai_sk_..."},
json={"manifest_id": "mfst_abc123"},
)
resp.raise_for_status()
print(resp.json()["verdict_counts"])curl --request POST \
--url https://api.decimal.ai/api/v1/traces/batch-decision \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"trace_ids": [
"<string>"
],
"manifest_id": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({trace_ids: ['<string>'], manifest_id: '<string>'})
};
fetch('https://api.decimal.ai/api/v1/traces/batch-decision', 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.decimal.ai/api/v1/traces/batch-decision",
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([
'trace_ids' => [
'<string>'
],
'manifest_id' => '<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://api.decimal.ai/api/v1/traces/batch-decision"
payload := strings.NewReader("{\n \"trace_ids\": [\n \"<string>\"\n ],\n \"manifest_id\": \"<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://api.decimal.ai/api/v1/traces/batch-decision")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"trace_ids\": [\n \"<string>\"\n ],\n \"manifest_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decimal.ai/api/v1/traces/batch-decision")
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 \"trace_ids\": [\n \"<string>\"\n ],\n \"manifest_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"decisions": [
{
"trace_id": "trc_001",
"verdict": "keep",
"quality_avg": 0.92,
"compat_avg": 0.95,
"quality_scores": [],
"compat_scores": [],
"reasons": []
}
],
"total": 1,
"verdict_counts": {
"keep": 1,
"repair": 0,
"replay": 0,
"drop": 0
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Enter your API key (e.g. dai_sk_test_key_001)
Headers
Cookies
Body
application/json
⌘I