{"record":{"id":"59aefb3363e5745c","repo":"BerriAI/litellm","slug":"api-key-is-required-for-azure-ai-speech-transcript","errorCode":null,"errorMessage":"api_key is required for Azure AI Speech transcription.","messagePattern":"api_key is required for Azure AI Speech transcription\\.","errorType":"validation","errorClass":"AzureSpeechAudioTranscriptionException","httpStatus":401,"severity":"error","filePath":"litellm/llms/azure/audio_transcription/transformation.py","lineNumber":72,"sourceCode":"        supported_params: Final = self.get_supported_openai_params(model=model)\n        for key, value in non_default_params.items():\n            if key in supported_params:\n                optional_params[key] = value\n        return optional_params\n\n    def validate_environment(\n        self,\n        headers: dict,\n        model: str,\n        messages: list[AllMessageValues],\n        optional_params: dict,\n        litellm_params: dict,\n        api_key: str | None = None,\n        api_base: str | None = None,\n    ) -> dict:\n        api_key = api_key or get_secret_str(\"AZURE_SPEECH_API_KEY\")\n        if not api_key:\n            raise AzureSpeechAudioTranscriptionException(\n                message=\"api_key is required for Azure AI Speech transcription.\",\n                status_code=401,\n            )\n\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,","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/azure/audio_transcription/transformation.py#L54-L90","documentation":"Error \"api_key is required for Azure AI Speech transcription.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/azure/audio_transcription/transformation.py:72 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set AZURE_API_KEY or pass api_key for the Azure AI Speech transcription call."],"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"}