failed to add custom llm model gpt5.1, return "Credentials validation failed with status code 400" #823

Closed
opened 2026-02-16 10:20:37 -05:00 by yindo · 1 comment
Owner

Originally created by @liuzeqi1997 on GitHub (Nov 21, 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 Dify issues & Dify Official Plugins, 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.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".

Image Image Image Image

Then I attempted to use the OpenAI method, but still received an error message stating "Base model gpt-5.1 not found".

Image

✔️ Error log

error1 Credentials validation failed with status code 400
error2 Base model gpt-5.1 not found

Originally created by @liuzeqi1997 on GitHub (Nov 21, 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 [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/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.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". <img width="1281" height="621" alt="Image" src="https://github.com/user-attachments/assets/90e7a918-7fa2-4bf1-be84-d34cd2e931d7" /> <img width="592" height="606" alt="Image" src="https://github.com/user-attachments/assets/46ae40cd-59d5-424c-af9f-2daaf7b45306" /> <img width="587" height="751" alt="Image" src="https://github.com/user-attachments/assets/cf8ce4a9-8bcd-48fa-bdba-d132e951666b" /> <img width="686" height="626" alt="Image" src="https://github.com/user-attachments/assets/7a43502d-55b2-4f60-8ccf-b786d22b2b4b" /> **Then I attempted to use the OpenAI method, but still received an error message stating "Base model gpt-5.1 not found".** <img width="1250" height="870" alt="Image" src="https://github.com/user-attachments/assets/b3c23b24-c911-46b5-946d-1e7fcb1dc64c" /> ### ✔️ Error log error1 Credentials validation failed with status code 400 error2 Base model gpt-5.1 not found
yindo added the bug label 2026-02-16 10:20:37 -05:00
yindo closed this issue 2026-02-16 10:20:37 -05:00
Author
Owner

@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_tokens parameter, but newer models like GPT-5 require max_completion_tokens instead. 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_tokens with max_completion_tokens and 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  Join Discord Share on X

@dosubot[bot] commented on GitHub (Nov 21, 2025): <!-- Greeting --> Hi @liuzeqi1997! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify-official-plugins team. <!-- Answer --> The errors you’re seeing are likely because Dify’s OpenAI-API-compatible integration uses the `max_tokens` parameter, but newer models like GPT-5 require `max_completion_tokens` instead. 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](https://github.com/langgenius/dify-official-plugins/pull/751). Workarounds: try using the “OpenAI” provider directly instead of the “OpenAI-API-compatible” provider, which sometimes avoids parameter validation issues for new models [reference](https://github.com/langgenius/dify/issues/26806). 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_tokens` with `max_completion_tokens` and 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](https://github.com/langgenius/dify/issues/19827). 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](https://github.com/langgenius/dify-official-plugins/issues/1629). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/d380ca6e-e55e-4f4c-b3d8-bdfe1d671aa9?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/d380ca6e-e55e-4f4c-b3d8-bdfe1d671aa9?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/d380ca6e-e55e-4f4c-b3d8-bdfe1d671aa9?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/d380ca6e-e55e-4f4c-b3d8-bdfe1d671aa9?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/d380ca6e-e55e-4f4c-b3d8-bdfe1d671aa9?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/d380ca6e-e55e-4f4c-b3d8-bdfe1d671aa9?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/d380ca6e-e55e-4f4c-b3d8-bdfe1d671aa9?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-official-plugins/issues/2118)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#823