get_cost_totals
Reads the total LLM cost, tokens and requests of the workspace, or of one pipeline, over a date range.
Instructions
Reads the total LLM cost, tokens and requests of the workspace, or of one pipeline, over a date range.
Use this to answer how much a workspace or pipeline spent on LLM calls. Costs are in USD.
Without dates the range is the last 30 days. start_date is inclusive and end_date exclusive, so
for September 2026 pass 2026-09-01T00:00:00Z and 2026-10-01T00:00:00Z.
Check is_cost_complete before reporting total_cost. When it is false, total_cost is a lower
bound, not the final figure: say so, and name the models in unpriced_models (LLM calls with no price
on file) and mention pending_generation_count (calls whose cost is still being calculated, which
usually clears within a minute). total_requests counts queries, not individual LLM calls; one query
can make several LLM calls.
:param pipeline_name: Restrict to this pipeline. Omit for the whole workspace. Needs Pipelines read as well as
Costs read.
:param start_date: Inclusive start as an ISO timestamp. Defaults to 30 days before end_date.
:param end_date: Exclusive end as an ISO timestamp. Defaults to no upper bound.
:returns: The cost totals, or an error message.
The output is automatically stored and can be referenced in other functions.
Returns a formatted preview with an object ID (e.g., @obj_123).
Use the object store tools in combination with the object ID to view nested properties of the object.
Use the returned object ID to pass this result to other functions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end_date | No | ||
| start_date | No | ||
| pipeline_name | No |