{"record":{"id":"5475c52cbd79d4b3","repo":"BerriAI/litellm","slug":"missing-reducto-api-key-set-it-in-the-environmen","errorCode":null,"errorMessage":"Missing REDUCTO_API_KEY - set it in the environment or pass api_key to litellm.ocr()/litellm.aocr()","messagePattern":"Missing REDUCTO_API_KEY - set it in the environment or pass api_key to litellm\\.ocr\\(\\)/litellm\\.aocr\\(\\)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/reducto/ocr/transformation.py","lineNumber":48,"sourceCode":"        for param, value in non_default_params.items():\n            if param in supported_params:\n                mapped_params[param] = value\n        return mapped_params\n\n    def validate_environment(\n        self,\n        headers: dict,\n        model: str,\n        api_key: str | None = None,\n        api_base: str | None = None,\n        litellm_params: dict | None = None,\n        **kwargs,\n    ) -> dict:\n        from litellm.secret_managers.main import get_secret_str\n\n        resolved_key: Final = api_key or get_secret_str(\"REDUCTO_API_KEY\")\n        if resolved_key is None:\n            raise ValueError(\n                \"Missing REDUCTO_API_KEY - set it in the environment or pass api_key to litellm.ocr()/litellm.aocr()\"\n            )\n\n        return {\n            \"Authorization\": f\"Bearer {resolved_key}\",\n            \"Content-Type\": \"application/json\",\n            **headers,\n        }\n\n    def get_complete_url(\n        self,\n        api_base: str | None,\n        model: str,\n        optional_params: dict,\n        litellm_params: dict | None = None,\n        **kwargs,\n    ) -> str:\n        return \"{}/parse\".format((api_base or REDUCTO_API_BASE).rstrip(\"/\"))","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/reducto/ocr/transformation.py#L30-L66","documentation":"Credential guard in the Reducto OCR config's validate_environment: neither the api_key argument nor the REDUCTO_API_KEY secret resolved, so the Bearer header cannot be built and the OCR request is rejected upfront.","triggerScenarios":"Triggered when calling litellm.ocr()/aocr() with the Reducto provider without REDUCTO_API_KEY set or api_key passed.","commonSituations":"See trigger scenarios.","solutions":["Set the REDUCTO_API_KEY environment variable.","Or pass api_key to litellm.ocr()/litellm.aocr()."],"exampleFix":"litellm.aocr(model=\"reducto/...\", 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-14T11:17:12.474Z"}