/audio-to-textConvert Audio to Text
Available for: Chatflow, Workflow, Agent, Chatbot, Legacy Agent, Text Generator apps.
Transcribes an uploaded audio file to text using the workspace's default speech-to-text model.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
6 documented failures
completion_request_error[OpenAI] Incorrect model credentials provided, please check and try again.
completion_request_error
invalid_paramModel whisper-1 is disabled.
invalid_param
model_currently_not_supportDify Hosted OpenAI trial currently not support the GPT-4 model.
model_currently_not_support
no_audio_uploadedPlease upload your audio.
no_audio_uploaded
provider_not_initializeDefault model not found for speech2text
provider_not_initialize
speech_to_text_disabledSpeech to text is disabled.
speech_to_text_disabled
One documented failure
audio_too_largeAudio size larger than 30 mb
audio_too_large
One documented failure
unsupported_audio_typeAudio type not allowed.
unsupported_audio_type
One documented failure
internal_server_errorThe server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
internal_server_error
A 400 is returned: - no_audio_uploaded : No audio file was provided in the file field.
speech_to_text_disabled: Speech-to-text isn't enabled in the app's published configuration. Calling a Chatflow or Workflow app that hasn't been published yet returns this code too.provider_not_initialize: The workspace has no default speech-to-text model, or the default one has no credentials configured.invalid_param: The default speech-to-text model is disabled in the model provider settings, or the model provider it belongs to is no longer installed.model_currently_not_support: On Dify Cloud, the workspace has used up its paid AI credits, and the trial credits it falls back to don't cover its default speech-to-text model.completion_request_error: The model provider rejected the transcription request or failed to complete it, for example because of invalid credentials. A 413 is returned:audio_too_large: The audio file exceeds the30 MBsize limit. A 415 is returned:unsupported_audio_type: The file's MIME type is not one of the accepted audio types (see thefilefield). A 500 is returned:internal_server_error: Internal server error.