{"record":{"id":"5728e3fa97df282c","repo":"BerriAI/litellm","slug":"custom-llm-provider-is-required-for-anthropic-mess","errorCode":null,"errorMessage":"custom_llm_provider is required for Anthropic messages, passed in model={model}, custom_llm_provider={custom_llm_provider}","messagePattern":"custom_llm_provider is required for Anthropic messages, passed in model=(.+?), custom_llm_provider=(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/anthropic/experimental_pass_through/messages/handler.py","lineNumber":566,"sourceCode":"            api_key=api_key,\n            api_base=api_base,\n            client=client,\n            custom_llm_provider=custom_llm_provider,\n            **kwargs,\n        )\n        if _should_route_to_responses_api(custom_llm_provider):\n            return LiteLLMMessagesToResponsesAPIHandler.anthropic_messages_handler(**_shared_kwargs)\n\n        # The in-gateway context_management polyfill runs inside\n        # ``async_anthropic_messages_handler`` so it can ``await`` the\n        # summarization model for ``compact_20260112``. ``context_management``\n        # is passed through as a regular kwarg.\n        return LiteLLMMessagesToCompletionTransformationHandler.anthropic_messages_handler(\n            **_shared_kwargs,\n        )\n\n    if custom_llm_provider is None:\n        raise ValueError(\n            f\"custom_llm_provider is required for Anthropic messages, passed in model={model}, custom_llm_provider={custom_llm_provider}\"\n        )\n\n    local_vars.update(kwargs)\n    anthropic_messages_optional_request_params: Final = (\n        AnthropicMessagesRequestUtils.get_requested_anthropic_messages_optional_param(\n            params=local_vars,\n            model=model,\n            drop_params=litellm_params.get(\"drop_params\") is True,\n            custom_llm_provider=custom_llm_provider,\n        )\n    )\n    if is_reasoning_auto_summary_enabled():\n        thinking_param: Final = anthropic_messages_optional_request_params.get(\"thinking\")\n        if isinstance(thinking_param, dict) and thinking_param.get(\"type\") != \"disabled\":\n            anthropic_messages_optional_request_params[\"thinking\"] = {\n                **thinking_param,\n                \"display\": \"summarized\",","sourceCodeStart":548,"sourceCodeEnd":584,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/anthropic/experimental_pass_through/messages/handler.py#L548-L584","documentation":"Error \"custom_llm_provider is required for Anthropic messages, passed in model={model}, custom_llm_provider={custom_llm_provider}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/anthropic/experimental_pass_through/messages/handler.py:566 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Prefix the model with the provider (e.g. 'anthropic/claude-...') or pass custom_llm_provider explicitly."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}