OpenRouter Plugin - Completion Mode Configuration Issue #137

Closed
opened 2026-02-16 10:18:12 -05:00 by yindo · 6 comments
Owner

Originally created by @esuxiao on GitHub (Mar 27, 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.1.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Open the plugin configuration for OpenRouter
  2. Attempt to set the Completion Mode to 'Completion'
  3. Save the configuration
  4. Reopen the configuration

✔️ Expected Behavior

  • Completion Mode remains set to 'Completion'

Actual Behavior

  • Completion Mode reverts to 'Chat' after saving
  • Unable to save 'Completion' mode via the 'config' edit button
Originally created by @esuxiao on GitHub (Mar 27, 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.1.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. Open the plugin configuration for OpenRouter 2. Attempt to set the Completion Mode to 'Completion' 3. Save the configuration 4. Reopen the configuration ### ✔️ Expected Behavior - Completion Mode remains set to 'Completion' ### ❌ Actual Behavior - Completion Mode reverts to 'Chat' after saving - Unable to save 'Completion' mode via the 'config' edit button
yindo closed this issue 2026-02-16 10:18:12 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 27, 2025):

Hello, @esuxiao! I'm here to help you with any bugs, questions, or contributions you have regarding the OpenRouter plugin. I'm a bot designed to assist you while waiting for a human maintainer.

The issue you're experiencing with the OpenRouter plugin's Completion Mode reverting to 'Chat' after saving might be related to how the state of the Completion Mode is stored and retrieved. Unfortunately, I couldn't find specific details in the codebase about where the logic for saving the OpenRouter plugin's configuration settings is implemented. However, there are known issues related to configuration settings in Dify v15.0, which might be relevant to your situation. These issues have been addressed in a recent pull request (PR langgenius/dify#12463) [1].

To resolve this, you might want to check if there are any updates or patches available for your version (1.1.2) that address this issue. Additionally, reviewing the pull request mentioned might provide insights into the changes made to fix similar configuration issues.

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 (Mar 27, 2025): <!-- Greeting --> Hello, @esuxiao! I'm here to help you with any bugs, questions, or contributions you have regarding the OpenRouter plugin. I'm a bot designed to assist you while waiting for a human maintainer. <!-- Answer --> The issue you're experiencing with the OpenRouter plugin's Completion Mode reverting to 'Chat' after saving might be related to how the state of the Completion Mode is stored and retrieved. Unfortunately, I couldn't find specific details in the codebase about where the logic for saving the OpenRouter plugin's configuration settings is implemented. However, there are known issues related to configuration settings in Dify v15.0, which might be relevant to your situation. These issues have been addressed in a recent pull request (PR langgenius/dify#12463) <sup>[[1]](https://github.com/langgenius/dify/issues/12460)</sup>. To resolve this, you might want to check if there are any updates or patches available for your version (1.1.2) that address this issue. Additionally, reviewing the pull request mentioned might provide insights into the changes made to fix similar configuration issues. <!-- 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/5da3b977-0bc4-4508-aa85-fb188f2aad29?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/5da3b977-0bc4-4508-aa85-fb188f2aad29?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/5da3b977-0bc4-4508-aa85-fb188f2aad29?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/5da3b977-0bc4-4508-aa85-fb188f2aad29?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/5da3b977-0bc4-4508-aa85-fb188f2aad29?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/5da3b977-0bc4-4508-aa85-fb188f2aad29?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/5da3b977-0bc4-4508-aa85-fb188f2aad29?feedback_type=other)</sup>
Author
Owner

@esuxiao commented on GitHub (Mar 27, 2025):

@dosu.
Description
When attempting to configure Perplexity models in the OpenRouter plugin, there is a persistent issue with the Completion Mode setting that may prevent proper model configuration and usage.

Additional Observations

  • Attempting to use Perplexity models results in the error:
    Run failed: [openrouter] Error: PluginInvokeError: {"args":{},"error_type":"KeyError","message":"'choices'"}
    All other configuration parameters (model name, API key, max tokens, context) are correctly set
    -Other models in OpenRouter (DeepSeek, Gemini, Claude series) work correctly

Environment Details

Plugin: OpenRouter
Affected Models: Perplexity series
Working Models: DeepSeek, Gemini, Claude series

@esuxiao commented on GitHub (Mar 27, 2025): @dosu. **Description** When attempting to configure Perplexity models in the OpenRouter plugin, there is a persistent issue with the Completion Mode setting that may prevent proper model configuration and usage. **Additional Observations** - Attempting to use Perplexity models results in the error: `Run failed: [openrouter] Error: PluginInvokeError: {"args":{},"error_type":"KeyError","message":"'choices'"} ` All other configuration parameters (model name, API key, max tokens, context) are correctly set -Other models in OpenRouter (DeepSeek, Gemini, Claude series) work correctly **Environment Details** Plugin: OpenRouter Affected Models: Perplexity series Working Models: DeepSeek, Gemini, Claude series
Author
Owner

@dosubot[bot] commented on GitHub (Mar 27, 2025):

The "PluginInvokeError: KeyError: 'choices'" error when configuring Perplexity models in the OpenRouter plugin is likely due to insufficient tokens in your free OpenRouter account. Upgrading to a paid account with sufficient tokens should resolve this issue [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 (Mar 27, 2025): <!-- Answer --> The "PluginInvokeError: KeyError: 'choices'" error when configuring Perplexity models in the OpenRouter plugin is likely due to insufficient tokens in your free OpenRouter account. Upgrading to a paid account with sufficient tokens should resolve this issue <sup>[[1]](https://github.com/langgenius/dify/issues/11629)</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/bafb4665-02f9-44fc-a554-83c9d26bf61e?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/bafb4665-02f9-44fc-a554-83c9d26bf61e?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/bafb4665-02f9-44fc-a554-83c9d26bf61e?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/bafb4665-02f9-44fc-a554-83c9d26bf61e?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/bafb4665-02f9-44fc-a554-83c9d26bf61e?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/bafb4665-02f9-44fc-a554-83c9d26bf61e?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/bafb4665-02f9-44fc-a554-83c9d26bf61e?feedback_type=other)</sup>
Author
Owner

@backrunner commented on GitHub (Mar 28, 2025):

Same here, cannot use "google/gemini-2.5-pro-exp-03-25:free", it's completely free and I do have a paid account in OpenRouter with available credits, which is not helpful in this case

@backrunner commented on GitHub (Mar 28, 2025): Same here, cannot use "google/gemini-2.5-pro-exp-03-25:free", it's completely free and I do have a paid account in OpenRouter with available credits, which is not helpful in this case
Author
Owner

@hnrna commented on GitHub (Apr 2, 2025):

Same here, cannot use "google/gemini-2.5-pro-exp-03-25:free" and "google/gemini-2.0-pro-exp-02-05:free", it's completely free and I do have a paid account in OpenRouter with available credits.

Error information:
[openrouter] Error: PluginInvokeError: {"args":{},"error_type":"KeyError","message":"'choices'"}

@hnrna commented on GitHub (Apr 2, 2025): Same here, cannot use "google/gemini-2.5-pro-exp-03-25:free" and "google/gemini-2.0-pro-exp-02-05:free", it's completely free and I do have a paid account in OpenRouter with available credits. Error information: `[openrouter] Error: PluginInvokeError: {"args":{},"error_type":"KeyError","message":"'choices'"}`
Author
Owner

@dosubot[bot] commented on GitHub (Aug 20, 2025):

Hi, @esuxiao. 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 in Dify v1.1.2, the OpenRouter plugin's Completion Mode setting reverts from 'Completion' back to 'Chat' after saving.
  • You also encountered a "KeyError: 'choices'" error when using Perplexity models, while other models worked fine.
  • It was suggested that the error might be due to insufficient tokens in the OpenRouter account, with a recommendation to upgrade to a paid plan.
  • Other users have confirmed similar issues with free models despite having paid OpenRouter accounts.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting here.
  • If I do not hear back within 5 days, I will automatically close this issue.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 20, 2025): Hi, @esuxiao. 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 in Dify v1.1.2, the OpenRouter plugin's Completion Mode setting reverts from 'Completion' back to 'Chat' after saving. - You also encountered a "KeyError: 'choices'" error when using Perplexity models, while other models worked fine. - It was suggested that the error might be due to insufficient tokens in the OpenRouter account, with a recommendation to upgrade to a paid plan. - Other users have confirmed similar issues with free models despite having paid OpenRouter accounts. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting here. - If I do not hear back within 5 days, I will automatically close this issue. Thank you 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#137