{"record":{"id":"5e9a98fe5d42b932","repo":"BerriAI/litellm","slug":"missing-soniox-api-key-set-the-soniox-api-key-env","errorCode":null,"errorMessage":"Missing Soniox API key. Set the SONIOX_API_KEY environment variable or pass api_key=... to litellm.transcription().","messagePattern":"Missing Soniox API key\\. Set the SONIOX_API_KEY environment variable or pass api_key=\\.\\.\\. to litellm\\.transcription\\(\\)\\.","errorType":"exception","errorClass":"SonioxException","httpStatus":401,"severity":"error","filePath":"litellm/llms/soniox/audio_transcription/transformation.py","lineNumber":112,"sourceCode":"\n        return optional_params\n\n    def get_error_class(self, error_message: str, status_code: int, headers: dict | Headers) -> BaseLLMException:\n        return SonioxException(message=error_message, status_code=status_code, headers=headers)\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        resolved_key: Final = get_soniox_api_key(api_key)\n        if not resolved_key:\n            raise SonioxException(\n                message=(\n                    \"Missing Soniox API key. Set the SONIOX_API_KEY environment \"\n                    \"variable or pass api_key=... to litellm.transcription().\"\n                ),\n                status_code=401,\n                headers=None,\n            )\n\n        merged_headers: Final[dict[str, str]] = {\n            \"Authorization\": f\"Bearer {resolved_key}\",\n        }\n        if headers:\n            merged_headers.update(headers)\n        return merged_headers\n\n    def get_complete_url(\n        self,\n        api_base: str | None,","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/soniox/audio_transcription/transformation.py#L94-L130","documentation":"Validation in validate_environment: get_soniox_api_key returned an empty key, meaning neither an explicit api_key argument, litellm.soniox_key, nor the SONIOX_API_KEY env var is set, so the Soniox transcription request cannot be authenticated.","triggerScenarios":"Triggered when calling Soniox transcription without SONIOX_API_KEY set or api_key passed.","commonSituations":"See trigger scenarios.","solutions":["Set the SONIOX_API_KEY environment variable.","Or pass api_key=... to litellm.transcription()."],"exampleFix":"os.environ[\"SONIOX_API_KEY\"] = \"<key>\"","handlingStrategy":"validation","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-14T00:17:10.932Z"}