Import graded traffic
curl --request POST \
--url https://gateway.errorbar.ai/v1/logs/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rows": [
{
"messages": [
{
"role": "<string>",
"content": "<unknown>"
}
],
"response": "<string>",
"request_id": "<string>",
"model": "<string>",
"tag": "<string>",
"tools": [
{}
],
"prompt_tokens": 123,
"completion_tokens": 123,
"finish_reason": "<string>",
"critique": "<string>"
}
],
"tag": "<string>"
}
'import requests
url = "https://gateway.errorbar.ai/v1/logs/import"
payload = {
"rows": [
{
"messages": [
{
"role": "<string>",
"content": "<unknown>"
}
],
"response": "<string>",
"request_id": "<string>",
"model": "<string>",
"tag": "<string>",
"tools": [{}],
"prompt_tokens": 123,
"completion_tokens": 123,
"finish_reason": "<string>",
"critique": "<string>"
}
],
"tag": "<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({
rows: [
{
messages: [{role: '<string>', content: '<unknown>'}],
response: '<string>',
request_id: '<string>',
model: '<string>',
tag: '<string>',
tools: [{}],
prompt_tokens: 123,
completion_tokens: 123,
finish_reason: '<string>',
critique: '<string>'
}
],
tag: '<string>'
})
};
fetch('https://gateway.errorbar.ai/v1/logs/import', 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/logs/import",
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([
'rows' => [
[
'messages' => [
[
'role' => '<string>',
'content' => '<unknown>'
]
],
'response' => '<string>',
'request_id' => '<string>',
'model' => '<string>',
'tag' => '<string>',
'tools' => [
[
]
],
'prompt_tokens' => 123,
'completion_tokens' => 123,
'finish_reason' => '<string>',
'critique' => '<string>'
]
],
'tag' => '<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/logs/import"
payload := strings.NewReader("{\n \"rows\": [\n {\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<unknown>\"\n }\n ],\n \"response\": \"<string>\",\n \"request_id\": \"<string>\",\n \"model\": \"<string>\",\n \"tag\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"prompt_tokens\": 123,\n \"completion_tokens\": 123,\n \"finish_reason\": \"<string>\",\n \"critique\": \"<string>\"\n }\n ],\n \"tag\": \"<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/logs/import")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rows\": [\n {\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<unknown>\"\n }\n ],\n \"response\": \"<string>\",\n \"request_id\": \"<string>\",\n \"model\": \"<string>\",\n \"tag\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"prompt_tokens\": 123,\n \"completion_tokens\": 123,\n \"finish_reason\": \"<string>\",\n \"critique\": \"<string>\"\n }\n ],\n \"tag\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.errorbar.ai/v1/logs/import")
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 \"rows\": [\n {\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<unknown>\"\n }\n ],\n \"response\": \"<string>\",\n \"request_id\": \"<string>\",\n \"model\": \"<string>\",\n \"tag\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"prompt_tokens\": 123,\n \"completion_tokens\": 123,\n \"finish_reason\": \"<string>\",\n \"critique\": \"<string>\"\n }\n ],\n \"tag\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"request_id": "<string>",
"logged": true,
"reason": "<string>",
"labelled": true,
"label_error": "<string>"
}
],
"imported": 123,
"failed": 123,
"labelled": 123
}{
"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>"
}
}Logs & datasets API
Import graded traffic
Bring your own graded traffic. Each row — a conversation, the reply under judgment, optionally the human verdict — becomes a logged exchange the judge and alignment paths grade, through the same ingest pipeline as gateway traffic (scrubbing, retention, workspace scoping). A verdict is written as a human label in the same call, so a labelled export from another tool, a physician-rated benchmark, or a spreadsheet of tickets can calibrate a judge without replaying a single prompt through a model. Up to 200 rows per call, 30 calls per minute. Never retried: the ingest pipeline has no idempotency key, so a re-sent request_id is a duplicate you own.
POST
/
v1
/
logs
/
import
Import graded traffic
curl --request POST \
--url https://gateway.errorbar.ai/v1/logs/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rows": [
{
"messages": [
{
"role": "<string>",
"content": "<unknown>"
}
],
"response": "<string>",
"request_id": "<string>",
"model": "<string>",
"tag": "<string>",
"tools": [
{}
],
"prompt_tokens": 123,
"completion_tokens": 123,
"finish_reason": "<string>",
"critique": "<string>"
}
],
"tag": "<string>"
}
'import requests
url = "https://gateway.errorbar.ai/v1/logs/import"
payload = {
"rows": [
{
"messages": [
{
"role": "<string>",
"content": "<unknown>"
}
],
"response": "<string>",
"request_id": "<string>",
"model": "<string>",
"tag": "<string>",
"tools": [{}],
"prompt_tokens": 123,
"completion_tokens": 123,
"finish_reason": "<string>",
"critique": "<string>"
}
],
"tag": "<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({
rows: [
{
messages: [{role: '<string>', content: '<unknown>'}],
response: '<string>',
request_id: '<string>',
model: '<string>',
tag: '<string>',
tools: [{}],
prompt_tokens: 123,
completion_tokens: 123,
finish_reason: '<string>',
critique: '<string>'
}
],
tag: '<string>'
})
};
fetch('https://gateway.errorbar.ai/v1/logs/import', 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/logs/import",
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([
'rows' => [
[
'messages' => [
[
'role' => '<string>',
'content' => '<unknown>'
]
],
'response' => '<string>',
'request_id' => '<string>',
'model' => '<string>',
'tag' => '<string>',
'tools' => [
[
]
],
'prompt_tokens' => 123,
'completion_tokens' => 123,
'finish_reason' => '<string>',
'critique' => '<string>'
]
],
'tag' => '<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/logs/import"
payload := strings.NewReader("{\n \"rows\": [\n {\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<unknown>\"\n }\n ],\n \"response\": \"<string>\",\n \"request_id\": \"<string>\",\n \"model\": \"<string>\",\n \"tag\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"prompt_tokens\": 123,\n \"completion_tokens\": 123,\n \"finish_reason\": \"<string>\",\n \"critique\": \"<string>\"\n }\n ],\n \"tag\": \"<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/logs/import")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rows\": [\n {\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<unknown>\"\n }\n ],\n \"response\": \"<string>\",\n \"request_id\": \"<string>\",\n \"model\": \"<string>\",\n \"tag\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"prompt_tokens\": 123,\n \"completion_tokens\": 123,\n \"finish_reason\": \"<string>\",\n \"critique\": \"<string>\"\n }\n ],\n \"tag\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.errorbar.ai/v1/logs/import")
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 \"rows\": [\n {\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<unknown>\"\n }\n ],\n \"response\": \"<string>\",\n \"request_id\": \"<string>\",\n \"model\": \"<string>\",\n \"tag\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"prompt_tokens\": 123,\n \"completion_tokens\": 123,\n \"finish_reason\": \"<string>\",\n \"critique\": \"<string>\"\n }\n ],\n \"tag\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"request_id": "<string>",
"logged": true,
"reason": "<string>",
"labelled": true,
"label_error": "<string>"
}
],
"imported": 123,
"failed": 123,
"labelled": 123
}{
"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
application/json