Mid-run anchor check
curl --request POST \
--url https://gateway.errorbar.ai/v1/reward/sessions/{id}/anchor \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"step": "<string>",
"items": [
{
"requestId": "<string>",
"conversation": "<string>",
"response": "<string>",
"steps": [
{
"content": "<string>",
"toolName": "<string>"
}
],
"sessionId": "<string>"
}
]
}
'import requests
url = "https://gateway.errorbar.ai/v1/reward/sessions/{id}/anchor"
payload = {
"step": "<string>",
"items": [
{
"requestId": "<string>",
"conversation": "<string>",
"response": "<string>",
"steps": [
{
"content": "<string>",
"toolName": "<string>"
}
],
"sessionId": "<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({
step: '<string>',
items: [
{
requestId: '<string>',
conversation: '<string>',
response: '<string>',
steps: [{content: '<string>', toolName: '<string>'}],
sessionId: '<string>'
}
]
})
};
fetch('https://gateway.errorbar.ai/v1/reward/sessions/{id}/anchor', 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/reward/sessions/{id}/anchor",
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([
'step' => '<string>',
'items' => [
[
'requestId' => '<string>',
'conversation' => '<string>',
'response' => '<string>',
'steps' => [
[
'content' => '<string>',
'toolName' => '<string>'
]
],
'sessionId' => '<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/reward/sessions/{id}/anchor"
payload := strings.NewReader("{\n \"step\": \"<string>\",\n \"items\": [\n {\n \"requestId\": \"<string>\",\n \"conversation\": \"<string>\",\n \"response\": \"<string>\",\n \"steps\": [\n {\n \"content\": \"<string>\",\n \"toolName\": \"<string>\"\n }\n ],\n \"sessionId\": \"<string>\"\n }\n ]\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/reward/sessions/{id}/anchor")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"step\": \"<string>\",\n \"items\": [\n {\n \"requestId\": \"<string>\",\n \"conversation\": \"<string>\",\n \"response\": \"<string>\",\n \"steps\": [\n {\n \"content\": \"<string>\",\n \"toolName\": \"<string>\"\n }\n ],\n \"sessionId\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.errorbar.ai/v1/reward/sessions/{id}/anchor")
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 \"step\": \"<string>\",\n \"items\": [\n {\n \"requestId\": \"<string>\",\n \"conversation\": \"<string>\",\n \"response\": \"<string>\",\n \"steps\": [\n {\n \"content\": \"<string>\",\n \"toolName\": \"<string>\"\n }\n ],\n \"sessionId\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"session_id": "<string>",
"held": true,
"reason": "<string>",
"pinned_step": "<string>",
"point": {
"step": "<string>",
"at": "2023-11-07T05:31:56Z",
"n": 123,
"reward_rate": 123,
"anchor_rate": 123,
"anchor_ci": [
123
],
"anchor_corrected": true,
"masked": 123
},
"underpowered": "<string>",
"history": [
{
"step": "<string>",
"at": "2023-11-07T05:31:56Z",
"n": 123,
"reward_rate": 123,
"anchor_rate": 123,
"anchor_ci": [
123
],
"anchor_corrected": true,
"masked": 123
}
],
"spend_micros": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "Invalid API key",
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}{
"error": {
"message": "Insufficient balance: deploying this endpoint requires at least 1h of runway. Top up and try again.",
"type": "insufficient_quota",
"code": "insufficient_balance"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}Certified reward API
Mid-run anchor check
Submit the current policy’s outputs on your FROZEN anchor prompt set (same request ids every time). The server scores them with the session’s reward AND the independent anchor judge (corrected for its measured error), appends the point to the session’s history, and decides: reward up ≥ 10 points over the last three checks while the anchor moves ≤ 2, or the anchor ≥ 10 points below its best, HOLDS the session. Held sessions refuse scoring (409) until a human resumes them; pinned_step is the checkpoint to ship. Points with fewer than 20 gradable prompts hold nothing (underpowered says so). Hold, never kill.
POST
/
v1
/
reward
/
sessions
/
{id}
/
anchor
Mid-run anchor check
curl --request POST \
--url https://gateway.errorbar.ai/v1/reward/sessions/{id}/anchor \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"step": "<string>",
"items": [
{
"requestId": "<string>",
"conversation": "<string>",
"response": "<string>",
"steps": [
{
"content": "<string>",
"toolName": "<string>"
}
],
"sessionId": "<string>"
}
]
}
'import requests
url = "https://gateway.errorbar.ai/v1/reward/sessions/{id}/anchor"
payload = {
"step": "<string>",
"items": [
{
"requestId": "<string>",
"conversation": "<string>",
"response": "<string>",
"steps": [
{
"content": "<string>",
"toolName": "<string>"
}
],
"sessionId": "<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({
step: '<string>',
items: [
{
requestId: '<string>',
conversation: '<string>',
response: '<string>',
steps: [{content: '<string>', toolName: '<string>'}],
sessionId: '<string>'
}
]
})
};
fetch('https://gateway.errorbar.ai/v1/reward/sessions/{id}/anchor', 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/reward/sessions/{id}/anchor",
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([
'step' => '<string>',
'items' => [
[
'requestId' => '<string>',
'conversation' => '<string>',
'response' => '<string>',
'steps' => [
[
'content' => '<string>',
'toolName' => '<string>'
]
],
'sessionId' => '<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/reward/sessions/{id}/anchor"
payload := strings.NewReader("{\n \"step\": \"<string>\",\n \"items\": [\n {\n \"requestId\": \"<string>\",\n \"conversation\": \"<string>\",\n \"response\": \"<string>\",\n \"steps\": [\n {\n \"content\": \"<string>\",\n \"toolName\": \"<string>\"\n }\n ],\n \"sessionId\": \"<string>\"\n }\n ]\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/reward/sessions/{id}/anchor")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"step\": \"<string>\",\n \"items\": [\n {\n \"requestId\": \"<string>\",\n \"conversation\": \"<string>\",\n \"response\": \"<string>\",\n \"steps\": [\n {\n \"content\": \"<string>\",\n \"toolName\": \"<string>\"\n }\n ],\n \"sessionId\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.errorbar.ai/v1/reward/sessions/{id}/anchor")
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 \"step\": \"<string>\",\n \"items\": [\n {\n \"requestId\": \"<string>\",\n \"conversation\": \"<string>\",\n \"response\": \"<string>\",\n \"steps\": [\n {\n \"content\": \"<string>\",\n \"toolName\": \"<string>\"\n }\n ],\n \"sessionId\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"session_id": "<string>",
"held": true,
"reason": "<string>",
"pinned_step": "<string>",
"point": {
"step": "<string>",
"at": "2023-11-07T05:31:56Z",
"n": 123,
"reward_rate": 123,
"anchor_rate": 123,
"anchor_ci": [
123
],
"anchor_corrected": true,
"masked": 123
},
"underpowered": "<string>",
"history": [
{
"step": "<string>",
"at": "2023-11-07T05:31:56Z",
"n": 123,
"reward_rate": 123,
"anchor_rate": 123,
"anchor_ci": [
123
],
"anchor_corrected": true,
"masked": 123
}
],
"spend_micros": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "Invalid API key",
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}{
"error": {
"message": "Insufficient balance: deploying this endpoint requires at least 1h of runway. Top up and try again.",
"type": "insufficient_quota",
"code": "insufficient_balance"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}Authorizations
Your workspace API key, e.g. sk_sovereign_..., sent as Authorization: Bearer <key>.
Path Parameters
Body
application/json