BerriAI/litellm · error · AnthropicError

Invalid reasoning_effort

Error message

Invalid reasoning_effort: {reasoning_effort!r}. Must be one of: 'minimal', 'low', 'medium', 'high', 'xhigh', 'max', 'none'

What it means

Error "Invalid reasoning_effort: {reasoning_effort!r}. Must be one of: 'minimal', 'low', 'medium', 'high', 'xhigh', 'max', 'none'" thrown in BerriAI/litellm.

Solutions

  1. Use one of the listed values for reasoning_effort: 'minimal', 'low', 'medium', 'high', 'xhigh', 'max', 'none'.

When it happens

Trigger: Thrown at litellm/llms/anthropic/experimental_pass_through/messages/transformation.py:296 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/8b3655d55bf83ed1. Report an issue: GitHub.

Appendix: source

Thrown at litellm/llms/anthropic/experimental_pass_through/messages/transformation.py:296

        try:
            mapped_thinking: Final = AnthropicConfig._map_reasoning_effort(
                reasoning_effort=reasoning_effort,
                model=model,
                custom_llm_provider=custom_llm_provider,
            )
        except _BadRequestError as e:
            raise AnthropicError(message=str(e.message), status_code=400)

        if mapped_thinking is None:
            optional_params.pop("thinking", None)
            optional_params.pop("output_config", None)
            return

        optional_params.setdefault("thinking", mapped_thinking)
        if AnthropicModelInfo._is_adaptive_thinking_model(model, custom_llm_provider):
            mapped_effort: Final = REASONING_EFFORT_TO_OUTPUT_CONFIG_EFFORT.get(reasoning_effort)
            if mapped_effort is None:
                raise AnthropicError(
                    message=(
                        f"Invalid reasoning_effort: {reasoning_effort!r}. "
                        f"Must be one of: 'minimal', 'low', 'medium', 'high', "
                        f"'xhigh', 'max', 'none'"
                    ),
                    status_code=400,
                )
            gate_error: Final = AnthropicConfig._validate_effort_for_model(model, mapped_effort, custom_llm_provider)
            if gate_error is not None:
                raise AnthropicError(message=gate_error, status_code=400)
            existing_output_config = optional_params.get("output_config")
            if not isinstance(existing_output_config, dict):
                existing_output_config = {}
            existing_output_config.setdefault("effort", mapped_effort)
            optional_params["output_config"] = existing_output_config

    @staticmethod
    def _translate_legacy_thinking_for_adaptive_model(

View on GitHub (pinned to 77b7c6c40c)