Skip to Content
Levain LabsLevain Labs

get_hourly_usage

Get usage per hour, broken down by agent, model and provider. start and end are ISO datetimes (UTC unless they carry an offset); by default the last 7 days,…

Get usage per hour, broken down by agent, model and provider.

start and end are ISO datetimes (UTC unless they carry an offset); by default the last 7 days, 90 days at most. Pass agent_id (an agent id or slug) to keep only that agent's usage, and model to keep only one model's rows. Narrow these to keep the reply small. The reply is the list of rows, oldest hour first. When it would not fit one tool result it is an object instead: the first hours in rows, truncated true, and next_start; call again with the same arguments and start set to next_start to read the rest.

Parameters

NameTypeRequiredDescription
startstringno
endstringno
agent_idstringno
modelstringno

On this page