Issue with API Content-Type for Audio Upload in Version 1.3.0 #13360

Closed
opened 2026-02-21 19:11:48 -05:00 by yindo · 2 comments
Owner

Originally created by @tototototoby on GitHub (Apr 25, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.3.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

curl -X POST 'https://aicenter.xmgxrc.com/v1/audio-to-text'
--header 'Authorization: Bearer {api_key}'
--form 'file=@localfile;type=audio/[mp3|mp4|mpeg|mpga|m4a|wav|webm]

✔️ Expected Behavior

The audio can be sussfully upload.

Actual Behavior

{
"code": "unsupported_audio_type",
"message": "Audio type not allowed.",
"status": 415
}
This change is causing a significant problem for us because we are integrating the speech-to-text functionality into a WeChat Mini Program. Unfortunately, WeChat Mini Programs have strict limitations on the Content-Type values that can be used in network requests. Specifically, the only allowed values are:
multipart/form-data (for file uploads)
application/json (for JSON data)
application/octet-stream (for binary data streams)
Given these constraints, we are unable to set the Content-Type to audio/mp3, which is now required by version 1.3.0 of our application. As a result, we are unable to use the speech-to-text functionality within the WeChat Mini Program.
Request for Assistance: We kindly ask for your help in resolving this issue. Is there a way to configure the API to accept multipart/form-data or application/octet-stream for audio uploads, similar to the previous version? Alternatively, if there is a workaround or an alternative approach that we can use within the constraints of WeChat Mini Programs, we would greatly appreciate your guidance.
Thank you for your attention to this matter. We look forward to your response.

Originally created by @tototototoby on GitHub (Apr 25, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.3.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce curl -X POST 'https://aicenter.xmgxrc.com/v1/audio-to-text' \ --header 'Authorization: Bearer {api_key}' \ --form 'file=@localfile;type=audio/[mp3|mp4|mpeg|mpga|m4a|wav|webm] ### ✔️ Expected Behavior The audio can be sussfully upload. ### ❌ Actual Behavior { "code": "unsupported_audio_type", "message": "Audio type not allowed.", "status": 415 } This change is causing a significant problem for us because we are integrating the speech-to-text functionality into a WeChat Mini Program. Unfortunately, WeChat Mini Programs have strict limitations on the Content-Type values that can be used in network requests. Specifically, the only allowed values are: multipart/form-data (for file uploads) application/json (for JSON data) application/octet-stream (for binary data streams) Given these constraints, we are unable to set the Content-Type to audio/mp3, which is now required by version 1.3.0 of our application. As a result, we are unable to use the speech-to-text functionality within the WeChat Mini Program. Request for Assistance: We kindly ask for your help in resolving this issue. Is there a way to configure the API to accept multipart/form-data or application/octet-stream for audio uploads, similar to the previous version? Alternatively, if there is a workaround or an alternative approach that we can use within the constraints of WeChat Mini Programs, we would greatly appreciate your guidance. Thank you for your attention to this matter. We look forward to your response.
yindo added the 💪 enhancementstt & tts labels 2026-02-21 19:11:48 -05:00
yindo closed this issue 2026-02-21 19:11:48 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 25, 2025):

Hello @tototototoby! 👋 I'm Dosu, your friendly bot here to help solve bugs, answer questions, and assist you in becoming a contributor! I'm here while you wait for a human maintainer. How can I help you today? 😊

In version 1.3.0, the API can be configured to accept multipart/form-data for audio uploads, which should work within the constraints of WeChat Mini Programs. You can use the following example to make a request to the /audio-to-text endpoint:

curl -X POST '${props.appDetail.api_base_url}/audio-to-text' \
--header 'Authorization: Bearer {api_key}' \
--form 'file=@localfile;type=audio/[mp3|mp4|mpeg|mpga|m4a|wav|webm]'

This setup supports various audio formats and a file size limit of 15MB [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 25, 2025): <!-- Greeting --> Hello @tototototoby! 👋 I'm [Dosu](https://dosu.dev), your friendly bot here to help solve bugs, answer questions, and assist you in becoming a contributor! I'm here while you wait for a human maintainer. How can I help you today? 😊 <!-- Answer --> In version 1.3.0, the API can be configured to accept `multipart/form-data` for audio uploads, which should work within the constraints of WeChat Mini Programs. You can use the following example to make a request to the `/audio-to-text` endpoint: ```bash curl -X POST '${props.appDetail.api_base_url}/audio-to-text' \ --header 'Authorization: Bearer {api_key}' \ --form 'file=@localfile;type=audio/[mp3|mp4|mpeg|mpga|m4a|wav|webm]' ``` This setup supports various audio formats and a file size limit of 15MB <sup>[[1]](https://github.com/langgenius/dify/blob/main/web/app/components/develop/template/template_advanced_chat.zh.mdx)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/6e059936-01f4-4da1-82aa-5e6a4399a942?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/6e059936-01f4-4da1-82aa-5e6a4399a942?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/6e059936-01f4-4da1-82aa-5e6a4399a942?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/6e059936-01f4-4da1-82aa-5e6a4399a942?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/6e059936-01f4-4da1-82aa-5e6a4399a942?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/6e059936-01f4-4da1-82aa-5e6a4399a942?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/6e059936-01f4-4da1-82aa-5e6a4399a942?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Apr 25, 2025):

curl -X POST 'https://aicenter.xmgxrc.com/v1/audio-to-text'
--header 'Authorization: Bearer {api_key}'
--form 'file=@localfile;type=audio/[mp3|mp4|mpeg|mpga|m4a|wav|webm]

audio/[mp3|mp4|mpeg|mpga|m4a|wav|webm] You should choose one of them. This is a very simple question, please google how to use curl command.

@crazywoola commented on GitHub (Apr 25, 2025): ``` curl -X POST 'https://aicenter.xmgxrc.com/v1/audio-to-text' --header 'Authorization: Bearer {api_key}' --form 'file=@localfile;type=audio/[mp3|mp4|mpeg|mpga|m4a|wav|webm] ``` `audio/[mp3|mp4|mpeg|mpga|m4a|wav|webm]` You should choose one of them. This is a very simple question, please google how to use curl command.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13360