curl --request POST \
--url https://galinum.com/api/v1/agent/usage-reports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"executionId": "<string>",
"calls": [
{
"inputTokens": 0,
"cachedInputTokens": 0,
"cacheWriteTokens": 0,
"outputTokens": 0,
"reasoningTokens": 0,
"toolCostMicros": 0
}
],
"sessionId": "<unknown>",
"model": "<unknown>"
}
'import requests
url = "https://galinum.com/api/v1/agent/usage-reports"
payload = {
"executionId": "<string>",
"calls": [
{
"inputTokens": 0,
"cachedInputTokens": 0,
"cacheWriteTokens": 0,
"outputTokens": 0,
"reasoningTokens": 0,
"toolCostMicros": 0
}
],
"sessionId": "<unknown>",
"model": "<unknown>"
}
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({
executionId: '<string>',
calls: [
{
inputTokens: 0,
cachedInputTokens: 0,
cacheWriteTokens: 0,
outputTokens: 0,
reasoningTokens: 0,
toolCostMicros: 0
}
],
sessionId: '<unknown>',
model: '<unknown>'
})
};
fetch('https://galinum.com/api/v1/agent/usage-reports', 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://galinum.com/api/v1/agent/usage-reports",
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([
'executionId' => '<string>',
'calls' => [
[
'inputTokens' => 0,
'cachedInputTokens' => 0,
'cacheWriteTokens' => 0,
'outputTokens' => 0,
'reasoningTokens' => 0,
'toolCostMicros' => 0
]
],
'sessionId' => '<unknown>',
'model' => '<unknown>'
]),
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://galinum.com/api/v1/agent/usage-reports"
payload := strings.NewReader("{\n \"executionId\": \"<string>\",\n \"calls\": [\n {\n \"inputTokens\": 0,\n \"cachedInputTokens\": 0,\n \"cacheWriteTokens\": 0,\n \"outputTokens\": 0,\n \"reasoningTokens\": 0,\n \"toolCostMicros\": 0\n }\n ],\n \"sessionId\": \"<unknown>\",\n \"model\": \"<unknown>\"\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://galinum.com/api/v1/agent/usage-reports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"executionId\": \"<string>\",\n \"calls\": [\n {\n \"inputTokens\": 0,\n \"cachedInputTokens\": 0,\n \"cacheWriteTokens\": 0,\n \"outputTokens\": 0,\n \"reasoningTokens\": 0,\n \"toolCostMicros\": 0\n }\n ],\n \"sessionId\": \"<unknown>\",\n \"model\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://galinum.com/api/v1/agent/usage-reports")
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 \"executionId\": \"<string>\",\n \"calls\": [\n {\n \"inputTokens\": 0,\n \"cachedInputTokens\": 0,\n \"cacheWriteTokens\": 0,\n \"outputTokens\": 0,\n \"reasoningTokens\": 0,\n \"toolCostMicros\": 0\n }\n ],\n \"sessionId\": \"<unknown>\",\n \"model\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body{
"executionId": "<string>",
"credits": 1,
"costMicros": 1,
"replayed": true
}{
"error": "<string>"
}{
"error": "Unauthorized"
}{
"error": "<string>"
}{
"error": "Invalid request"
}{
"error": "Too many requests"
}{
"error": "Could not identify user"
}Record hosted-agent usage
Records one immutable usage row for a hosted-agent execution, and the billing report that tracks it. Galinum prices the reported per-call token usage. Repeating an executionId returns the original row unchanged and creates no second billing report. Only Galinum’s hosted-agent key may call this endpoint; a project secret key returns 403, because agents you run yourself are not billed for AI credits. The JSON request body must be between 1 and 8,192 bytes, inclusive.
curl --request POST \
--url https://galinum.com/api/v1/agent/usage-reports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"executionId": "<string>",
"calls": [
{
"inputTokens": 0,
"cachedInputTokens": 0,
"cacheWriteTokens": 0,
"outputTokens": 0,
"reasoningTokens": 0,
"toolCostMicros": 0
}
],
"sessionId": "<unknown>",
"model": "<unknown>"
}
'import requests
url = "https://galinum.com/api/v1/agent/usage-reports"
payload = {
"executionId": "<string>",
"calls": [
{
"inputTokens": 0,
"cachedInputTokens": 0,
"cacheWriteTokens": 0,
"outputTokens": 0,
"reasoningTokens": 0,
"toolCostMicros": 0
}
],
"sessionId": "<unknown>",
"model": "<unknown>"
}
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({
executionId: '<string>',
calls: [
{
inputTokens: 0,
cachedInputTokens: 0,
cacheWriteTokens: 0,
outputTokens: 0,
reasoningTokens: 0,
toolCostMicros: 0
}
],
sessionId: '<unknown>',
model: '<unknown>'
})
};
fetch('https://galinum.com/api/v1/agent/usage-reports', 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://galinum.com/api/v1/agent/usage-reports",
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([
'executionId' => '<string>',
'calls' => [
[
'inputTokens' => 0,
'cachedInputTokens' => 0,
'cacheWriteTokens' => 0,
'outputTokens' => 0,
'reasoningTokens' => 0,
'toolCostMicros' => 0
]
],
'sessionId' => '<unknown>',
'model' => '<unknown>'
]),
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://galinum.com/api/v1/agent/usage-reports"
payload := strings.NewReader("{\n \"executionId\": \"<string>\",\n \"calls\": [\n {\n \"inputTokens\": 0,\n \"cachedInputTokens\": 0,\n \"cacheWriteTokens\": 0,\n \"outputTokens\": 0,\n \"reasoningTokens\": 0,\n \"toolCostMicros\": 0\n }\n ],\n \"sessionId\": \"<unknown>\",\n \"model\": \"<unknown>\"\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://galinum.com/api/v1/agent/usage-reports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"executionId\": \"<string>\",\n \"calls\": [\n {\n \"inputTokens\": 0,\n \"cachedInputTokens\": 0,\n \"cacheWriteTokens\": 0,\n \"outputTokens\": 0,\n \"reasoningTokens\": 0,\n \"toolCostMicros\": 0\n }\n ],\n \"sessionId\": \"<unknown>\",\n \"model\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://galinum.com/api/v1/agent/usage-reports")
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 \"executionId\": \"<string>\",\n \"calls\": [\n {\n \"inputTokens\": 0,\n \"cachedInputTokens\": 0,\n \"cacheWriteTokens\": 0,\n \"outputTokens\": 0,\n \"reasoningTokens\": 0,\n \"toolCostMicros\": 0\n }\n ],\n \"sessionId\": \"<unknown>\",\n \"model\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body{
"executionId": "<string>",
"credits": 1,
"costMicros": 1,
"replayed": true
}{
"error": "<string>"
}{
"error": "Unauthorized"
}{
"error": "<string>"
}{
"error": "Invalid request"
}{
"error": "Too many requests"
}{
"error": "Could not identify user"
}Authorizations
Galinum's scoped hosted-agent key (pk_agent_...). It can read required project state, including launch policy and campaign activation, and use fenced evaluation or GitHub source operations. Ordinary campaign, status, goal, segment, media, launch-policy, and campaign-activation writes return 403. Reads grant no approval or deployment configuration authority.
Body
Send Content-Type: application/json with a Content-Length from 1 through 8,192 bytes. Larger requests return 413.
1 - 128Per-call usage objects. The server accepts at most 200 entries, but the 8,192-byte request limit is authoritative and may allow fewer depending on the included fields.
1Show child attributes
Show child attributes
Optional session metadata. Stored only when this value is a string; other JSON values are treated as omitted.
Optional model metadata. Stored only when this value is a string; other JSON values are treated as omitted.