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(