feat: natural language date shortcuts for litellm_cost()
Adds _resolve_date() helper that converts natural language shortcuts into YYYY-MM-DD before calling the LiteLLM API. Supported shortcuts: - today, yesterday, tomorrow - N days ago (e.g. "two days ago") - monday-sunday (most recent occurrence) - last monday-last sunday - this week, last week - this month, last month Falls back to passthrough for already-formatted YYYY-MM-DD strings. Updated README with new parameter documentation.
This commit is contained in:
1 parent
67f79cfabe
commit
0fd8fcb742
2 files changed
+79
-5
No files matched your search
@@ -11,8 +11,8 @@ Check LiteLLM proxy health and authentication status. Returns which models are h
|
||||
Get LiteLLM cost breakdown for a date range. Returns per-model and per-day spend, token counts, cache hit rate, and request stats.
|
||||
|
||||
**Parameters:**
|
||||
- `start_date` (str, required): Start date in YYYY-MM-DD format
|
||||
- `end_date` (str, required): End date in YYYY-MM-DD format
|
||||
- `start_date` (str, required): Start date — YYYY-MM-DD or natural language shortcut (e.g. "2026-06-01", "today", "yesterday", "monday", "last monday", "two days ago", "this week", "last month")
|
||||
- `end_date` (str, required): End date — YYYY-MM-DD or natural language shortcut
|
||||
- `hide_zero_spend` (bool, default false): Hide models with sub-$0.001 spend. Useful when free-tier or subscription models (e.g. Ollama Cloud) dominate the breakdown with high token counts but negligible cost.
|
||||
|
||||
### `litellm_history`
|
||||
|
||||
Reference in new issue
Block a user