diff --git a/litellm/llms/openai/chat/gpt_5_transformation.py b/litellm/llms/openai/chat/gpt_5_transformation.py index d0e5ff01e71..c8504b54b19 100644 --- a/litellm/llms/openai/chat/gpt_5_transformation.py +++ b/litellm/llms/openai/chat/gpt_5_transformation.py @@ -311,6 +311,20 @@ class OpenAIGPT5Config(OpenAIGPTConfig): message=(f"reasoning_effort={effective_effort} is not supported for this model."), status_code=400, ) + elif effective_effort == "none": + # none is opt-out: unknown models pass through; only block when + # the model map explicitly sets supports_none_reasoning_effort=false. + # gpt-5 and gpt-5-mini are both marked supports_none_reasoning_effort=false + # and OpenAI returns 400 for none on those models. + if self._is_reasoning_effort_level_explicitly_disabled(model, effective_effort): + if litellm.drop_params or drop_params: + non_default_params.pop("reasoning_effort", None) + optional_params.pop("reasoning_effort", None) + else: + raise litellm.utils.UnsupportedParamsError( + message=(f"reasoning_effort={effective_effort} is not supported for this model."), + status_code=400, + ) ################################################################ # max_tokens is not supported for gpt-5 models on OpenAI API