{"record":{"id":"b5f013d4946a06b5","repo":"BerriAI/litellm","slug":"missing-predibase-api-key-a-call-is-being-made-t","errorCode":null,"errorMessage":"Missing Predibase API Key - A call is being made to predibase but no key is set either in the environment variables or via params","messagePattern":"Missing Predibase API Key - A call is being made to predibase but no key is set either in the environment variables or via params","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/predibase/chat/transformation.py","lineNumber":347,"sourceCode":"        else:\n            completion_url += \"/generate\"\n        return completion_url\n\n    def get_error_class(self, error_message: str, status_code: int, headers: dict | Headers) -> BaseLLMException:\n        return PredibaseError(status_code=status_code, message=error_message, headers=headers)\n\n    def validate_environment(\n        self,\n        headers: dict,\n        model: str,\n        messages: list[AllMessageValues],\n        optional_params: dict,\n        litellm_params: dict,\n        api_key: str | None = None,\n        api_base: str | None = None,\n    ) -> dict:\n        if api_key is None:\n            raise ValueError(\n                \"Missing Predibase API Key - A call is being made to predibase but no key is set either in the environment variables or via params\"\n            )\n\n        default_headers: Final = {\n            \"content-type\": \"application/json\",\n            \"Authorization\": f\"Bearer {api_key}\",\n        }\n        if headers is not None and isinstance(headers, dict):\n            headers = {**default_headers, **headers}\n        return headers\n","sourceCodeStart":329,"sourceCodeEnd":358,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/predibase/chat/transformation.py#L329-L358","documentation":"Credential guard in the Predibase validate_environment: api_key is None and no Predibase key could be found in environment variables, so the Authorization header cannot be built and the request is rejected before sending.","triggerScenarios":"Triggered when making a Predibase request without an API key set in environment variables or passed via params.","commonSituations":"See trigger scenarios.","solutions":["Set the PREDIBASE_API_KEY environment variable.","Or pass api_key in the call params."],"exampleFix":"os.environ[\"PREDIBASE_API_KEY\"] = \"<key>\"","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}