mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
Invoke Plugin Moonshot Error #577
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zhiyzheng on GitHub (Aug 21, 2025).
Self Checks
Dify version
1.7.2
Plugin version
moonshot 0.0.7
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Steps to reproduce
While using moonshot model as LLM, it encounters the error, shown as following:
"2025-08-21 18:12:42 api-1 | 2025-08-21 10:12:42.012 ERROR [Thread-109 (worker_with_context)] [base.py:211] - Error in stream reponse for plugin {'code': -500, 'message': '{"message":"{"args":{"description":"[models] Error: API request failed with status code 401: {\"error\":{\"message\":\"Invalid Authentication\",\"type\":\"invalid_authentication_error\"}}"},"error_type":"InvokeError","message":"[models] Error: API request failed with status code 401: {\"error\":{\"message\":\"Invalid Authentication\",\"type\":\"invalid_authentication_error\"}}"}","error_type":"PluginInvokeError","args":null}', 'data': None}"
I am now using windows docker to run DIfy 1.7.2, by using version 0.07 of plugin moonshot for model.
✔️ Error log
"2025-08-21 18:12:42 api-1 | 2025-08-21 10:12:42.012 ERROR [Thread-109 (worker_with_context)] [base.py:211] - Error in stream reponse for plugin {'code': -500, 'message': '{"message":"{"args":{"description":"[models] Error: API request failed with status code 401: {\"error\":{\"message\":\"Invalid Authentication\",\"type\":\"invalid_authentication_error\"}}"},"error_type":"InvokeError","message":"[models] Error: API request failed with status code 401: {\"error\":{\"message\":\"Invalid Authentication\",\"type\":\"invalid_authentication_error\"}}"}","error_type":"PluginInvokeError","args":null}', 'data': None}"
@dosubot[bot] commented on GitHub (Aug 21, 2025):
The 401 "Invalid Authentication" error with the Moonshot plugin in Dify usually means the API key is missing, incorrect, or not being passed to the plugin as expected. The Moonshot plugin expects the
MOONSHOT_API_KEYenvironment variable to be set in your Docker environment. If this variable is missing, malformed, or unauthorized, the plugin will pass it to the Moonshot API, which then returns a 401 error. The plugin does not perform local validation—it relies on the API response for error handling source.Here’s a quick checklist to help resolve this:
MOONSHOT_API_KEYis set in your Docker Compose file or container environment. For example, in yourdocker-compose.yml:env | grep MOONSHOT_API_KEYinside the running container.Similar issues have been reported with other OpenAI-compatible plugins in self-hosted Docker environments, often resolved by correcting the API key or endpoint configuration source.
If you’ve confirmed the API key is set and valid but still get the error, there may be a mismatch in how credentials are passed between Dify and the plugin, or a network/configuration issue in your Docker setup. Let me know if you need more detailed steps for debugging inside Docker!
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

@zhiyzheng commented on GitHub (Aug 21, 2025):
The similar error occurs, when using Plugin of Gemini 0.4.2.
I can use Ollama to chat/run correctly, but would encounter the API key issue when using Gemini 0.4.2 and Moonshot 0.0.7.
The keys of the two model providers are confirmed to set correctly, and the configuration of Dify can load the models of the providers.
@dosubot[bot] commented on GitHub (Sep 7, 2025):
Hi, @zhiyzheng. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.
Issue Summary:
Next Steps:
Thank you for your understanding and contribution!