mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
Credentials validation failed with status code 400 in text embedding model adding #283
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 @hc9701 on GitHub (May 15, 2025).
Self Checks
Dify version
1.3.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
I tried to add a text_embedding model (called bge-large-zh) from 百度千帆大模型平台 using openAI-API-compatible. When I try to save the model, it shows “Credentials validation failed with status code 400”.
In fact, I think I might find where the bug is.
The payload in "text_embedding.py" is
{"input": "ping", "model": model}. However, the payload in the demo provided by Baidu is{ "model": "embedding-v1", "input":["White T-shirt"] }(see demo)notice that there is a pair of
[]missing in the value of input.✔️ Expected Behavior
status code 200
❌ Actual Behavior
status code 400
@dosubot[bot] commented on GitHub (May 15, 2025):
To resolve the "Credentials validation failed with status code 400" error, ensure that the payload structure matches the expected format for the Baidu API. The correct payload should include the
inputas a list, even if it contains only one item. Based on the Baidu demo, the payload should look like this:Make sure that the
inputfield is a list, as the absence of brackets[]around the input value can lead to validation errors. Additionally, verify that you have provided validapi_keyandsecret_keyin thecredentialsdictionary, as these are necessary for obtaining an access token from Baidu [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