Tongyi plugin reject new API-KEY #449

Closed
opened 2026-02-16 10:19:27 -05:00 by yindo · 7 comments
Owner

Originally created by @rASONIC on GitHub (Jul 15, 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.6.0

Cloud or Self Hosted

Cloud

Steps to reproduce

Image

✔️ Expected Behavior

  1. API-KEY indicator will be Red if the API-KEY field is empty ; or without API-KEY.
  2. Plugin can be using after input the API-KEY

Actual Behavior

  1. API-KEY indicator is always in Green even the API-KEY field is total empty.
  2. Plugin keep reject new API-KEY, even the key are flash and new - and pop message: "Invalid API-key provided." (I made 5 new flash keys for test, no one were work)
  3. I tried to create another account for test my account have issue or not, but the plugin reaction are same: reject all new API-KEY and pop message: "Invalid API-key provided."
  4. I tried to reinstall, downgrade, upgrade Tongyi plugin to 0.033 / 0.032 / 0.031 / 0.03 / 0.029 / 0.026 / 0.024 ; and the result were same.
Originally created by @rASONIC on GitHub (Jul 15, 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.6.0 ### Cloud or Self Hosted Cloud ### Steps to reproduce <img width="1953" height="1118" alt="Image" src="https://github.com/user-attachments/assets/9f2a37b9-9fe9-4f72-8dda-098c995d3712" /> ### ✔️ Expected Behavior 1. API-KEY indicator will be Red if the API-KEY field is empty ; or without API-KEY. 2. Plugin can be using after input the API-KEY ### ❌ Actual Behavior 1. API-KEY indicator is always in Green even the API-KEY field is total empty. 2. Plugin keep reject new API-KEY, even the key are flash and new - and pop message: "Invalid API-key provided." (I made 5 new flash keys for test, no one were work) 3. I tried to create another account for test my account have issue or not, but the plugin reaction are same: reject all new API-KEY and pop message: "Invalid API-key provided." 4. I tried to reinstall, downgrade, upgrade Tongyi plugin to 0.033 / 0.032 / 0.031 / 0.03 / 0.029 / 0.026 / 0.024 ; and the result were same.
yindo closed this issue 2026-02-16 10:19:27 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jul 15, 2025):

Hi @rASONIC! I'm Dosu and I’m helping the dify team.

This looks like a combination of a frontend UI bug and strict backend validation. The green API-KEY indicator is controlled by frontend logic and may only check if the field is non-empty, not if the key is actually valid—so it can show green even when the backend rejects the key as invalid. Recent frontend changes now require both the name and key fields to be non-empty and trimmed for the indicator to work as expected, but this doesn't guarantee backend acceptance if the key format or provider config is off [source].

On the backend, Tongyi API key validation is strict and expects a specific format (often starting with sk-). If the key doesn't match, or if there's a mismatch in provider config or endpoint, the backend will reject it—even if the UI indicator is green. There are no hardcoded keys; everything is modular and expects correct registration and format.

Known workarounds from similar issues include: double-checking the API key format, ensuring both the name and key fields are filled and trimmed, and sometimes downgrading the plugin version (though this hasn't consistently resolved the issue in recent cloud versions). If the problem persists, it's likely a UI/backend sync bug or a backend validation change that the frontend doesn't reflect yet. Collecting backend logs or error messages could help pinpoint the root cause, especially since this is a cloud deployment.

If you have access, try to confirm the exact API key format expected by the backend and ensure the plugin config matches. If not, this may need a patch to better sync frontend indicator logic with backend validation results.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Jul 15, 2025): <!-- Greeting --> Hi @rASONIC! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> This looks like a combination of a frontend UI bug and strict backend validation. The green API-KEY indicator is controlled by frontend logic and may only check if the field is non-empty, not if the key is actually valid—so it can show green even when the backend rejects the key as invalid. Recent frontend changes now require both the name and key fields to be non-empty and trimmed for the indicator to work as expected, but this doesn't guarantee backend acceptance if the key format or provider config is off [[source]](https://github.com/langgenius/dify/pull/21451). On the backend, Tongyi API key validation is strict and expects a specific format (often starting with `sk-`). If the key doesn't match, or if there's a mismatch in provider config or endpoint, the backend will reject it—even if the UI indicator is green. There are no hardcoded keys; everything is modular and expects correct registration and format. Known workarounds from similar issues include: double-checking the API key format, ensuring both the name and key fields are filled and trimmed, and sometimes downgrading the plugin version (though this hasn't consistently resolved the issue in recent cloud versions). If the problem persists, it's likely a UI/backend sync bug or a backend validation change that the frontend doesn't reflect yet. Collecting backend logs or error messages could help pinpoint the root cause, especially since this is a cloud deployment. If you have access, try to confirm the exact API key format expected by the backend and ensure the plugin config matches. If not, this may need a patch to better sync frontend indicator logic with backend validation results. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/1033da80-c870-40a9-8d72-b3c624f7f206?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/1033da80-c870-40a9-8d72-b3c624f7f206?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/1033da80-c870-40a9-8d72-b3c624f7f206?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/1033da80-c870-40a9-8d72-b3c624f7f206?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/1033da80-c870-40a9-8d72-b3c624f7f206?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/1033da80-c870-40a9-8d72-b3c624f7f206?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/1033da80-c870-40a9-8d72-b3c624f7f206?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/22442)
Author
Owner

