{"record":{"id":"8459c79d173e7fb7","repo":"BerriAI/litellm","slug":"missing-azure-ai-api-base-set-azure-ai-api-base","errorCode":null,"errorMessage":"Missing Azure AI API Base - Set AZURE_AI_API_BASE environment variable or pass api_base parameter","messagePattern":"Missing Azure AI API Base - Set AZURE_AI_API_BASE environment variable or pass api_base parameter","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/azure_ai/ocr/transformation.py","lineNumber":66,"sourceCode":"        Validate environment and return headers for Azure AI OCR.\n\n        Azure AI uses Bearer token authentication with AZURE_AI_API_KEY.\n        \"\"\"\n        # Get API key from environment if not provided\n        if api_key is None:\n            api_key = get_secret_str(AZURE_AI_OCR_API_KEY_ENV_VAR)\n\n        if api_key is None:\n            raise ValueError(\n                \"Missing Azure AI API Key - A call is being made to Azure AI but no key is set either in the environment variables or via params\"\n            )\n\n        # Validate API base is provided\n        if api_base is None:\n            api_base = get_secret_str(\"AZURE_AI_API_BASE\")\n\n        if api_base is None:\n            raise ValueError(\n                \"Missing Azure AI API Base - Set AZURE_AI_API_BASE environment variable or pass api_base parameter\"\n            )\n\n        headers = {\n            \"Authorization\": f\"Bearer {api_key}\",\n            \"Content-Type\": \"application/json\",\n            **headers,\n        }\n\n        return headers\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,","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/azure_ai/ocr/transformation.py#L48-L84","documentation":"Error \"Missing Azure AI API Base - Set AZURE_AI_API_BASE environment variable or pass api_base parameter\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/azure_ai/ocr/transformation.py:66 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set AZURE_AI_API_BASE or pass api_base."],"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"}