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
use management_endpoint_wrapper for key endpoints
Ishaan Jaff47953aaa96bf
diff --git a/litellm/proxy/management_endpoints/key_management_endpoints.py b/litellm/proxy/management_endpoints/key_management_endpoints.pyindex 0e4696e4423..968b3ede912 100644--- a/litellm/proxy/management_endpoints/key_management_endpoints.py+++ b/litellm/proxy/management_endpoints/key_management_endpoints.py@@ -26,6 +26,7 @@ import litellmfrom litellm._logging import verbose_proxy_loggerfrom litellm.proxy._types import *from litellm.proxy.auth.user_api_key_auth import user_api_key_auth+from litellm.proxy.management_helpers.utils import management_endpoint_wrapperfrom litellm.proxy.utils import _duration_in_secondsrouter = APIRouter()@@ -37,6 +38,7 @@ router = APIRouter()dependencies=[Depends(user_api_key_auth)],response_model=GenerateKeyResponse,)+@management_endpoint_wrapperasync def generate_key_fn(data: GenerateKeyRequest,user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),@@ -278,6 +280,7 @@ async def generate_key_fn(@router.post("/key/update", tags=["key management"], dependencies=[Depends(user_api_key_auth)])+@management_endpoint_wrapperasync def update_key_fn(request: Request,data: UpdateKeyRequest,@@ -398,6 +401,7 @@ async def update_key_fn(@router.post("/key/delete", tags=["key management"], dependencies=[Depends(user_api_key_auth)])+@management_endpoint_wrapperasync def delete_key_fn(data: KeyRequest,user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),