Get Tool Spend
Spend attributed to each tool over a date range, for the Cost Optimization dashboard.
Reads the LiteLLM_DailyToolSpend rollup, written at request time from invoked tools only (MCP tool calls and response tool_calls; declaring a tool without invoking it does not count). A request that invoked multiple tools counts its full spend toward each of them, so per-tool numbers are attributions and do not sum to a deduplicated total.
by_tool is the top TOOL_SPEND_TOP_TOOLS tools by spend, aggregated in SQL, and daily covers only those tools, so the response is bounded by days x TOOL_SPEND_TOP_TOOLS regardless of the requested range or how many distinct tool names exist.
Query parameters
YYYY-MM-DD (defaults to 30 days ago)
YYYY-MM-DD (defaults to 30 days ago)
YYYY-MM-DD (defaults to today)
YYYY-MM-DD (defaults to today)
Response
Successful Response
Changes
Changed in 6 of the 42 revisions of this API.11
- ○
api tag
toolsaddedapi-tag-added
- ○
api tag
tool managementremovedapi-tag-removed
- ○
- ○
api tag
tool managementaddedapi-tag-added
- ○
api tag
toolsremovedapi-tag-removed
- ○
- ○
api tag
toolsaddedapi-tag-added
- ○
api tag
tool managementremovedapi-tag-removed
- ○
- ○
api tag
tool managementaddedapi-tag-added
- ○
api tag
toolsremovedapi-tag-removed
- ○
- ○
api tag
toolsaddedapi-tag-added
- ○
api tag
tool managementremovedapi-tag-removed
- ○
- ○
endpoint added
endpoint-added
This revision also has 5 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○