BerriAI/litellm · error · ValueError
api_base is required
Error message
api_base is required
What it means
The abstract containers transformation's default get_complete_url requires an api_base: container operations (create/manage provider containers) must hit a concrete endpoint, and unlike chat there is no default host. None is rejected with a plain ValueError.
Source
Thrown at litellm/llms/base_llm/containers/transformation.py:97
self,
headers: dict,
api_key: str | None = None,
) -> dict:
return {}
@abstractmethod
def get_complete_url(
self,
api_base: str | None,
litellm_params: dict,
) -> str:
"""Get the complete url for the request.
OPTIONAL - Some providers need `model` in `api_base`.
"""
if api_base is None:
msg: Final = "api_base is required"
raise ValueError(msg)
return api_base
@abstractmethod
def transform_container_create_request(
self,
name: str,
container_create_optional_request_params: dict,
litellm_params: GenericLiteLLMParams,
headers: dict,
) -> dict:
"""Transform the container creation request.
Returns:
dict: Request data for container creation.
"""
...
@abstractmethodView on GitHub (pinned to 6c2dcb801b)
Solutions
- Pass api_base for the container operation in litellm_params
- If writing a custom provider container config, override get_complete_url to construct the full URL from your provider's env vars
- Check the provider's container docs for the expected endpoint shape and set it explicitly
Example fix
# before
litellm_params={'api_key': k}
container_client.create_container(name='docs', litellm_params=litellm_params)
# after
litellm_params={'api_key': k, 'api_base': 'https://my-resource.example.com/api'}
container_client.create_container(name='docs', litellm_params=litellm_params) Defensive patterns
Strategy: validation
Validate before calling
if not litellm_params.get('api_base'):
raise ValueError('Container operations require api_base in litellm_params') Prevention
- When adding a custom container provider, override get_complete_url rather than relying on the default
- Validate container configs at startup alongside vector-store configs
When it happens
Trigger: Invoking the containers API (e.g. litellm container create/delete via a provider whose config does not override this method) without api_base in litellm_params or the call.
Common situations: New/experimental container integrations where the config class relies on the default; proxy vector-store/container config missing the endpoint; assuming the endpoint is derived from api_key or provider name.
Related errors
- api_base is required
- Missing Azure AI API Base - Set AZURE_AI_API_BASE environmen
- Azure AI API Base is required. api_base=None. Set in call or
- Azure AI API Base must be an absolute URL including scheme (
- NVIDIA Riva requires `api_base` (host:port for the gRPC endp
AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15).
Data as JSON: /api/errors/37249012fe3b206a.
Report an issue: GitHub.