{"record":{"id":"522371c603a5150d","repo":"BerriAI/litellm","slug":"api-base-is-required-522371","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/videos/transformation.py","lineNumber":91,"sourceCode":"    ) -> dict:\n        return {}\n\n    @abstractmethod\n    def get_complete_url(\n        self,\n        model: str,\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    @abstractmethod\n    def transform_video_create_request(\n        self,\n        model: str,\n        prompt: str,\n        api_base: str,\n        video_create_optional_request_params: dict,\n        litellm_params: GenericLiteLLMParams,\n        headers: dict,\n    ) -> tuple[dict, RequestFiles, str]:\n        pass\n\n    @abstractmethod\n    def transform_video_create_response(\n        self,\n        model: str,","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/base_llm/videos/transformation.py#L73-L109","documentation":"BaseVideosConfig.get_complete_url() is optional (some providers need the model embedded in the URL); the default returns api_base unchanged but raises ValueError('api_base is required') when api_base is None, failing fast instead of letting 'None' leak into the video-generation HTTP request.","triggerScenarios":"Calling litellm's video generation API (avideo_generate / video create) when no api_base resolves — custom or self-hosted video provider without a configured base URL or env var.","commonSituations":"Using self-hosted video models behind a gateway without setting api_base; provider env var missing in the deployed environment; config entry for a video model missing the api_base field.","solutions":["Pass api_base in the video call's litellm_params (api_base='http://video.internal:8000').","Set the provider's base env var or add api_base to the video provider's entry in litellm config.","In a custom videos config, override get_complete_url to inject the provider default endpoint."],"exampleFix":"# before\nresp = await litellm.avideo_generate(model=\"myvid/model-a\", prompt=\"sunset\")  # ValueError\n\n# after\nresp = await litellm.avideo_generate(\n    model=\"myvid/model-a\", prompt=\"sunset\",\n    api_base=\"http://video.internal:8000/v1\",\n)","handlingStrategy":"validation","validationCode":"video_base = kwargs.get(\"api_base\") or os.getenv(\"MYVID_API_BASE\")\nif video_base is None:\n    raise ValueError(\"video generation requires api_base for this provider\")","typeGuard":null,"tryCatchPattern":"try:\n    job = await litellm.avideo_generate(model=m, prompt=p, api_base=base)\nexcept ValueError as e:\n    if \"api_base is required\" in str(e):\n        base = os.environ[\"MYVID_API_BASE\"]\n        job = await litellm.avideo_generate(model=m, prompt=p, api_base=base)\n    else:\n        raise","preventionTips":["Store self-hosted video provider endpoints in central config; don't rely on defaults that don't exist.","Validate video provider config in deployment smoke tests."],"tags":["video-generation","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"}