When the API key for the rerank model in the openai_api_compatible module configuration is empty, a 401 error is returned. #654

Closed
opened 2026-02-16 10:20:04 -05:00 by yindo · 1 comment
Owner

Originally created by @1018053166 on GitHub (Sep 16, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

When configuring the rerank model API key as empty in the openai_api_compatible module, the configuration is intercepted by the large model gateway and fails to complete successfully.
The re-ranking model cannot be configured due to an empty API key.
After troubleshooting the code, the rerank model couldn't be configured because the API key was empty. The request header sent by dify with Authorization: Bearer containing an empty string was intercepted by the large model platform's gateway, resulting in a 401 error.

Image

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @1018053166 on GitHub (Sep 16, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify-official-plugins/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. When configuring the rerank model API key as empty in the openai_api_compatible module, the configuration is intercepted by the large model gateway and fails to complete successfully. The re-ranking model cannot be configured due to an empty API key. After troubleshooting the code, the rerank model couldn't be configured because the API key was empty. The request header sent by dify with `Authorization: Bearer` containing an empty string was intercepted by the large model platform's gateway, resulting in a 401 error. <img width="2400" height="1854" alt="Image" src="https://github.com/user-attachments/assets/d60f48e9-714c-4e3c-bb42-de69e4cc01a5" /> ### 2. Additional context or comments _No response_ ### 3. Can you help us with this feature? - [x] I am interested in contributing to this feature.
yindo added the bugenhancement labels 2026-02-16 10:20:04 -05:00
yindo closed this issue 2026-02-16 10:20:04 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 3, 2025):

Hi, @1018053166. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported that leaving the API key empty for the rerank model in the openai_api_compatible module causes the large model gateway to send an empty Authorization header.
  • This results in a 401 error and blocks configuration.
  • You identified the root cause and expressed interest in contributing a fix.
  • No further updates or comments have been posted since your initial report.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of dify-official-plugins by commenting here.
  • If I don’t hear back within 5 days, this issue will be automatically closed.

Thanks for your understanding and contribution!

@dosubot[bot] commented on GitHub (Oct 3, 2025): Hi, @1018053166. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that leaving the API key empty for the rerank model in the openai_api_compatible module causes the large model gateway to send an empty Authorization header. - This results in a 401 error and blocks configuration. - You identified the root cause and expressed interest in contributing a fix. - No further updates or comments have been posted since your initial report. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of dify-official-plugins by commenting here. - If I don’t hear back within 5 days, this issue will be automatically closed. Thanks for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#654