The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Adding deleted key capture to team member delete
yuneng-jiang11ff05e99dff
diff --git a/litellm/proxy/management_endpoints/team_endpoints.py b/litellm/proxy/management_endpoints/team_endpoints.pyindex 3a9af9d54f3..239586b5740 100644--- a/litellm/proxy/management_endpoints/team_endpoints.py+++ b/litellm/proxy/management_endpoints/team_endpoints.py@@ -1974,6 +1974,28 @@ async def team_member_delete(## DELETE KEYS CREATED BY USER FOR THIS TEAMif user_ids_to_delete:+ from litellm.proxy.management_endpoints.key_management_endpoints import (+ _persist_deleted_verification_tokens,+ )++ # Fetch keys before deletion to persist them+ keys_to_delete: List[LiteLLM_VerificationToken] = (+ await prisma_client.db.litellm_verificationtoken.find_many(+ where={+ "user_id": {"in": list(user_ids_to_delete)},+ "team_id": data.team_id,+ }+ )+ )++ if keys_to_delete:+ await _persist_deleted_verification_tokens(+ keys=keys_to_delete,+ prisma_client=prisma_client,+ user_api_key_dict=user_api_key_dict,+ litellm_changed_by=None,+ )+await prisma_client.db.litellm_verificationtoken.delete_many(where={"user_id": {"in": list(user_ids_to_delete)},