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.
Request
- Base URL: https://docs.litellm.com.cn (the document declares no server; this is the origin it was published from)
- URL: https://docs.litellm.com.cn/v1/tool/spend
- Auth: API key in header x-litellm-api-key
Query parameters
YYYY-MM-DD (defaults to 30 days ago)
YYYY-MM-DD (defaults to today)
Response
Successful Response
Changes
No recorded changes to this operation across all 1 revision of this API.