v2

latestOpenAPI 3.1.02026-07-2670186350.6 KB
analytics

Usage

get/analytics/usage

Query parameters

from_datestring date-time nullable

Start date for the time range (inclusive). If not provided, defaults to the first day of the current month.

Start date for the time range (inclusive). If not provided, defaults to the first day of the current month.

to_datestring date-time nullable

End date for the time range (exclusive). If not provided, defaults to the last day of the current month.

End date for the time range (exclusive). If not provided, defaults to the last day of the current month.

granularity'minute' | 'hour' | 'day' | 'month' | 'year'

Time granularity for grouping (minute, hour, day, month, year)

fieldsstring[] nullable

Fields from event_metadata to include and sum

Fields from event_metadata to include and sum

[
  "completion_tokens",
  "total_tokens"
]
group_bystring[] nullable

Fields from tags to group by

Fields from tags to group by

[
  "model",
  "project.name"
]
session_idstring nullable

If provided, narrow the result to events tagged with this session_id (set by the URL-session prefix /v3/session/<sid>). Useful for opper launch style accounting.

If provided, narrow the result to events tagged with this session_id (set by the URL-session prefix /v3/session/<sid>). Useful for opper launch style accounting.

Response

Successful Response

time_bucketstring date-time required

The start time of the time bucket

coststring required

The cost in USD for the time bucket