{"record":{"id":"11fe801ec6fc566c","repo":"BerriAI/litellm","slug":"missing-azure-api-base-please-set-api-base-or","errorCode":null,"errorMessage":"Missing Azure API Base - Please set `api_base` or `AZURE_API_BASE` environment variable. Expected format: https://<resource-name>.services.ai.azure.com/anthropic","messagePattern":"Missing Azure API Base - Please set `api_base` or `AZURE_API_BASE` environment variable\\. Expected format: https://<resource-name>\\.services\\.ai\\.azure\\.com/anthropic","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/azure_ai/anthropic/messages_transformation.py","lineNumber":92,"sourceCode":"\n    def get_complete_url(\n        self,\n        api_base: str | None,\n        api_key: str | None,\n        model: str,\n        optional_params: dict,\n        litellm_params: dict,\n        stream: bool | None = None,\n    ) -> str:\n        \"\"\"\n        Get the complete URL for Azure Anthropic /v1/messages endpoint.\n        Azure Foundry endpoint format: https://<resource-name>.services.ai.azure.com/anthropic/v1/messages\n        \"\"\"\n        from litellm.secret_managers.main import get_secret_str\n\n        api_base = api_base or get_secret_str(\"AZURE_API_BASE\")\n        if api_base is None:\n            raise ValueError(\n                \"Missing Azure API Base - Please set `api_base` or `AZURE_API_BASE` environment variable. \"\n                \"Expected format: https://<resource-name>.services.ai.azure.com/anthropic\"\n            )\n\n        # Ensure the URL ends with /v1/messages\n        api_base = api_base.rstrip(\"/\")\n        if api_base.endswith(\"/v1/messages\") or api_base.endswith(\"/anthropic/v1/messages\"):\n            # Already correct\n            pass\n        else:\n            # Check if /anthropic is already in the path\n            if \"/anthropic\" in api_base:\n                # /anthropic exists, ensure we end with /anthropic/v1/messages\n                # Extract the base URL up to and including /anthropic\n                parts: Final = api_base.split(\"/anthropic\", 1)\n                api_base = parts[0] + \"/anthropic\"\n            else:\n                # /anthropic not in path, add it","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/azure_ai/anthropic/messages_transformation.py#L74-L110","documentation":"Error \"Missing Azure API Base - Please set `api_base` or `AZURE_API_BASE` environment variable. Expected format: https://<resource-name>.services.ai.azure.com/anthropic\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/azure_ai/anthropic/messages_transformation.py:92 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set api_base or AZURE_API_BASE to https://<resource-name>.services.ai.azure.com/anthropic."],"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"}