From 025438cffdabf00c67eb2f5b8d94bda3629ca378 Mon Sep 17 00:00:00 2001 From: Stephen Chin <1290231+steveonjava@users.noreply.github.com> Date: Thu, 20 Aug 2026 05:49:21 -0700 Subject: [PATCH] fix(chatgpt): forward prompt cache key --- litellm/llms/chatgpt/responses/transformation.py | 1 + .../chatgpt/responses/test_chatgpt_responses_transformation.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/litellm/llms/chatgpt/responses/transformation.py b/litellm/llms/chatgpt/responses/transformation.py index 8e4bbf1d3c9..da4c5598d80 100644 --- a/litellm/llms/chatgpt/responses/transformation.py +++ b/litellm/llms/chatgpt/responses/transformation.py @@ -97,6 +97,7 @@ class ChatGPTResponsesAPIConfig(OpenAIResponsesAPIConfig): "tools", "tool_choice", "reasoning", + "prompt_cache_key", "previous_response_id", "truncation", } diff --git a/tests/test_litellm/llms/chatgpt/responses/test_chatgpt_responses_transformation.py b/tests/test_litellm/llms/chatgpt/responses/test_chatgpt_responses_transformation.py index 90a1c24bada..efced02dbaf 100644 --- a/tests/test_litellm/llms/chatgpt/responses/test_chatgpt_responses_transformation.py +++ b/tests/test_litellm/llms/chatgpt/responses/test_chatgpt_responses_transformation.py @@ -131,6 +131,7 @@ class TestChatGPTResponsesAPITransformation: "max_output_tokens": 123, "stream_options": {"include_usage": True}, # supported and should be preserved + "prompt_cache_key": "session_123", "truncation": "auto", "previous_response_id": "resp_123", "reasoning": {"effort": "medium"}, @@ -149,6 +150,7 @@ class TestChatGPTResponsesAPITransformation: assert "max_output_tokens" not in request assert "stream_options" not in request + assert request["prompt_cache_key"] == "session_123" assert request["truncation"] == "auto" assert request["previous_response_id"] == "resp_123" assert request["reasoning"] == {"effort": "medium"}