litellm/litellm/types
devin-ai-integration[bot] 77eccaca78
feat(proxy): server-side Team Usage export beyond the top-N key cap (#42996)
* feat(proxy): add uncapped server-side team usage export route

GET /team/daily/activity/export answers the same scoping as
/team/daily/activity/aggregated with one unbounded rollup query, so keys
past USAGE_TOP_API_KEYS_LIMIT are included. Supports daily,
daily_with_keys, daily_with_users and daily_with_models export types as
CSV (default) or JSON. The PTU flat-cost sentinel stays in the plain
daily rollup and is excluded from the keyed and per-model exports

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* feat(ui): export team usage server-side when the key list was truncated

When the aggregated spend response reports api_key truncation, EntityUsage
passes a serverExport into the export modal that downloads CSV or JSON
from GET /team/daily/activity/export instead of building the file from
the truncated on-screen data. apiClient gains a responseType option so
the download can arrive as a Blob, and truncation no longer blocks the
export button

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(proxy): cover team usage export types, sentinel handling and scope

Unit tests pin the uncapped key rollup past USAGE_TOP_API_KEYS_LIMIT,
PTU sentinel inclusion in the daily rollup and exclusion elsewhere, the
per-user fold, and the CSV column layout. Integration tests exercise the
route against a live proxy, including member scope denial

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* refactor(proxy): tidy team usage export route

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): use membership test for export type branch (PLR1714)

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* style(ui): format exportBlockedReason test with prettier

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): satisfy type-discipline gate in team usage export

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): pass export rows as a sequence to the response model

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(proxy-behavior): cover team usage export in the daily activity scope matrix

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* feat(proxy): carry PTU flat cost and escape formulas in team usage export

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(ui): keep the truncation export block on surfaces without a server export

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* chore(ui): drop redundant comments in team export call and modal test

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(integration): audit cells for team usage export

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(integration): tighten team usage export audit cells

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): type the export params tuple and fold user keys in one pass

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* style(ui): bring entity usage export helpers under eslint budgets

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* style(ui): prettier-format UsagePageView after merge

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-24 15:40:36 -05:00
..
containers refactor(types): replace Any with real types across 54 more backend files 2026-09-08 12:41:07 +00:00
google_genai Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_daily_any_cleanup_08_04_2026 2026-08-05 12:43:11 -07:00
images chore(lint): remove litellm/types from the ruff lint exclusion 2026-08-05 01:10:15 -07:00
integrations fix(prometheus): add model_group label to deployment request and rate limit metrics (#42966) 2026-09-24 12:15:01 -07:00
interactions chore(lint): remove litellm/types from the ruff lint exclusion 2026-08-05 01:10:15 -07:00
litellm_core_utils fix(streaming): keep an explicit provider prompt_tokens=0 or completion_tokens=0 in streamed usage 2026-09-21 14:01:08 -07:00
llms refactor: daily fresh tech debt cleanup, rolling PR (#42710) 2026-09-24 04:17:23 -07:00
management_endpoints feat(lint): add LIT013 flagging *-ok suppressions that suppress nothing and remove the 240 stale ones (#42793) 2026-09-23 17:50:09 -07:00
mcp_server fix(mcp): keep discovered scopes out of saved settings 2026-09-18 17:23:31 -07:00
passthrough_endpoints feat(lint): add LIT013 flagging *-ok suppressions that suppress nothing and remove the 240 stale ones (#42793) 2026-09-23 17:50:09 -07:00
prompts chore(lint): remove litellm/types from the ruff lint exclusion 2026-08-05 01:10:15 -07:00
proxy feat(proxy): server-side Team Usage export beyond the top-N key cap (#42996) 2026-09-24 15:40:36 -05:00
responses fix(responses): merge deployment litellm_params into native websocket response.create frames 2026-09-18 14:15:39 -07:00
secret_managers feat(secret_managers): support customer-managed KMS key for virtual keys stored in AWS Secrets Manager (#40475) 2026-09-11 09:54:08 -07:00
videos refactor(typing): replace Any with proven types in 89 more backend files 2026-09-02 23:08:42 +00:00
access_group.py feat(access-groups): resolve resource names on access group responses 2026-09-04 16:08:50 -07:00
adapter.py fix(lint): bring basedpyright rule counts back under their budget limits 2026-08-05 10:23:02 -07:00
agents.py fix(proxy): scope agent permissions to invoking caller 2026-09-21 22:32:32 +00:00
caching.py fix(caching): keep embedding cache hits aligned with request inputs (#42571) 2026-09-22 17:14:44 -05:00
completion.py chore(typing): clear 1.6k basedpyright Any errors across 56 files 2026-08-11 06:47:39 -07:00
compression.py chore(lint): remove litellm/types from the ruff lint exclusion 2026-08-05 01:10:15 -07:00
embedding.py chore(lint): remove litellm/types from the ruff lint exclusion 2026-08-05 01:10:15 -07:00
files.py fix(types): resolve the four type-discipline additions surfaced by the staging merge 2026-08-05 11:05:53 -07:00
fine_tuning.py (feat) POST /fine_tuning/jobs support passing vertex specific hyper params (#7490) 2025-01-01 07:44:48 -08:00
guardrail_base_init.py refactor(types): replace Any with real types across 54 more backend files 2026-08-29 19:00:43 +00:00
guardrails.py Merge remote-tracking branch 'origin/main' into litellm_decrease_anys_opus5_r5 2026-09-21 12:57:38 -07:00
lar1.py chore: litellm oss staging (#31185) 2026-06-26 09:17:44 -07:00
mcp.py fix(mcp): preserve session expiry signals and scope dependency CI 2026-09-18 22:52:10 -07:00
memory_management.py chore(typing): remove 914 basedpyright Any errors across 16 hotspot files 2026-08-10 01:24:40 -07:00
object_permission.py feat(proxy): granular key/team access control for Claude Code marketplace plugins (#40518) 2026-09-10 14:26:09 -07:00
policy_engine.py chore(lint): remove litellm/types from the ruff lint exclusion 2026-08-05 01:10:15 -07:00
rag.py test(rag): validate retrieval filters at HTTP boundary 2026-08-25 14:56:22 +00:00
realtime.py Merge remote-tracking branch 'origin/main' into litellm_decrease_anys_opus5_r5 2026-09-14 07:27:54 +00:00
rerank.py fix(hosted_vllm): forward truncate_prompt_tokens on rerank requests 2026-09-02 11:07:30 -07:00
router.py feat(proxy): honor model_info.discoverable on the model listing endpoints (#42825) 2026-09-23 17:51:16 -07:00
router_weights.py fix(router): honor team and key provider weights 2026-09-14 23:31:52 -07:00
scheduler.py Squashed commit of the following: (#9709) 2025-04-02 21:24:54 -07:00
search.py chore(lint): remove litellm/types from the ruff lint exclusion 2026-08-05 01:10:15 -07:00
services.py Merge branch 'litellm_window_spend_schema' into litellm_window_spend_writer 2026-08-29 11:47:37 -07:00
tag_management.py chore(lint): remove litellm/types from the ruff lint exclusion 2026-08-05 01:10:15 -07:00
tool_management.py chore(lint): remove litellm/types from the ruff lint exclusion 2026-08-05 01:10:15 -07:00
utils.py refactor: daily fresh tech debt cleanup, rolling PR (#42710) 2026-09-24 04:17:23 -07:00
vector_store_files.py chore(lint): remove litellm/types from the ruff lint exclusion 2026-08-05 01:10:15 -07:00
vector_stores.py fix(vector_stores): keep config-defined vector stores listed and read-only (#42574) 2026-09-23 04:02:16 +00:00