The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
feat(openai): Add support for reasoning_effort='none' in GPT-5.1 (#16658)
Cesar Garcia65061bafc7dd
diff --git a/docs/my-website/docs/providers/openai.md b/docs/my-website/docs/providers/openai.mdindex 51ebc881d22..e288f511558 100644--- a/docs/my-website/docs/providers/openai.md+++ b/docs/my-website/docs/providers/openai.md@@ -412,7 +412,7 @@ Expected Response:### Advanced: Using `reasoning_effort` with `summary` field-By default, `reasoning_effort` accepts a string value (`"low"`, `"medium"`, `"high"`, `"minimal"`) and only sets the effort level without including a reasoning summary.+By default, `reasoning_effort` accepts a string value (`"none"`, `"minimal"`, `"low"`, `"medium"`, `"high"`) and only sets the effort level without including a reasoning summary.To opt-in to the `summary` feature, you can pass `reasoning_effort` as a dictionary. **Note:** The `summary` field requires your OpenAI organization to have verification status. Using `summary` without verification will result in a 400 error from OpenAI.@@ -472,12 +472,17 @@ curl -X POST 'http://0.0.0.0:4000/chat/completions' \| Model | Default (when not set) | Supported Values ||-------|----------------------|------------------|+| `gpt-5.1` | `none` | `none`, `low`, `medium`, `high` || `gpt-5` | `medium` | `minimal`, `low`, `medium`, `high` |-| `gpt-5-mini` | `medium` | `minimal`, `low`, `medium`, `high` |+| `gpt-5-mini` | `medium` | `none`, `minimal`, `low`, `medium`, `high` |+| `gpt-5-nano` | `none` | `none`, `low`, `medium`, `high` || `gpt-5-codex` | `adaptive` | `low`, `medium`, `high` (no `minimal`) || `gpt-5-pro` | `high` | `high` only |-**Note:** `gpt-5-pro` only accepts `reasoning_effort="high"`. Other values will return an error. When `reasoning_effort` is not set (None), OpenAI defaults to the value shown in the "Default" column.+**Note:**+- GPT-5.1 introduced a new `reasoning_effort="none"` setting for faster, lower-latency responses. This replaces the `"minimal"` setting from GPT-5.+- `gpt-5-pro` only accepts `reasoning_effort="high"`. Other values will return an error.+- When `reasoning_effort` is not set (None), OpenAI defaults to the value shown in the "Default" column.See [OpenAI Reasoning documentation](https://platform.openai.com/docs/guides/reasoning) for more details on organization verification requirements.diff --git a/litellm/completion_extras/litellm_responses_transformation/transformation.py b/litellm/completion_extras/litellm_responses_transformation/transformation.pyindex 3ba75666b81..a64661da33d 100644--- a/litellm/completion_extras/litellm_responses_transformation/transformation.py+++ b/litellm/completion_extras/litellm_responses_transformation/transformation.py@@ -544,7 +544,9 @@ class LiteLLMResponsesTransformationHandler(CompletionTransformationBridge):return Reasoning(**reasoning_effort) # type: ignore[typeddict-item]# If string is passed, map without summary (default)- if reasoning_effort == "high":+ if reasoning_effort == "none":+ return Reasoning(effort="none")+ elif reasoning_effort == "high":return Reasoning(effort="high")elif reasoning_effort == "medium":return Reasoning(effort="medium")diff --git a/litellm/types/llms/openai.py b/litellm/types/llms/openai.pyindex 7dab61b151f..fd2f9b9d9c8 100644--- a/litellm/types/llms/openai.py+++ b/litellm/types/llms/openai.py@@ -1475,7 +1475,7 @@ ResponsesAPIStreamingResponse = Annotated[]-REASONING_EFFORT = Literal["minimal", "low", "medium", "high"]+REASONING_EFFORT = Literal["none", "minimal", "low", "medium", "high"]class OpenAIRealtimeStreamSession(TypedDict, total=False):diff --git a/tests/test_litellm/llms/openai/test_gpt5_transformation.py b/tests/test_litellm/llms/openai/test_gpt5_transformation.pyindex 876eb8b29f9..42db678d1d2 100644--- a/tests/test_litellm/llms/openai/test_gpt5_transformation.py+++ b/tests/test_litellm/llms/openai/test_gpt5_transformation.py@@ -153,3 +153,33 @@ def test_gpt5_codex_supports_function_calling(config: OpenAIConfig):assert "functions" in supported_paramsassert "function_call" in supported_paramsassert "tools" in supported_params+++def test_gpt5_1_reasoning_effort_none(config: OpenAIConfig):+ """Test that GPT-5.1 supports reasoning_effort='none' parameter.++ Related issue: https://github.com/BerriAI/litellm/issues/16633+ GPT-5.1 introduced 'none' as the new default reasoning effort setting+ for faster, lower-latency responses.+ """+ # Test that reasoning_effort is a supported parameter+ assert "reasoning_effort" in config.get_supported_openai_params(model="gpt-5.1")++ # Test that reasoning_effort="none" passes through correctly+ params = config.map_openai_params(+ non_default_params={"reasoning_effort": "none"},+ optional_params={},+ model="gpt-5.1",+ drop_params=False,+ )+ assert params["reasoning_effort"] == "none"++ # Test with other valid values for GPT-5.1+ for effort in ["low", "medium", "high"]:+ params = config.map_openai_params(+ non_default_params={"reasoning_effort": effort},+ optional_params={},+ model="gpt-5.1",+ drop_params=False,+ )+ assert params["reasoning_effort"] == effort