From 11b339496c1242a471d0a0c8db8824c1d9135f1d Mon Sep 17 00:00:00 2001 From: rupak-eng Date: Mon, 22 Jun 2026 01:25:49 +0530 Subject: [PATCH] fix(anthropic): extract api_base from litellm_params in batches/files validate_environment --- litellm/llms/anthropic/batches/transformation.py | 2 ++ litellm/llms/anthropic/files/transformation.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/litellm/llms/anthropic/batches/transformation.py b/litellm/llms/anthropic/batches/transformation.py index 0886313d7ce..7c4e9386d5f 100644 --- a/litellm/llms/anthropic/batches/transformation.py +++ b/litellm/llms/anthropic/batches/transformation.py @@ -43,6 +43,8 @@ class AnthropicBatchesConfig(BaseBatchesConfig): api_base: Optional[str] = None, ) -> dict: """Validate and prepare environment-specific headers and parameters.""" + if api_base is None and isinstance(litellm_params, dict): + api_base = litellm_params.get("api_base") auth_header = self.anthropic_model_info.get_auth_header(api_key, api_base) if auth_header is None: raise ValueError( diff --git a/litellm/llms/anthropic/files/transformation.py b/litellm/llms/anthropic/files/transformation.py index c125f934875..7ffb6beb4c7 100644 --- a/litellm/llms/anthropic/files/transformation.py +++ b/litellm/llms/anthropic/files/transformation.py @@ -95,6 +95,8 @@ class AnthropicFilesConfig(BaseFilesConfig): api_key: Optional[str] = None, api_base: Optional[str] = None, ) -> dict: + if api_base is None and isinstance(litellm_params, dict): + api_base = litellm_params.get("api_base") auth_header = AnthropicModelInfo.get_auth_header(api_key, api_base) if auth_header is None: raise ValueError(