Usage statistics
Returns usage data for the caller’s tenant. Supports three modes — summary (aggregated totals), grouped aggregation (by agent_type or model), and per-session records. Requires read scope.
POST
/
telemetry
/
get_usage
Usage statistics
curl --request POST \
--url https://api.svantic.com/telemetry/get_usage \
--header 'Content-Type: application/json' \
--data '
{
"summary": true,
"range": "string",
"group_by": "agent_type",
"page": 1,
"page_size": 25,
"sort": "string",
"order": "asc"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
summary: true,
range: 'string',
group_by: 'agent_type',
page: 1,
page_size: 25,
sort: 'string',
order: 'asc'
})
};
fetch('https://api.svantic.com/telemetry/get_usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.svantic.com/telemetry/get_usage"
payload = {
"summary": True,
"range": "string",
"group_by": "agent_type",
"page": 1,
"page_size": 25,
"sort": "string",
"order": "asc"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.svantic.com/telemetry/get_usage"
payload := strings.NewReader("{\n \"summary\": true,\n \"range\": \"string\",\n \"group_by\": \"agent_type\",\n \"page\": 1,\n \"page_size\": 25,\n \"sort\": \"string\",\n \"order\": \"asc\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}{
"ok": true,
"range": "string",
"group_by": "string",
"aggregates": [
{}
],
"page": 0,
"page_size": 0,
"total_tokens": 0,
"total_cost": 0,
"sessions": [
{}
]
}{
"error": "Invalid request body",
"code": "BAD_REQUEST"
}{
"error": "Invalid or expired token",
"code": "unauthorized"
}{
"error": "JWT does not include the required scope for this operation",
"code": "forbidden"
}{
"error": "Not found",
"code": "NOT_FOUND",
"request_id": "req_01EXAMPLE",
"timestamp": "2026-03-31T12:00:00.000Z"
}{
"error": "Request timeout",
"code": "REQUEST_TIMEOUT"
}{
"error": "Internal server error",
"code": "INTERNAL_ERROR",
"request_id": "req_01EXAMPLE",
"timestamp": "2026-03-31T12:00:00.000Z"
}{
"error": "Bad gateway",
"code": "BAD_GATEWAY"
}{
"error": "Service temporarily unavailable",
"code": "SERVICE_UNAVAILABLE"
}Body
application/json
Return aggregated summary instead of records.
Time range: '24h', '7d', '30d' (default '7d').
Aggregate dimension.
Available options:
agent_type, model Required range:
x >= 1Required range:
1 <= x <= 100Sort field (default 'tokens').
Sort order (default 'desc').
Available options:
asc, desc ⌘I
Usage statistics
curl --request POST \
--url https://api.svantic.com/telemetry/get_usage \
--header 'Content-Type: application/json' \
--data '
{
"summary": true,
"range": "string",
"group_by": "agent_type",
"page": 1,
"page_size": 25,
"sort": "string",
"order": "asc"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
summary: true,
range: 'string',
group_by: 'agent_type',
page: 1,
page_size: 25,
sort: 'string',
order: 'asc'
})
};
fetch('https://api.svantic.com/telemetry/get_usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.svantic.com/telemetry/get_usage"
payload = {
"summary": True,
"range": "string",
"group_by": "agent_type",
"page": 1,
"page_size": 25,
"sort": "string",
"order": "asc"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.svantic.com/telemetry/get_usage"
payload := strings.NewReader("{\n \"summary\": true,\n \"range\": \"string\",\n \"group_by\": \"agent_type\",\n \"page\": 1,\n \"page_size\": 25,\n \"sort\": \"string\",\n \"order\": \"asc\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}{
"ok": true,
"range": "string",
"group_by": "string",
"aggregates": [
{}
],
"page": 0,
"page_size": 0,
"total_tokens": 0,
"total_cost": 0,
"sessions": [
{}
]
}{
"error": "Invalid request body",
"code": "BAD_REQUEST"
}{
"error": "Invalid or expired token",
"code": "unauthorized"
}{
"error": "JWT does not include the required scope for this operation",
"code": "forbidden"
}{
"error": "Not found",
"code": "NOT_FOUND",
"request_id": "req_01EXAMPLE",
"timestamp": "2026-03-31T12:00:00.000Z"
}{
"error": "Request timeout",
"code": "REQUEST_TIMEOUT"
}{
"error": "Internal server error",
"code": "INTERNAL_ERROR",
"request_id": "req_01EXAMPLE",
"timestamp": "2026-03-31T12:00:00.000Z"
}{
"error": "Bad gateway",
"code": "BAD_GATEWAY"
}{
"error": "Service temporarily unavailable",
"code": "SERVICE_UNAVAILABLE"
}