@rASONIC commented on GitHub (Jul 15, 2025):

@dosu.

  1. I'm sure those API-KEY I provided to Tongyi plugin were correct and start with "sk-"
  2. The plugin can't downgrade too much because it can't connect to their server (0.024 can't connect already, I tried)
@rASONIC commented on GitHub (Jul 15, 2025): [@dosu](https://go.dosu.dev/dosubot). 1. I'm sure those API-KEY I provided to Tongyi plugin were correct and start with "sk-" 2. The plugin can't downgrade too much because it can't connect to their server (0.024 can't connect already, I tried)
Author
Owner

@dosubot[bot] commented on GitHub (Jul 15, 2025):

Thanks for confirming the API keys are correct and start with "sk-". Based on the code and recent changes, the backend validation for Tongyi keys is strict but hasn't changed its expected format—just "sk-" and a valid key. The Dify backend delegates the actual check to the Tongyi plugin, which does a real API request to verify the key. If all new keys are rejected, even after trying multiple accounts and plugin versions, the most likely causes are:

  • The Tongyi API itself is rejecting the keys (possibly due to upstream changes, quota, or region restrictions).
  • The Dify Cloud environment or plugin marketplace may have new restrictions or require plugin verification/authorization, which could block the plugin from validating keys or connecting to the Tongyi API [source].
  • There could be a mismatch in the endpoint (e.g., international vs. domestic), or the keys are not yet activated server-side.

There are no new required fields or breaking changes in the Dify code for Tongyi key validation, and no direct workarounds documented for this specific cloud issue. If you have access to backend logs or error details, those could help pinpoint if it's a plugin, network, or upstream API problem. Otherwise, this may require a fix or update on the cloud platform side, especially if plugin installation or validation policies have changed recently [source].

Let me know if you have any backend error messages or logs—those would help narrow it down further.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Jul 15, 2025): <!-- Answer --> Thanks for confirming the API keys are correct and start with "sk-". Based on the code and recent changes, the backend validation for Tongyi keys is strict but hasn't changed its expected format—just "sk-" and a valid key. The Dify backend delegates the actual check to the Tongyi plugin, which does a real API request to verify the key. If all new keys are rejected, even after trying multiple accounts and plugin versions, the most likely causes are: - The Tongyi API itself is rejecting the keys (possibly due to upstream changes, quota, or region restrictions). - The Dify Cloud environment or plugin marketplace may have new restrictions or require plugin verification/authorization, which could block the plugin from validating keys or connecting to the Tongyi API [[source]](https://github.com/langgenius/dify/pull/19963). - There could be a mismatch in the endpoint (e.g., international vs. domestic), or the keys are not yet activated server-side. There are no new required fields or breaking changes in the Dify code for Tongyi key validation, and no direct workarounds documented for this specific cloud issue. If you have access to backend logs or error details, those could help pinpoint if it's a plugin, network, or upstream API problem. Otherwise, this may require a fix or update on the cloud platform side, especially if plugin installation or validation policies have changed recently [[source]](https://github.com/langgenius/dify/pull/19963). Let me know if you have any backend error messages or logs—those would help narrow it down further. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/06a68521-ffdd-4e83-9e7d-7848e463df56?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/06a68521-ffdd-4e83-9e7d-7848e463df56?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/06a68521-ffdd-4e83-9e7d-7848e463df56?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/06a68521-ffdd-4e83-9e7d-7848e463df56?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/06a68521-ffdd-4e83-9e7d-7848e463df56?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/06a68521-ffdd-4e83-9e7d-7848e463df56?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/06a68521-ffdd-4e83-9e7d-7848e463df56?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/22442)
Author
Owner

@flyingfishzxf commented on GitHub (Jul 15, 2025):

Yes, I encountered the same issue, please fix asap, thanks

@flyingfishzxf commented on GitHub (Jul 15, 2025): Yes, I encountered the same issue, please fix asap, thanks
Author
Owner

@rASONIC commented on GitHub (Jul 15, 2025):

@flyingfishzxf
Try plugin 0.025

@rASONIC commented on GitHub (Jul 15, 2025): @flyingfishzxf Try plugin 0.025
Author
Owner

@flyingfishzxf commented on GitHub (Jul 16, 2025):

@flyingfishzxf Try plugin 0.025

Thank you, 0.025 works. But I encounter another problem, when I select the model which support Structure Output in LLM node, the switch of Output Variables Structured always display a warning that The current model does not support this feature...

@flyingfishzxf commented on GitHub (Jul 16, 2025): > [@flyingfishzxf](https://github.com/flyingfishzxf) Try plugin 0.025 Thank you, 0.025 works. But I encounter another problem, when I select the model which support `Structure Output` in LLM node, the switch of `Output Variables Structured` always display a warning that `The current model does not support this feature...`
Author
Owner

@crazywoola commented on GitHub (Jul 17, 2025):

If you obtain the key from "百炼", you should not use the "international endpoint".

I have tested it without problems.

@crazywoola commented on GitHub (Jul 17, 2025): If you obtain the key from "百炼", you should not use the "international endpoint". I have tested it without problems.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#449