{"record":{"id":"d6a07d74eee62029","repo":"BerriAI/litellm","slug":"ragflow-api-key-is-required-set-env-var-or-pass-i","errorCode":null,"errorMessage":"RAGFLOW_API_KEY is required (set env var or pass in litellm_params)","messagePattern":"RAGFLOW_API_KEY is required \\(set env var or pass in litellm_params\\)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/ragflow/vector_stores/transformation.py","lineNumber":53,"sourceCode":"            \"headers\": {\n                \"Authorization\": f\"Bearer {api_key}\",\n            },\n        }\n\n    def get_vector_store_endpoints_by_type(self) -> VectorStoreIndexEndpoints:\n        \"\"\"RAGFlow vector stores are management-only, no search support.\"\"\"\n        return {\n            \"read\": [],\n            \"write\": [],\n        }\n\n    def validate_environment(self, headers: dict, litellm_params: GenericLiteLLMParams | None) -> dict:\n        \"\"\"Validate environment and set headers for RAGFlow API.\"\"\"\n        litellm_params = litellm_params or GenericLiteLLMParams()\n        api_key: Final = litellm_params.api_key or get_secret_str(\"RAGFLOW_API_KEY\")\n\n        if api_key is None:\n            raise ValueError(\"RAGFLOW_API_KEY is required (set env var or pass in litellm_params)\")\n\n        headers.update(\n            {\n                \"Authorization\": f\"Bearer {api_key}\",\n                \"Content-Type\": \"application/json\",\n            }\n        )\n        return headers\n\n    def get_complete_url(\n        self,\n        api_base: str | None,\n        litellm_params: dict,\n    ) -> str:\n        \"\"\"\n        Get the complete URL for RAGFlow datasets API.\n\n        Supports:","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/ragflow/vector_stores/transformation.py#L35-L71","documentation":"Credential guard in the RAGFlow vector-store validate_environment: the API key resolution (params and env) failed at validation time, so request headers would carry no Authorization and the call is rejected upfront.","triggerScenarios":"Triggered when calling RAGFlow vector stores without an API key: RAGFLOW_API_KEY env var unset and no key in litellm_params.","commonSituations":"See trigger scenarios.","solutions":["Set the RAGFLOW_API_KEY environment variable.","Or pass api_key in litellm_params."],"exampleFix":"litellm.vector_stores.create(..., api_key=\"ragflow-<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"}