Get usage timeseries
Changed onBuckets model usage over time for one metric, optionally broken down by configured model or agent profile. Covers every project the caller can read in the organization; project_ids and agent_profile_ids narrow that scope. Buckets are calendar days, weeks (starting Monday), or months in timezone.
Request
- Base URLhttps://api.omnara.com/v1
- Auth
- HTTP bearer
- or API key in cookie __Host-omnara_session
Path parameters
Organization ID (org_...).
Query parameters
Only tally model calls started at or after this instant. Omit to start from the earliest recorded call.
Only tally model calls started before this instant. Must be later than since when both are given. Omit to include calls up to now.
IANA time zone that decides where each bucket starts.
Bucket width. Omit to pick one from the window length: days up to 92 days, weeks up to 730 days, months beyond. Hourly buckets are used only when requested. The window may span at most 400 buckets.
sum_tokens is input plus output tokens. sum_cost is cost in USD: the model's own pricing when set, otherwise the provider-reported cost, otherwise a list-price estimate; calls that could not be priced contribute nothing. count_model_calls counts model calls that recorded usage.
Value plotted in each bucket. Defaults to sum_tokens.
Break the metric down into one series per group. Omit for a single series.
With group_by, how many groups get their own series, ranked by the metric. The rest are folded into one other series.
Only count usage from these projects.
Only count usage from top-level agents launched from these agent profiles.
With agent_profile_ids, also count usage from subagents spawned by those agents.
Response
Usage timeseries.
sum_tokens is input plus output tokens. sum_cost is cost in USD: the model's own pricing when set, otherwise the provider-reported cost, otherwise a list-price estimate; calls that could not be priced contribute nothing. count_model_calls counts model calls that recorded usage.
IANA time zone the buckets follow.
Start of each bucket in timezone, oldest first, including buckets without usage. The first bucket starts at the beginning of the interval containing since, but only usage at or after since counts.
End of the window; usage at or after this instant is excluded.
All usage in the window, regardless of metric and group_by.
Agents, not counting subagents, that made at least one model call in the window.
Without group_by, a single all series. With it, one series per ranked group, most first, then an other series when usage remains.
Changes
- info
added the required property
totals/cost/effective_usdto the response with the status - info
added the required property
totals/cost/model_calls_with_effective_costto the response with the status
- info
- info
endpoint added
- info