List timeseries

Returns the caller org's LLM usage over time as an evenly-spaced series.

GET /v1/event/timeseries

Addresshttps://api.hanzo.ai/v1/event/timeseries
MethodGET
Operationget_event_timeseries
AuthAuthorization: Bearer $HANZO_API_KEY

Returns the caller org's LLM usage over time as an evenly-spaced series. One point per hour or per day — the bucket the window implies, 24h giving hours and 7d/30d giving days — carrying requests, total tokens and spend in cents. Empty buckets are filled with zeros so a client charts a continuous line.

The org is the validated principal's — never a parameter. 401 without a validated bearer, 400 on an unknown range, 503 when the warehouse is unreachable.

Request

3 fields.

FieldInTypeRequiredDescription
rangequerystring—Range is a relative window: a count and a unit — 24h, 7d, 90d, any <N>h or <N>d — or day, week, month, all.
startquerystring—Start is the inclusive lower bound of a custom window, RFC3339.
endquerystring—End is the exclusive upper bound of a custom window, RFC3339.

Response

StatusBodyMeaning
200event.Timeseriesok
defaultproblem-detailsrefused

200 body — 12 fields.

FieldInTypeAlwaysDescription
endbodystring—End is the window's exclusive upper bound, RFC3339 UTC.
intervalbodystring—Interval is the bucket width: hour or day.
rangebodystring—Range is the window that was actually applied: 24h, 7d, 30d or custom.
scopebodyevent.Scope—
scope.orgbodystring—Org is the IAM org slug the rows were read under: the validated principal's, resolved server-side.
seriesbodyevent.UsagePoint[]—Series is one point per bucket, oldest first, with empty buckets zero-filled.
series[].requestsbodyinteger (int64)—Requests is how many LLM calls fell in this bucket.
series[].spendCentsbodyinteger (int64)—SpendCents is what they cost, in cents.
series[].tbodystring—T is the bucket's start, RFC3339 UTC, aligned to the interval.
series[].tokensbodyinteger (int64)—Tokens is prompt plus completion tokens over those calls.
sourcebodystring—Source is the warehouse table the series read.
startbodystring—Start is the window's inclusive lower bound, RFC3339 UTC.

Failure carries the platform error shape — see Errors.

Examples

hanzo event timeseries
import { Configuration, EventApi } from 'hanzoai';

const api = new EventApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getEventTimeseries();
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import EventApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = EventApi(client).get_event_timeseries()
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.EventAPI.GetEventTimeseries(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, event_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = event_api::get_event_timeseries(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.EventApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new EventApi(client).getEventTimeseries();
curl https://api.hanzo.ai/v1/event/timeseries \
  -H "Authorization: Bearer $HANZO_API_KEY"

MCP reaches event through the event tool, which names its 9 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "get_event_economic"
         }
       }
     }'

Event API · All Hanzo APIs · Interactive reference

Was this page useful?