Skip to main content

litellm_admin_tools

The connector’s action selects a read operation for the saved connection. For credential setup, least-privilege guidance, and the distinction from model routing, see Connections.

Actions

Parameters

The new anomaly_settings thresholds have these types and defaults: GET_DAILY_KEY_SPEND returns one row per date, key hash, and model, with spend, successful and failed request counts, and token counts; one key can therefore have several rows per day. Its response also includes total_requests and total_failed_requests summed across the returned rows. It reads one day at a time from LiteLLM’s aggregated daily-activity route when available, and falls back to the paged route when that route is unsupported or lacks per-model key detail. Without dates, spend actions cover the last seven days, including today. GET_SPEND_LOGS returns request rows without prompt or response text; older proxies may return per-key totals instead. GET_DAILY_KEY_SPEND reads at most 20 pages per day on its paged fallback; when its result is truncated: true, narrow the date range before using the partial totals. Credentials in model and config results are redacted. For charts and recurring reports, use the litellm_admin dataset source instead of scheduling repeated tool calls. DETECT_SPEND_ANOMALIES reads the last complete UTC day by default; set end_date to choose another report end date. Its anomaly_settings.time_budget_seconds is a best-effort budget (default 150, allowed 30–300): no read starts after the budget expires, and each request timeout is cut to the remaining time. A read already in flight may finish later if the proxy continues sending data. If the key list or daily spend cannot be read, the action returns an error; failed optional reads are skipped and named in the report notes. A GET that times out is retried once. The paged spend-log route is used when available, with a legacy route fallback. The rotated_key finding flags an unknown key hash whose alias now belongs to a listed key. It is MEDIUM when the old key still succeeds or spends more than one hour after the new key was created, or continues failing beyond anomaly_settings.rotated_failures_medium_after_hours (default 48); otherwise it is LOW. If the new key’s creation time is unavailable, successful requests or spend in the report window prevent a LOW severity. Unlisted hashes with spend or successful requests are checked with GET /key/info (at most five lookups, highest spend first). A hash that exists but is absent from the key list is reported as key_missing_from_list; failed lookups are noted and do not confirm deletion. Traffic associated with a Genesis auto-provisioned source is reported as auto_provisioned_key_gone: deletion-like evidence can be LOW, while successful-only traffic, uncertain deletion timing, daily spend above auto_provisioned_gone_medium_spend, traffic continuing past auto_provisioned_gone_medium_after_hours, or a failed lookup is MEDIUM. When the lookup is skipped, severity follows the available traffic evidence and thresholds. Unknown hashes with only failed requests and $0 spend are grouped into one unknown_key_failed_only finding rather than one finding per hash. It lists the available routes, user agents and requester IPs; it is LOW when every log read is model discovery and MEDIUM for other calls or a sufficiently large daily jump above the trailing median. A spend spike against a baseline below $0.01 is described as new spend against an approximately-zero baseline, without a ratio. For example, list keys and then inspect daily spend for one key:
Use a returned key_hash as key with GET_DAILY_KEY_SPEND or GET_KEY_INFO.