import decimalai
decimalai.init(api_key="dai_sk_...")
decimalai.submit_replay_result(
task_id="rt_001",
replayed_trace_id="trc_new_001",
status="completed",
)decimalai replay run rb_abc123 --agent-fn my_app.agent:runconst options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({replayed_trace_id: '<string>', eval_score: 0.5, status: 'completed'})
};
fetch('https://api.decimal.ai/api/v1/replay/tasks/{task_id}/submit', 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/replay/tasks/{task_id}/submit",
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([
'replayed_trace_id' => '<string>',
'eval_score' => 0.5,
'status' => 'completed'
]),
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/replay/tasks/{task_id}/submit"
payload := strings.NewReader("{\n \"replayed_trace_id\": \"<string>\",\n \"eval_score\": 0.5,\n \"status\": \"completed\"\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/replay/tasks/{task_id}/submit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"replayed_trace_id\": \"<string>\",\n \"eval_score\": 0.5,\n \"status\": \"completed\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decimal.ai/api/v1/replay/tasks/{task_id}/submit")
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 \"replayed_trace_id\": \"<string>\",\n \"eval_score\": 0.5,\n \"status\": \"completed\"\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"task_id": "rt_001",
"eval_score": 0.94,
"eval_verdict": "pass"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Submit a replay task result
Submit the result of a replay task.
import decimalai
decimalai.init(api_key="dai_sk_...")
decimalai.submit_replay_result(
task_id="rt_001",
replayed_trace_id="trc_new_001",
status="completed",
)decimalai replay run rb_abc123 --agent-fn my_app.agent:runconst options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({replayed_trace_id: '<string>', eval_score: 0.5, status: 'completed'})
};
fetch('https://api.decimal.ai/api/v1/replay/tasks/{task_id}/submit', 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/replay/tasks/{task_id}/submit",
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([
'replayed_trace_id' => '<string>',
'eval_score' => 0.5,
'status' => 'completed'
]),
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/replay/tasks/{task_id}/submit"
payload := strings.NewReader("{\n \"replayed_trace_id\": \"<string>\",\n \"eval_score\": 0.5,\n \"status\": \"completed\"\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/replay/tasks/{task_id}/submit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"replayed_trace_id\": \"<string>\",\n \"eval_score\": 0.5,\n \"status\": \"completed\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decimal.ai/api/v1/replay/tasks/{task_id}/submit")
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 \"replayed_trace_id\": \"<string>\",\n \"eval_score\": 0.5,\n \"status\": \"completed\"\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"task_id": "rt_001",
"eval_score": 0.94,
"eval_verdict": "pass"
}{
"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
Typed body for POST /replay/tasks/{id}/submit.
Every field is validated here rather than at the database, so a bad value comes back as a 422 naming the field instead of a 500 from the column type.
The bounds are not cosmetic. eval_score must be 0.0–1.0 because the
preference-pair export downstream splits pairs on a score threshold: a
score outside that range would put every pair on the same side of the
split and silently skew the exported training data. eval_verdict is
pass/fail/review — the same vocabulary score_replay_result emits and
the batch passed/failed counters count — and status is the replay-task
lifecycle set. extra="forbid" matches the decision payload: a mistyped
field name should 422 rather than quietly mean "no value supplied".
ID of the trace produced by re-running the prompt.
Quality score for the replayed trace (0.0–1.0).
0 <= x <= 1Verdict for the replayed trace.
pass, fail, review Lifecycle state to record on the task.
pending, running, completed, failed, skipped Response
Successful Response