mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
failed to add custom llm model gpt5.1, return "Credentials validation failed with status code 400" #823
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 @liuzeqi1997 on GitHub (Nov 21, 2025).
Self Checks
Dify version
1.3
Plugin version
0.0.13
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
First, I used the OpenAI-API-compatible method to add gpt-5.1, but it resulted in an error message "Credentials validation failed with status code 400". Then, I tried to add it using the OpenAI approach, but I still encountered the error "Base model gpt-5.1 not found".
Then I attempted to use the OpenAI method, but still received an error message stating "Base model gpt-5.1 not found".
✔️ Error log
error1 Credentials validation failed with status code 400
error2 Base model gpt-5.1 not found
@dosubot[bot] commented on GitHub (Nov 21, 2025):
Hi @liuzeqi1997! I'm Dosu and I’m helping the dify-official-plugins team.
The errors you’re seeing are likely because Dify’s OpenAI-API-compatible integration uses the
max_tokensparameter, but newer models like GPT-5 requiremax_completion_tokensinstead. This mismatch causes credential validation to fail with status code 400. The “Base model gpt-5.1 not found” error usually means the model name isn’t recognized or available to your API key or provider—Dify only supports models that are listed and exposed by the backend or provider’s API, and custom models must be registered in the plugin’s config files to be recognized example.Workarounds: try using the “OpenAI” provider directly instead of the “OpenAI-API-compatible” provider, which sometimes avoids parameter validation issues for new models reference. If you need to use the compatible provider, you may need to manually adjust backend config files (like YAMLs in dify-official-plugins) to replace
max_tokenswithmax_completion_tokensand restart the service. Also, double-check your API key, model name formatting (no leading/), and make sure the model is actually available to your account—some models require special access or organization verification reference.If the model isn’t available in the provider’s API, Dify will return “Base model not found” even if the name is correct. If you’re running in an offline or air-gapped environment, make sure you’ve run all required database migrations and that your model/provider linkage is correct reference.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
