From 3c0a10f05aa796918bb92fdb031098a570139097 Mon Sep 17 00:00:00 2001 From: Alexsander Hamir Date: Tue, 10 Feb 2026 10:42:53 -0800 Subject: [PATCH] fix: prefix OpenAI model with 'responses/' when thinking is enabled - Add model prefixing to route OpenAI thinking requests to Responses API - Fixes test failure where model should be 'responses/gpt-5.2' instead of 'gpt-5.2' - Ensures OpenAI models with thinking parameter use Responses API for reasoning summary - Prevents double-prefixing with existing 'responses/' check --- .../anthropic/experimental_pass_through/adapters/handler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/litellm/llms/anthropic/experimental_pass_through/adapters/handler.py b/litellm/llms/anthropic/experimental_pass_through/adapters/handler.py index 296ae97aead..c6caaddf98b 100644 --- a/litellm/llms/anthropic/experimental_pass_through/adapters/handler.py +++ b/litellm/llms/anthropic/experimental_pass_through/adapters/handler.py @@ -64,7 +64,10 @@ class LiteLLMMessagesToCompletionTransformationHandler: model = completion_kwargs.get("model") if isinstance(model, str) and model and not model.startswith("responses/"): - reasoning_effort = completion_kwargs.get("reasoning_effort") + # Prefix model with "responses/" to route to OpenAI Responses API + completion_kwargs["model"] = f"responses/{model}" + + reasoning_effort = completion_kwargs.get("reasoning_effort") if isinstance(reasoning_effort, str) and reasoning_effort: completion_kwargs["reasoning_effort"] = { "effort": reasoning_effort,