Skip to main content
For the complete documentation index for agents and LLMs, see llms.txt.

Get Token Usage Cost Over Time

GET 

/api/v2/cost/organizations/:organization_id/stats/cost-over-time

Returns the LLM cost per UTC day, in USD. Days without any usage are left out.

Without group_by, each day also says how many conversations had usage, for cost per conversation, and whether its cost is complete.

Set group_by to split each day's cost by model, workspace, pipeline, deployment, provider, API key, source (query or indexing), or index. The group_limit groups with the most cost over the whole range get their own points, the rest are merged into an other group, and usage with no value for the dimension goes into an unattributed group, so a day's points always add up to its total. groups lists them in that order.

Filter by workspace_id to get one workspace's cost. You need cost read access in that workspace. Omitting workspace_id covers the whole organization and requires the organization admin role.

Request​

Responses​

Successful Response