Usage
Get the usage of your agents
Use it to bill your own customers or to see where tokens go: turns, replies and tokens per day, agent, model or subaccount over a date range of up to 366 days. A platform key reads one subaccount with the Lelemon-Subaccount header, or all of them at once with groupBy=subaccount, which also counts the usage of the platform itself as the group with subaccountId null. Days count in the time zone of the organization. It shows no prices. Read-only and idempotent. Do not use it to enforce a limit: for that create a budget with POST /v2/budgets.
Required scope: usage:read.
query Parameters
fromFirst day, inclusive, as YYYY-MM-DD in the time zone of the organization. Defaults to the first day of the current month.
toLast day, inclusive. Defaults to today. The range cannot pass 366 days.
agentIdOnly the usage of this agent.
groupBySplit data by day, agent or model. subaccount splits by subaccount and only works with a platform key that does not send Lelemon-Subaccount: it covers the platform and all its subaccounts, the group with subaccountId null is the platform itself and the totals are the sum of every group. Without it data is empty and the totals are those of the organization of the key.
Headers
Lelemon-Subaccount^sub_[0-9A-Za-z]{22}…The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.
Get the usage of your agents › Responses
objectfromtotimezone