OpenAI-API-compatible add qwen3-235b-a22b error #318

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

Originally created by @derekmaoo on GitHub (May 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.2.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

1.Add config in model supplier
2.config OpenAI-API-compatible
3.add model
4.config qwen3-235b-a22b

✔️ Expected Behavior

config success

Actual Behavior

Credentials validation failed with status code 400

Image

Originally created by @derekmaoo on GitHub (May 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.2.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1.Add config in model supplier 2.config OpenAI-API-compatible 3.add model 4.config qwen3-235b-a22b ### ✔️ Expected Behavior config success ### ❌ Actual Behavior Credentials validation failed with status code 400 ![Image](https://github.com/user-attachments/assets/39fcd3c1-1f14-4031-b336-05cb44b6649b)
yindo closed this issue 2026-02-16 10:18:59 -05:00
Author
Owner

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

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

The "Credentials validation failed with status code 400" error when adding the qwen3-235b-a22b model via the OpenAI-API-compatible interface in Dify is most often caused by one of the following issues:

  1. Parameter mismatch: For some models, Dify expects the parameter max_completion_tokens instead of max_tokens. If your configuration uses max_tokens, try changing it to max_completion_tokens and see if the error resolves.
    Reference

  2. Provider selection: Users have reported that using the "OpenAI" provider directly (instead of the "OpenAI API Compatible" provider) resolves this error for custom models.
    Reference

  3. Credential configuration: Make sure you have entered a valid API key in the model provider settings. The credential schema for OpenAI-compatible models requires an openai_api_key (mandatory), and optionally openai_organization and openai_api_base. Double-check that your API key is correct and does not contain any extra or hidden characters.
    Reference

  4. Model name formatting: Ensure that your model name does not start with a /, as this can also trigger the 400 error.
    Reference

  5. General troubleshooting: If you are configuring the model for the first time, try refreshing the page, re-entering the model and API key, and avoid changing other parameters. Sometimes, input issues (like hidden characters) can cause credential validation to fail.
    Reference

Summary of steps to resolve:

  • Use max_completion_tokens instead of max_tokens in your config.
  • Try the "OpenAI" provider instead of "OpenAI API Compatible".
  • Double-check your API key and credential fields.
  • Make sure the model name does not start with /.
  • If the error persists, refresh and re-enter your configuration.

If you follow these steps and still encounter issues, please share your exact configuration (with sensitive info redacted) for further troubleshooting.

To reply, just mention my name @dosu.


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

@dosubot[bot] commented on GitHub (May 27, 2025): <!-- Greeting --> Hi @derekmaoo! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> The "Credentials validation failed with status code 400" error when adding the `qwen3-235b-a22b` model via the OpenAI-API-compatible interface in Dify is most often caused by one of the following issues: 1. **Parameter mismatch**: For some models, Dify expects the parameter `max_completion_tokens` instead of `max_tokens`. If your configuration uses `max_tokens`, try changing it to `max_completion_tokens` and see if the error resolves. [Reference](https://github.com/langgenius/dify/issues/12767) 2. **Provider selection**: Users have reported that using the "OpenAI" provider directly (instead of the "OpenAI API Compatible" provider) resolves this error for custom models. [Reference](https://github.com/langgenius/dify/issues/15495) 3. **Credential configuration**: Make sure you have entered a valid API key in the model provider settings. The credential schema for OpenAI-compatible models requires an `openai_api_key` (mandatory), and optionally `openai_organization` and `openai_api_base`. Double-check that your API key is correct and does not contain any extra or hidden characters. [Reference](https://github.com/crazywoola/dify-docs-mintlify/blob/main/en/guides/model-configuration/new-provider.mdx) 4. **Model name formatting**: Ensure that your model name does not start with a `/`, as this can also trigger the 400 error. [Reference](https://github.com/langgenius/dify/issues/15495) 5. **General troubleshooting**: If you are configuring the model for the first time, try refreshing the page, re-entering the model and API key, and avoid changing other parameters. Sometimes, input issues (like hidden characters) can cause credential validation to fail. [Reference](https://github.com/langgenius/dify/issues/12767) **Summary of steps to resolve:** - Use `max_completion_tokens` instead of `max_tokens` in your config. - Try the "OpenAI" provider instead of "OpenAI API Compatible". - Double-check your API key and credential fields. - Make sure the model name does not start with `/`. - If the error persists, refresh and re-enter your configuration. If you follow these steps and still encounter issues, please share your exact configuration (with sensitive info redacted) for further troubleshooting. <!-- Dosu Comment Footer --> *To reply, just mention my name [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/5cc5aa33-0352-42e9-9319-a291fc4b75b7?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/5cc5aa33-0352-42e9-9319-a291fc4b75b7?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/5cc5aa33-0352-42e9-9319-a291fc4b75b7?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/5cc5aa33-0352-42e9-9319-a291fc4b75b7?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/5cc5aa33-0352-42e9-9319-a291fc4b75b7?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/5cc5aa33-0352-42e9-9319-a291fc4b75b7?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/5cc5aa33-0352-42e9-9319-a291fc4b75b7?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/20315)
Author
Owner

@mmobai commented on GitHub (Jun 11, 2025):

same as you ,do you fix it?

@mmobai commented on GitHub (Jun 11, 2025): same as you ,do you fix it?
Author
Owner

@derekmaoo commented on GitHub (Jun 13, 2025):

Main causes of the problem:
There is a rule restriction on the general sense side,enable_thinking must be set to false for non-streaming calls, hope the community can solve it as soon as possible

The Solution:

  1. By modifying the dify plugin_daemon code and repackaging the image to solve the problem, but I did not try, and I am not familiar with go language
  2. Directly modify the class PluginModelClient,validate_model_credentials method, determine the endpoint name starts with qwen3 directly skip the verification solution
@derekmaoo commented on GitHub (Jun 13, 2025): Main causes of the problem: There is a rule restriction on the general sense side,enable_thinking must be set to false for non-streaming calls, hope the community can solve it as soon as possible The Solution: 1. By modifying the dify plugin_daemon code and repackaging the image to solve the problem, but I did not try, and I am not familiar with go language 2. Directly modify the class PluginModelClient,validate_model_credentials method, determine the endpoint name starts with qwen3 directly skip the verification solution
Author
Owner

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

Hi, @derekmaoo. 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 a 400 error when adding the qwen3-235b-a22b model with OpenAI-API-compatible config in Dify 1.2.0 self-hosted.
  • The error was caused by credential validation failure related to a rule requiring enable_thinking to be false for non-streaming calls.
  • Suggested fixes included using max_completion_tokens instead of max_tokens, switching provider to "OpenAI," verifying API key, and avoiding model names starting with "/".
  • You proposed modifying the plugin_daemon code or skipping credential validation for qwen3 models as workarounds.
  • Another user confirmed facing the same issue.

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, I will automatically close this issue.

Thanks for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 20, 2025): Hi, @derekmaoo. 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 a 400 error when adding the qwen3-235b-a22b model with OpenAI-API-compatible config in Dify 1.2.0 self-hosted. - The error was caused by credential validation failure related to a rule requiring `enable_thinking` to be false for non-streaming calls. - Suggested fixes included using `max_completion_tokens` instead of `max_tokens`, switching provider to "OpenAI," verifying API key, and avoiding model names starting with "/". - You proposed modifying the plugin_daemon code or skipping credential validation for qwen3 models as workarounds. - Another user confirmed facing the same issue. **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, I will automatically close this issue. 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#318