{"record":{"id":"ad8173ffba50abe9","repo":"BerriAI/litellm","slug":"azure-ai-api-base-must-be-an-absolute-url-includin","errorCode":null,"errorMessage":"Azure AI API Base must be an absolute URL including scheme (e.g. 'https://<resource>.services.ai.azure.com'). Got api_base={api_base!r}.","messagePattern":"Azure AI API Base must be an absolute URL including scheme \\(e\\.g\\. 'https://<resource>\\.services\\.ai\\.azure\\.com'\\)\\. Got api_base=(.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/azure_ai/rerank/transformation.py","lineNumber":34,"sourceCode":"\nclass AzureAIRerankConfig(CohereRerankConfig):\n    \"\"\"\n    Azure AI Rerank - Follows the same Spec as Cohere Rerank\n    \"\"\"\n\n    def get_complete_url(\n        self,\n        api_base: str | None,\n        model: str,\n        optional_params: dict | None = None,\n    ) -> str:\n        if api_base is None:\n            raise ValueError(\n                \"Azure AI API Base is required. api_base=None. Set in call or via `AZURE_AI_API_BASE` env var.\"\n            )\n        original_url: Final = httpx.URL(api_base)\n        if not original_url.is_absolute_url:\n            raise ValueError(\n                \"Azure AI API Base must be an absolute URL including scheme (e.g. \"\n                \"'https://<resource>.services.ai.azure.com'). \"\n                f\"Got api_base={api_base!r}.\"\n            )\n        normalized_path: Final = original_url.path.rstrip(\"/\")\n\n        # Allow callers to pass either full v1/v2 rerank endpoints:\n        # - https://<resource>.services.ai.azure.com/v1/rerank\n        # - https://<resource>.services.ai.azure.com/providers/cohere/v2/rerank\n        if normalized_path.endswith(\"/v1/rerank\") or normalized_path.endswith(\"/v2/rerank\"):\n            return str(original_url.copy_with(path=normalized_path or \"/\"))\n\n        # If callers pass just the version path (e.g. \".../v2\" or \".../providers/cohere/v2\"), append \"/rerank\"\n        if (\n            normalized_path.endswith(\"/v1\")\n            or normalized_path.endswith(\"/v2\")\n            or normalized_path.endswith(\"/providers/cohere/v2\")\n        ):","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/azure_ai/rerank/transformation.py#L16-L52","documentation":"Error \"Azure AI API Base must be an absolute URL including scheme (e.g. 'https://<resource>.services.ai.azure.com'). Got api_base={api_base!r}.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/azure_ai/rerank/transformation.py:34 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use an absolute https URL for api_base, e.g. 'https://<resource>.services.ai.azure.com'."],"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"}