From 4e7566c7a25dc5f2c4405813ecbc834631db256e Mon Sep 17 00:00:00 2001 From: rodriciru Date: Tue, 31 Mar 2026 14:44:54 +0200 Subject: [PATCH] Update request body method to return JSON When you try to copy-paste the curl command from log directly into a shell, single quotes in `-d` param will make an `INVALID_ARGUMENT` 400 error --- litellm/litellm_core_utils/litellm_logging.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/litellm_core_utils/litellm_logging.py b/litellm/litellm_core_utils/litellm_logging.py index 7395b65626f..ecfc76d34ae 100644 --- a/litellm/litellm_core_utils/litellm_logging.py +++ b/litellm/litellm_core_utils/litellm_logging.py @@ -1150,7 +1150,7 @@ class Logging(LiteLLMLoggingBaseClass): verbose_logger.debug(f"\033[92m{curl_command}\033[0m\n") def _get_request_body(self, data: dict) -> str: - return str(data) + return json.dumps(data) def _get_request_curl_command( self, api_base: str, headers: Optional[dict], additional_args: dict, data: dict