{"record":{"id":"da90f5d56dd8959d","repo":"BerriAI/litellm","slug":"missing-azure-document-intelligence-api-key-set","errorCode":null,"errorMessage":"Missing Azure Document Intelligence API Key - Set AZURE_DOCUMENT_INTELLIGENCE_API_KEY environment variable or pass api_key parameter","messagePattern":"Missing Azure Document Intelligence API Key - Set AZURE_DOCUMENT_INTELLIGENCE_API_KEY environment variable or pass api_key parameter","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/azure_ai/ocr/document_intelligence/transformation.py","lineNumber":224,"sourceCode":"        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        \"\"\"\n        Validate environment and return headers for Azure Document Intelligence.\n\n        Authentication uses Ocp-Apim-Subscription-Key header.\n        \"\"\"\n        # Get API key from environment if not provided\n        if api_key is None:\n            api_key = get_secret_str(AZURE_DOCUMENT_INTELLIGENCE_API_KEY_ENV_VAR)\n\n        if api_key is None:\n            raise ValueError(\n                \"Missing Azure Document Intelligence API Key - Set AZURE_DOCUMENT_INTELLIGENCE_API_KEY environment variable or pass api_key parameter\"\n            )\n\n        # Validate API base/endpoint is provided\n        if api_base is None:\n            api_base = get_secret_str(\"AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT\")\n\n        if api_base is None:\n            raise ValueError(\n                \"Missing Azure Document Intelligence Endpoint - Set AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT environment variable or pass api_base parameter\"\n            )\n\n        headers = {\n            \"Ocp-Apim-Subscription-Key\": api_key,\n            \"Content-Type\": \"application/json\",\n            **headers,\n        }\n","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/azure_ai/ocr/document_intelligence/transformation.py#L206-L242","documentation":"Error \"Missing Azure Document Intelligence API Key - Set AZURE_DOCUMENT_INTELLIGENCE_API_KEY environment variable or pass api_key parameter\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/azure_ai/ocr/document_intelligence/transformation.py:224 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set AZURE_DOCUMENT_INTELLIGENCE_API_KEY or pass api_key."],"exampleFix":null,"handlingStrategy":null,"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-23T08:17:48.524Z"}