Python SDK
# For DeepEval / LangSmith integrations, prefer the dedicated helpers:
# decimalai.push_deepeval_results(trace_id=..., results=...)
# decimalai.push_langsmith_scores(trace_id=..., feedback=...)
# Generic custom scores:
import decimalai
decimalai.push_custom_scores(
api_key="dai_sk_...",
trace_id="trc_abc123",
source="my-pipeline",
scores=[
{"name": "correctness", "score": 0.9},
{"name": "faithfulness", "score": 0.85},
],
)curl --request POST \
--url https://api.decimal.ai/api/v1/traces/{trace_id}/eval-scores \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source": "<string>",
"scores": [
{
"name": "<string>",
"score": 0.5,
"passed": true,
"reason": "<string>"
}
],
"metadata": {}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source: '<string>',
scores: [{name: '<string>', score: 0.5, passed: true, reason: '<string>'}],
metadata: {}
})
};
fetch('https://api.decimal.ai/api/v1/traces/{trace_id}/eval-scores', 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/{trace_id}/eval-scores",
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([
'source' => '<string>',
'scores' => [
[
'name' => '<string>',
'score' => 0.5,
'passed' => true,
'reason' => '<string>'
]
],
'metadata' => [
]
]),
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/{trace_id}/eval-scores"
payload := strings.NewReader("{\n \"source\": \"<string>\",\n \"scores\": [\n {\n \"name\": \"<string>\",\n \"score\": 0.5,\n \"passed\": true,\n \"reason\": \"<string>\"\n }\n ],\n \"metadata\": {}\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/{trace_id}/eval-scores")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source\": \"<string>\",\n \"scores\": [\n {\n \"name\": \"<string>\",\n \"score\": 0.5,\n \"passed\": true,\n \"reason\": \"<string>\"\n }\n ],\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decimal.ai/api/v1/traces/{trace_id}/eval-scores")
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 \"source\": \"<string>\",\n \"scores\": [\n {\n \"name\": \"<string>\",\n \"score\": 0.5,\n \"passed\": true,\n \"reason\": \"<string>\"\n }\n ],\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"trace_id": "trc_abc123",
"source": "deepeval",
"scores_stored": 2,
"scores": [
{
"id": "es_001",
"name": "correctness",
"score": 0.9,
"passed": true,
"source": "deepeval",
"category": "quality"
},
{
"id": "es_002",
"name": "faithfulness",
"score": 0.85,
"passed": true,
"source": "deepeval",
"category": "quality"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}eval-scores
Push external evaluation scores
Push evaluation scores from an external system (DeepEval, LangSmith, etc.).
Scores are stored as quality scores (category=“quality”) and combined with built-in compatibility scores in the unified decision engine.
If a score with the same (trace_id, name, source) already exists, it is updated (upsert behavior).
POST
/
api
/
v1
/
traces
/
{trace_id}
/
eval-scores
Python SDK
# For DeepEval / LangSmith integrations, prefer the dedicated helpers:
# decimalai.push_deepeval_results(trace_id=..., results=...)
# decimalai.push_langsmith_scores(trace_id=..., feedback=...)
# Generic custom scores:
import decimalai
decimalai.push_custom_scores(
api_key="dai_sk_...",
trace_id="trc_abc123",
source="my-pipeline",
scores=[
{"name": "correctness", "score": 0.9},
{"name": "faithfulness", "score": 0.85},
],
)curl --request POST \
--url https://api.decimal.ai/api/v1/traces/{trace_id}/eval-scores \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source": "<string>",
"scores": [
{
"name": "<string>",
"score": 0.5,
"passed": true,
"reason": "<string>"
}
],
"metadata": {}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source: '<string>',
scores: [{name: '<string>', score: 0.5, passed: true, reason: '<string>'}],
metadata: {}
})
};
fetch('https://api.decimal.ai/api/v1/traces/{trace_id}/eval-scores', 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/{trace_id}/eval-scores",
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([
'source' => '<string>',
'scores' => [
[
'name' => '<string>',
'score' => 0.5,
'passed' => true,
'reason' => '<string>'
]
],
'metadata' => [
]
]),
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/{trace_id}/eval-scores"
payload := strings.NewReader("{\n \"source\": \"<string>\",\n \"scores\": [\n {\n \"name\": \"<string>\",\n \"score\": 0.5,\n \"passed\": true,\n \"reason\": \"<string>\"\n }\n ],\n \"metadata\": {}\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/{trace_id}/eval-scores")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source\": \"<string>\",\n \"scores\": [\n {\n \"name\": \"<string>\",\n \"score\": 0.5,\n \"passed\": true,\n \"reason\": \"<string>\"\n }\n ],\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decimal.ai/api/v1/traces/{trace_id}/eval-scores")
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 \"source\": \"<string>\",\n \"scores\": [\n {\n \"name\": \"<string>\",\n \"score\": 0.5,\n \"passed\": true,\n \"reason\": \"<string>\"\n }\n ],\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"trace_id": "trc_abc123",
"source": "deepeval",
"scores_stored": 2,
"scores": [
{
"id": "es_001",
"name": "correctness",
"score": 0.9,
"passed": true,
"source": "deepeval",
"category": "quality"
},
{
"id": "es_002",
"name": "faithfulness",
"score": 0.85,
"passed": true,
"source": "deepeval",
"category": "quality"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Enter your API key (e.g. dai_sk_test_key_001)
Headers
Path Parameters
Cookies
Body
application/json
Request body for pushing external eval scores.
Source system: 'custom', 'my-pipeline', etc. (reserved external-tool names like 'deepeval' require the webhook path)
List of scores to push
Minimum array length:
1Show child attributes
Show child attributes
Source-specific metadata (run_id, metric version, etc.)
⌘I