Record a physical task decision receipt
curl --request PATCH \
--url https://api.agentsfleet.net/v1/runners/me/leases/{lease_id}/tasks/decisions/{call_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fencing_token": 1,
"receipt": {
"outcome": "provider",
"result": {
"result": {
"answers": {},
"outcome": "answered"
},
"reported_model": "<string>",
"usage": {
"cache_write_tokens": 1,
"cached_input_tokens": 1,
"input_tokens": 1,
"output_tokens": 1
}
}
}
}
'import requests
url = "https://api.agentsfleet.net/v1/runners/me/leases/{lease_id}/tasks/decisions/{call_id}"
payload = {
"fencing_token": 1,
"receipt": {
"outcome": "provider",
"result": {
"result": {
"answers": {},
"outcome": "answered"
},
"reported_model": "<string>",
"usage": {
"cache_write_tokens": 1,
"cached_input_tokens": 1,
"input_tokens": 1,
"output_tokens": 1
}
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fencing_token: 1,
receipt: {
outcome: 'provider',
result: {
result: {answers: {}, outcome: 'answered'},
reported_model: '<string>',
usage: {
cache_write_tokens: 1,
cached_input_tokens: 1,
input_tokens: 1,
output_tokens: 1
}
}
}
})
};
fetch('https://api.agentsfleet.net/v1/runners/me/leases/{lease_id}/tasks/decisions/{call_id}', 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.agentsfleet.net/v1/runners/me/leases/{lease_id}/tasks/decisions/{call_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'fencing_token' => 1,
'receipt' => [
'outcome' => 'provider',
'result' => [
'result' => [
'answers' => [
],
'outcome' => 'answered'
],
'reported_model' => '<string>',
'usage' => [
'cache_write_tokens' => 1,
'cached_input_tokens' => 1,
'input_tokens' => 1,
'output_tokens' => 1
]
]
]
]),
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.agentsfleet.net/v1/runners/me/leases/{lease_id}/tasks/decisions/{call_id}"
payload := strings.NewReader("{\n \"fencing_token\": 1,\n \"receipt\": {\n \"outcome\": \"provider\",\n \"result\": {\n \"result\": {\n \"answers\": {},\n \"outcome\": \"answered\"\n },\n \"reported_model\": \"<string>\",\n \"usage\": {\n \"cache_write_tokens\": 1,\n \"cached_input_tokens\": 1,\n \"input_tokens\": 1,\n \"output_tokens\": 1\n }\n }\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.agentsfleet.net/v1/runners/me/leases/{lease_id}/tasks/decisions/{call_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fencing_token\": 1,\n \"receipt\": {\n \"outcome\": \"provider\",\n \"result\": {\n \"result\": {\n \"answers\": {},\n \"outcome\": \"answered\"\n },\n \"reported_model\": \"<string>\",\n \"usage\": {\n \"cache_write_tokens\": 1,\n \"cached_input_tokens\": 1,\n \"input_tokens\": 1,\n \"output_tokens\": 1\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentsfleet.net/v1/runners/me/leases/{lease_id}/tasks/decisions/{call_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fencing_token\": 1,\n \"receipt\": {\n \"outcome\": \"provider\",\n \"result\": {\n \"result\": {\n \"answers\": {},\n \"outcome\": \"answered\"\n },\n \"reported_model\": \"<string>\",\n \"usage\": {\n \"cache_write_tokens\": 1,\n \"cached_input_tokens\": 1,\n \"input_tokens\": 1,\n \"output_tokens\": 1\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"call_id": "<string>",
"disposition": "current",
"replayed": true,
"reserved_nanos": "<string>",
"state": "reserved",
"charged_nanos": "<string>",
"overage_nanos": "<string>",
"usage": {
"cache_write_tokens": 1,
"cached_input_tokens": 1,
"input_tokens": 1,
"output_tokens": 1
}
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}Runner API
Record a physical task decision receipt
Accounts usage under the original runner, lease and fence, even after live work is removed. Known charges and unknown reservations are independent of answer usability. Canonical retries do not charge twice.
PATCH
/
v1
/
runners
/
me
/
leases
/
{lease_id}
/
tasks
/
decisions
/
{call_id}
Record a physical task decision receipt
curl --request PATCH \
--url https://api.agentsfleet.net/v1/runners/me/leases/{lease_id}/tasks/decisions/{call_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fencing_token": 1,
"receipt": {
"outcome": "provider",
"result": {
"result": {
"answers": {},
"outcome": "answered"
},
"reported_model": "<string>",
"usage": {
"cache_write_tokens": 1,
"cached_input_tokens": 1,
"input_tokens": 1,
"output_tokens": 1
}
}
}
}
'import requests
url = "https://api.agentsfleet.net/v1/runners/me/leases/{lease_id}/tasks/decisions/{call_id}"
payload = {
"fencing_token": 1,
"receipt": {
"outcome": "provider",
"result": {
"result": {
"answers": {},
"outcome": "answered"
},
"reported_model": "<string>",
"usage": {
"cache_write_tokens": 1,
"cached_input_tokens": 1,
"input_tokens": 1,
"output_tokens": 1
}
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fencing_token: 1,
receipt: {
outcome: 'provider',
result: {
result: {answers: {}, outcome: 'answered'},
reported_model: '<string>',
usage: {
cache_write_tokens: 1,
cached_input_tokens: 1,
input_tokens: 1,
output_tokens: 1
}
}
}
})
};
fetch('https://api.agentsfleet.net/v1/runners/me/leases/{lease_id}/tasks/decisions/{call_id}', 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.agentsfleet.net/v1/runners/me/leases/{lease_id}/tasks/decisions/{call_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'fencing_token' => 1,
'receipt' => [
'outcome' => 'provider',
'result' => [
'result' => [
'answers' => [
],
'outcome' => 'answered'
],
'reported_model' => '<string>',
'usage' => [
'cache_write_tokens' => 1,
'cached_input_tokens' => 1,
'input_tokens' => 1,
'output_tokens' => 1
]
]
]
]),
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.agentsfleet.net/v1/runners/me/leases/{lease_id}/tasks/decisions/{call_id}"
payload := strings.NewReader("{\n \"fencing_token\": 1,\n \"receipt\": {\n \"outcome\": \"provider\",\n \"result\": {\n \"result\": {\n \"answers\": {},\n \"outcome\": \"answered\"\n },\n \"reported_model\": \"<string>\",\n \"usage\": {\n \"cache_write_tokens\": 1,\n \"cached_input_tokens\": 1,\n \"input_tokens\": 1,\n \"output_tokens\": 1\n }\n }\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.agentsfleet.net/v1/runners/me/leases/{lease_id}/tasks/decisions/{call_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fencing_token\": 1,\n \"receipt\": {\n \"outcome\": \"provider\",\n \"result\": {\n \"result\": {\n \"answers\": {},\n \"outcome\": \"answered\"\n },\n \"reported_model\": \"<string>\",\n \"usage\": {\n \"cache_write_tokens\": 1,\n \"cached_input_tokens\": 1,\n \"input_tokens\": 1,\n \"output_tokens\": 1\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentsfleet.net/v1/runners/me/leases/{lease_id}/tasks/decisions/{call_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fencing_token\": 1,\n \"receipt\": {\n \"outcome\": \"provider\",\n \"result\": {\n \"result\": {\n \"answers\": {},\n \"outcome\": \"answered\"\n },\n \"reported_model\": \"<string>\",\n \"usage\": {\n \"cache_write_tokens\": 1,\n \"cached_input_tokens\": 1,\n \"input_tokens\": 1,\n \"output_tokens\": 1\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"call_id": "<string>",
"disposition": "current",
"replayed": true,
"reserved_nanos": "<string>",
"state": "reserved",
"charged_nanos": "<string>",
"overage_nanos": "<string>",
"usage": {
"cache_write_tokens": 1,
"cached_input_tokens": 1,
"input_tokens": 1,
"output_tokens": 1
}
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}Authorizations
Path Parameters
Body
application/json
PATCH and late renew/report receipts share the same native recorder.
Response
Current accounting and answer disposition
Confirms receipt accounting without claiming goal completion.