{"record":{"id":"d7ef8efb576add58","repo":"BerriAI/litellm","slug":"api-base-is-required-unable-to-determine-the-corr","errorCode":null,"errorMessage":"api_base is required. Unable to determine the correct api_base for the request.","messagePattern":"api_base is required\\. Unable to determine the correct api_base for the request\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/experimental_pass_through/transformation.py","lineNumber":126,"sourceCode":"        if anthropic_model_info.is_tool_search_used(tools):\n            beta_values.add(get_tool_search_beta_header(\"vertex_ai\"))\n\n        if beta_values:\n            headers[\"anthropic-beta\"] = \",\".join(beta_values)\n\n        return headers, api_base\n\n    def get_complete_url(\n        self,\n        api_base: str | None,\n        api_key: str | None,\n        model: str,\n        optional_params: dict,\n        litellm_params: dict,\n        stream: bool | None = None,\n    ) -> str:\n        if api_base is None:\n            raise ValueError(\"api_base is required. Unable to determine the correct api_base for the request.\")\n        return api_base  # no transformation is needed - handled in validate_environment\n\n    def transform_anthropic_messages_request(\n        self,\n        model: str,\n        messages: list[dict],\n        anthropic_messages_optional_request_params: dict,\n        litellm_params: GenericLiteLLMParams,\n        headers: dict,\n    ) -> dict:\n        anthropic_messages_request: Final = super().transform_anthropic_messages_request(\n            model=model,\n            messages=messages,\n            anthropic_messages_optional_request_params=anthropic_messages_optional_request_params,\n            litellm_params=litellm_params,\n            headers=headers,\n        )\n","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/experimental_pass_through/transformation.py#L108-L144","documentation":"Raised in get_complete_url of the experimental Anthropic pass-through config: no api_base was resolved from params, litellm_params, or environment, so the Vertex/Anthropic endpoint URL cannot be constructed.","triggerScenarios":"Thrown at litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/experimental_pass_through/transformation.py:126 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass api_base explicitly for the Anthropic pass-through request.","Or set vertex_project and vertex_location so litellm can construct the Vertex regional endpoint automatically."],"exampleFix":null,"handlingStrategy":"validation","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-14T05:17:10.506Z"}