{"record":{"id":"89c11fb3d73bc24f","repo":"langgenius/dify","slug":"speech-to-text-disabled","errorCode":"speech_to_text_disabled","errorMessage":"Speech to text is disabled.","messagePattern":"Speech to text is disabled\\.","errorType":"error_code","errorClass":"SpeechToTextDisabledError","httpStatus":400,"severity":"error","filePath":"api/controllers/console/app/audio.py","lineNumber":163,"sourceCode":"                agent_soul=agent_soul,\n                file=file,\n                session=session,\n                end_user=None,\n            )\n        return dump_response(AudioTranscriptResponse, response)\n    except services.errors.app_model_config.AppModelConfigBrokenError:\n        logger.exception(\"App model config broken.\")\n        raise AppUnavailableError()\n    except NoAudioUploadedServiceError:\n        raise NoAudioUploadedError()\n    except AudioTooLargeServiceError as e:\n        raise AudioTooLargeError(str(e))\n    except UnsupportedAudioTypeServiceError:\n        raise UnsupportedAudioTypeError()\n    except ProviderNotSupportSpeechToTextServiceError:\n        raise ProviderNotSupportSpeechToTextError()\n    except SpeechToTextDisabledServiceError:\n        raise SpeechToTextDisabledError()\n    except ProviderTokenNotInitError as ex:\n        raise ProviderNotInitializeError(ex.description)\n    except QuotaExceededError:\n        raise ProviderQuotaExceededError()\n    except ModelCurrentlyNotSupportError:\n        raise ProviderModelCurrentlyNotSupportError()\n    except InvokeError as e:\n        raise CompletionRequestError(e.description)\n    except HTTPException:\n        raise\n    except ValueError:\n        raise\n    except Exception as e:\n        logger.exception(\"Failed to transcribe audio to text\")\n        raise InternalServerError() from e\n\n\n@console_ns.route(\"/apps/<uuid:app_id>/audio-to-text\")","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/api/controllers/console/app/audio.py#L145-L181","documentation":"Raised by _transcribe_audio_to_text when AudioService raises SpeechToTextDisabledServiceError — the speech-to-text feature is disabled in the system/tenant configuration. Translated to SpeechToTextDisabledError (400, error_code 'speech_to_text_disabled').","triggerScenarios":"Calling the audio-to-text endpoint when the STT feature flag is off at the system or tenant level, regardless of provider configuration.","commonSituations":"Self-hosted deployment where SPEECH_TO_TEXT is disabled by default; admin disabled the feature; tenant settings override turned STT off.","solutions":["Enable speech-to-text in the system/tenant configuration (set the relevant SPEECH_TO_TEXT config flag).","Restart the API service after changing the config.","Confirm the feature is enabled in the admin console before users hit the endpoint.","Hide the audio upload UI when STT is disabled."],"exampleFix":"# before: .env\nSPEECH_TO_TEXT_ENABLED=false\n\n# after\nSPEECH_TO_TEXT_ENABLED=true","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await axios.post(`/apps/${id}/audio-to-text`, form); }\ncatch (e) { if (e.code === 'speech_to_text_disabled') { /* hide audio UI; surface to admin */ } }","preventionTips":["Enable SPEECH_TO_TEXT in system/tenant config before exposing the UI.","Restart the API service after toggling the flag.","Hide the audio upload control when the feature is off."],"tags":["audio","asr","configuration","feature-flag","console-api"],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}