{"record":{"id":"6c946c805d8961af","repo":"BerriAI/litellm","slug":"api-base-is-required-for-azure-ai-speech-transcrip","errorCode":null,"errorMessage":"api_base is required for Azure AI Speech transcription. Use a Cognitive Services endpoint like https://{region}.api.cognitive.microsoft.com or an STT endpoint like https://{region}.stt.speech.microsoft.com.","messagePattern":"api_base is required for Azure AI Speech transcription\\. Use a Cognitive Services endpoint like https://(.+?)\\.api\\.cognitive\\.microsoft\\.com or an STT endpoint like https://(.+?)\\.stt\\.speech\\.microsoft\\.com\\.","errorType":"validation","errorClass":"AzureSpeechAudioTranscriptionException","httpStatus":400,"severity":"error","filePath":"litellm/llms/azure/audio_transcription/transformation.py","lineNumber":94,"sourceCode":"\n        validated_headers: Final = headers.copy()\n        validated_headers[\"Ocp-Apim-Subscription-Key\"] = api_key\n        validated_headers[\"Content-Type\"] = validated_headers.get(\"Content-Type\", \"audio/wav\")\n        validated_headers[\"Accept\"] = \"application/json\"\n        return validated_headers\n\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        api_base = api_base or get_secret_str(\"AZURE_SPEECH_API_BASE\")\n        if api_base is None:\n            raise AzureSpeechAudioTranscriptionException(\n                message=(\n                    \"api_base is required for Azure AI Speech transcription. \"\n                    \"Use a Cognitive Services endpoint like \"\n                    \"https://{region}.api.cognitive.microsoft.com or an STT \"\n                    \"endpoint like https://{region}.stt.speech.microsoft.com.\"\n                ),\n                status_code=400,\n            )\n\n        base_url: Final = self._resolve_stt_base_url(api_base=api_base)\n        query_params: Final = {\n            \"language\": optional_params.get(\"language\", self.DEFAULT_LANGUAGE),\n            \"format\": self._get_azure_response_format(optional_params.get(\"response_format\")),\n        }\n        return f\"{base_url}{self.STT_ENDPOINT_PATH}?{urlencode(query_params)}\"\n\n    def transform_audio_transcription_request(\n        self,","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/azure/audio_transcription/transformation.py#L76-L112","documentation":"Error \"api_base is required for Azure AI Speech transcription. Use a Cognitive Services endpoint like https://{region}.api.cognitive.microsoft.com or an STT endpoint like https://{region}.stt.speech.microsoft.com.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/azure/audio_transcription/transformation.py:94 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass api_base pointing to your Cognitive Services/STT endpoint, e.g. https://{region}.stt.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"}