diff --git a/litellm/proxy/utils.py b/litellm/proxy/utils.py index fb5b523a76b..1c504ca9369 100644 --- a/litellm/proxy/utils.py +++ b/litellm/proxy/utils.py @@ -838,6 +838,11 @@ def get_logging_payload(kwargs, response_obj, start_time, end_time): # hash the api_key api_key = hash_token(api_key) + if "headers" in metadata and "authorization" in metadata["headers"]: + metadata["headers"].pop( + "authorization" + ) # do not store the original `sk-..` api key in the db + payload = { "request_id": id, "call_type": call_type,