curl --request POST \
--url https://gateway.errorbar.ai/v1/labels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"request_id": "<string>",
"critique": "<string>"
}
'import requests
url = "https://gateway.errorbar.ai/v1/labels"
payload = {
"request_id": "<string>",
"critique": "<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({request_id: '<string>', critique: '<string>'})
};
fetch('https://gateway.errorbar.ai/v1/labels', 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://gateway.errorbar.ai/v1/labels",
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([
'request_id' => '<string>',
'critique' => '<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.errorbar.ai/v1/labels"
payload := strings.NewReader("{\n \"request_id\": \"<string>\",\n \"critique\": \"<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.errorbar.ai/v1/labels")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"request_id\": \"<string>\",\n \"critique\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.errorbar.ai/v1/labels")
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 \"request_id\": \"<string>\",\n \"critique\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"request_id": "<string>",
"verdict": "pass",
"critique": "<string>",
"source": "human",
"scope": "request",
"fail_causes": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "Invalid API key",
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}Label a trace
Record a human pass/fail verdict on one logged request (owner/admin key — labels DEFINE quality). Downstream systems that already know an output was good or bad can push verdicts here too: a support tool marking an escalation, a pipeline that caught a wrong extraction.
Labels are the foundation of validated evals: judge alignment (TPR/TNR/κ), corrected pass rates, and the quality-gated canary all hang off them. Aim for ~100; stop when 20 in a row teach you nothing new.
curl --request POST \
--url https://gateway.errorbar.ai/v1/labels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"request_id": "<string>",
"critique": "<string>"
}
'import requests
url = "https://gateway.errorbar.ai/v1/labels"
payload = {
"request_id": "<string>",
"critique": "<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({request_id: '<string>', critique: '<string>'})
};
fetch('https://gateway.errorbar.ai/v1/labels', 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://gateway.errorbar.ai/v1/labels",
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([
'request_id' => '<string>',
'critique' => '<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.errorbar.ai/v1/labels"
payload := strings.NewReader("{\n \"request_id\": \"<string>\",\n \"critique\": \"<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.errorbar.ai/v1/labels")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"request_id\": \"<string>\",\n \"critique\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.errorbar.ai/v1/labels")
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 \"request_id\": \"<string>\",\n \"critique\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"request_id": "<string>",
"verdict": "pass",
"critique": "<string>",
"source": "human",
"scope": "request",
"fail_causes": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "Invalid API key",
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}Authorizations
Your workspace API key, e.g. sk_sovereign_..., sent as Authorization: Bearer <key>.
Body
Labels created over the API are request-scoped (one exchange). Whole-run (trace) grading is done in the dashboard's review queue.
Binary, always. Upsert by request_id: re-labeling replaces the verdict — the newest judgment is the truth.
pass, fail WHY, in your words (max 2000 chars). Strongly encouraged on fails: critiques become judge few-shot material, feed suggested judges, and make disagreement review meaningful.
2000Response
The stored label.
The gateway request this verdict is about.
pass, fail WHY it failed — becomes judge few-shot material and the raw text 'Suggest criteria' clusters into your failure taxonomy.
human, assist_accepted request grades one exchange; trace grades a whole agent run (the label rides the run's final step). Labels created over this API are request-scoped.
request, trace Cause attribution: criterion ids this failure indicts. Managed from the dashboard's review queue; empty on unattributed fails.