add openai-api-compatible error,credentials validation failed with status code 422 #12106

Closed
opened 2026-02-21 19:05:48 -05:00 by yindo · 4 comments
Owner

Originally created by @zengweitju on GitHub (Mar 25, 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

0.14.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

1、add openai-api-compatible
2、select text embedding
3、fill in relevant parameters

✔️ Expected Behavior

normal

Actual Behavior

credentials validation failed with status code 422
filled parameters below:
1、model type:Text Embedding
2、model name:bge_m3
3、api endpoint url:http://10.102.1.1:8080/v1
4、model context length:4096
api endpoint url input &output format:
http://10.102.1.1:8080/v1/embeddings
request body:
{
"input":"hello",
"model":"bge-m3",
"encoding_format":"float"

}
response body :
{
"data":[

"embedding":[
-0.151234677777777,
....
],
"index":0,
"object":"embedding"
],
"model":"bge-m3",
"object":"list",
"usage":{
"prompt_tokens":5,
"total_tokens":5
}
}

Originally created by @zengweitju on GitHub (Mar 25, 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 0.14.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1、add openai-api-compatible 2、select text embedding 3、fill in relevant parameters ### ✔️ Expected Behavior normal ### ❌ Actual Behavior credentials validation failed with status code 422 filled parameters below: 1、model type:Text Embedding 2、model name:bge_m3 3、api endpoint url:http://10.102.1.1:8080/v1 4、model context length:4096 api endpoint url input &output format: http://10.102.1.1:8080/v1/embeddings request body: { "input":"hello", "model":"bge-m3", "encoding_format":"float" } response body : { "data":[ "embedding":[ -0.151234677777777, .... ], "index":0, "object":"embedding" ], "model":"bge-m3", "object":"list", "usage":{ "prompt_tokens":5, "total_tokens":5 } }
yindo added the 🐞 bug label 2026-02-21 19:05:48 -05:00
yindo closed this issue 2026-02-21 19:05:48 -05:00
Author
Owner

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

Hey there, @zengweitju! I'm here to help you with any bugs, questions, or contributions you might have for the project. Let's tackle this issue together!

I found two similar unsolved discussions that might be relevant to your issue:

  1. Config OpenAI-API-compatible error [1].
  2. openai_api_compatible API request failed [2].

Regarding the status code 422 error during credentials validation, it might be related to the specific requirement of using the 'max_completion_tokens' parameter instead of 'max_tokens' for o1 series models in Dify [3]. Additionally, ensure that the API endpoint URL is correct and accessible, and that a valid API key is provided [2].

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 25, 2025): <!-- Greeting --> Hey there, @zengweitju! I'm here to help you with any bugs, questions, or contributions you might have for the project. Let's tackle this issue together! <!-- Answer --> I found two similar unsolved discussions that might be relevant to your issue: 1. [Config OpenAI-API-compatible error](https://github.com/langgenius/dify/discussions/16097) <sup>[[1]](https://github.com/langgenius/dify/discussions/16097)</sup>. 2. [openai_api_compatible API request failed](https://github.com/langgenius/dify/discussions/12361) <sup>[[2]](https://github.com/langgenius/dify/discussions/12361)</sup>. Regarding the status code 422 error during credentials validation, it might be related to the specific requirement of using the 'max_completion_tokens' parameter instead of 'max_tokens' for o1 series models in Dify <sup>[[3]](https://github.com/langgenius/dify/issues/12767)</sup>. Additionally, ensure that the API endpoint URL is correct and accessible, and that a valid API key is provided <sup>[[2]](https://github.com/langgenius/dify/discussions/12361)</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/8f85ed3e-ab3c-4263-8148-05d0b3f95f71?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/8f85ed3e-ab3c-4263-8148-05d0b3f95f71?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/8f85ed3e-ab3c-4263-8148-05d0b3f95f71?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/8f85ed3e-ab3c-4263-8148-05d0b3f95f71?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/8f85ed3e-ab3c-4263-8148-05d0b3f95f71?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/8f85ed3e-ab3c-4263-8148-05d0b3f95f71?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/8f85ed3e-ab3c-4263-8148-05d0b3f95f71?feedback_type=other)</sup>
Author
Owner

@walesfang commented on GitHub (May 19, 2025):

exactly same error for me, any one know how to resolve this problem?

@walesfang commented on GitHub (May 19, 2025): exactly same error for me, any one know how to resolve this problem?
Author
Owner

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

@crazywoola, the user @walesfang is experiencing the same status code 422 error during credentials validation and is seeking help to resolve this issue. Could you please assist them?

@dosubot[bot] commented on GitHub (May 19, 2025): @crazywoola, the user @walesfang is experiencing the same status code 422 error during credentials validation and is seeking help to resolve this issue. Could you please assist them?
Author
Owner

@crazywoola commented on GitHub (May 30, 2025):

You might need to charge your account of your provider. The error code is return by the provider side, not us.

@crazywoola commented on GitHub (May 30, 2025): You might need to charge your account of your provider. The error code is return by the provider side, not us.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12106