{"record":{"id":"6e4ddb8da13e6e9a","repo":"BerriAI/litellm","slug":"api-base-is-required-6e4ddb","errorCode":null,"errorMessage":"api_base is required","messagePattern":"api_base is required","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/base_llm/vector_store/transformation.py","lineNumber":124,"sourceCode":"    @abstractmethod\n    def validate_environment(self, headers: dict, litellm_params: GenericLiteLLMParams | None) -> dict:\n        return {}\n\n    @abstractmethod\n    def get_complete_url(\n        self,\n        api_base: str | None,\n        litellm_params: dict,\n    ) -> str:\n        \"\"\"\n        OPTIONAL\n\n        Get the complete url for the request\n\n        Some providers need `model` in `api_base`\n        \"\"\"\n        if api_base is None:\n            raise ValueError(\"api_base is required\")\n        return api_base\n\n    def get_error_class(self, error_message: str, status_code: int, headers: dict | httpx.Headers) -> BaseLLMException:\n        from ..chat.transformation import BaseLLMException\n\n        raise BaseLLMException(\n            status_code=status_code,\n            message=error_message,\n            headers=headers,\n        )\n\n    def sign_request(\n        self,\n        headers: dict,\n        optional_params: dict,\n        request_data: dict,\n        api_base: str,\n        api_key: str | None = None,","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/base_llm/vector_store/transformation.py#L106-L142","documentation":"BaseVectorStoreConfig.get_complete_url() is marked OPTIONAL for providers that need model names embedded in the URL, but the default implementation still guards its input: it returns api_base unchanged, and raises ValueError('api_base is required') when api_base is None (which would otherwise flow into the HTTP client and fail confusingly). The value comes from litellm_params.api_base, provider defaults, or env vars.","triggerScenarios":"Calling litellm vector-store CRUD (create/get/list vector stores) when no api_base can be resolved — custom vector-store provider without a configured base, missing <PROVIDER>_API_BASE env var, or a proxy config that omits api_base for the vector-store LLM-deployment entry.","commonSituations":"Wiring litellm to a self-hosted vector-store service and forgetting api_base; adding a new provider to the config.yaml without the api_base field; CI environments missing env vars set locally.","solutions":["Pass api_base in the vector-store call or litellm_params (api_base='http://vectordb.internal:8080').","Set the provider's base env var (e.g. export VECTOR_STORE_API_BASE=...) or add api_base to the provider entry in litellm's config.","For a custom vector-store config, override get_complete_url to supply the provider's default endpoint."],"exampleFix":"# before\nlitellm.acreate_vector_store(provider=\"myvdb\", create_request=req)  # ValueError\n\n# after\nlitellm.acreate_vector_store(\n    provider=\"myvdb\", create_request=req,\n    litellm_params={\"api_base\": \"http://vectordb.internal:8080\"},\n)","handlingStrategy":"validation","validationCode":"vs_base = litellm_params.get(\"api_base\") or os.getenv(\"MYVDB_API_BASE\")\nif not vs_base:\n    raise ValueError(\"vector store provider requires api_base\")","typeGuard":null,"tryCatchPattern":"try:\n    store = await litellm.acreate_vector_store(provider=\"myvdb\", create_request=req, litellm_params=params)\nexcept ValueError as e:\n    if \"api_base is required\" in str(e):\n        raise RuntimeError(\"vector-store api_base missing in config\") from None\n    raise","preventionTips":["Define vector-store provider config (api_base + api_key) in one place and validate on startup.","Include vector-store settings in deployment checklists; they are separate from chat-model settings."],"tags":["vector-store","configuration","api-base","value-error","litellm"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}