{"record":{"id":"711dd91846edf6b9","repo":"BerriAI/litellm","slug":"api-base-is-required-for-azure-ava-tts-format-ht","errorCode":null,"errorMessage":"api_base is required for Azure AVA TTS. Format: https://{region}.api.cognitive.microsoft.com or https://{region}.tts.speech.microsoft.com","messagePattern":"api_base is required for Azure AVA TTS\\. Format: https://(.+?)\\.api\\.cognitive\\.microsoft\\.com or https://(.+?)\\.tts\\.speech\\.microsoft\\.com","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/azure/text_to_speech/transformation.py","lineNumber":325,"sourceCode":"        # User-Agent\n        validated_headers[\"User-Agent\"] = \"litellm\"\n\n        return validated_headers\n\n    def get_complete_url(\n        self,\n        model: str,\n        api_base: str | None,\n        litellm_params: dict,\n    ) -> str:\n        \"\"\"\n        Get the complete URL for Azure AVA TTS request\n\n        Azure TTS endpoint format:\n        https://{region}.tts.speech.microsoft.com/cognitiveservices/v1\n        \"\"\"\n        if api_base is None:\n            raise ValueError(\n                f\"api_base is required for Azure AVA TTS. \"\n                f\"Format: https://{{region}}.{self.COGNITIVE_SERVICES_DOMAIN} or \"\n                f\"https://{{region}}.{self.TTS_SPEECH_DOMAIN}\"\n            )\n\n        # Remove trailing slash and parse URL\n        api_base = api_base.rstrip(\"/\")\n        parsed_url: Final = urlparse(api_base)\n        hostname: Final = parsed_url.hostname or \"\"\n\n        # Check if it's a Cognitive Services endpoint (convert to TTS endpoint)\n        if self._is_cognitive_services_endpoint(hostname=hostname):\n            region: Final = self._extract_region_from_hostname(hostname=hostname, domain=self.COGNITIVE_SERVICES_DOMAIN)\n            return self._build_tts_url(region=region)\n\n        # Check if it's already a TTS endpoint\n        if self._is_tts_endpoint(hostname=hostname):\n            if not api_base.endswith(self.TTS_ENDPOINT_PATH):","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/azure/text_to_speech/transformation.py#L307-L343","documentation":"Error \"api_base is required for Azure AVA TTS. Format: https://{region}.api.cognitive.microsoft.com or https://{region}.tts.speech.microsoft.com\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/azure/text_to_speech/transformation.py:325 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set api_base to your region's TTS endpoint, e.g. https://{region}.tts.speech.microsoft.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"}