[OpenAI-API-compatible] GPT series models added from the Azure channel have error messages indicating unsupported parameters #878

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

Originally created by @liukewia on GitHub (Dec 15, 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.11.1

Plugin version

OpenAI-API-compatible 0.0.27

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. add gpt models from azure channel
  2. parameters was set as default
Image
  1. chat in dify app using the gpt model
  2. error:
{"args":{"description":"[models] Error: API request failed with status code 400: {\"error\":{\"message\":\"Unrecognized request argument supplied: chat_template_kwargs (request id: 2025121603272922424331453691962)\",\"type\":\"invalid_request_error\",\"param\":\"\",\"code\":null}}"},"error_type":"InvokeError","message":"[models] Error: API request failed with status code 400: {\"error\":{\"message\":\"Unrecognized request argument supplied: chat_template_kwargs (request id: 2025121603272922424331453691962)\",\"type\":\"invalid_request_error\",\"param\":\"\",\"code\":null}}"}

✔️ Error log

No response

Originally created by @liukewia on GitHub (Dec 15, 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.11.1 ### Plugin version OpenAI-API-compatible 0.0.27 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. add gpt models from azure channel 2. parameters was set as default <img width="642" height="960" alt="Image" src="https://github.com/user-attachments/assets/6c9bf39d-543b-4494-b4b2-49e08500f44c" /> 3. chat in dify app using the gpt model 4. error: ``` {"args":{"description":"[models] Error: API request failed with status code 400: {\"error\":{\"message\":\"Unrecognized request argument supplied: chat_template_kwargs (request id: 2025121603272922424331453691962)\",\"type\":\"invalid_request_error\",\"param\":\"\",\"code\":null}}"},"error_type":"InvokeError","message":"[models] Error: API request failed with status code 400: {\"error\":{\"message\":\"Unrecognized request argument supplied: chat_template_kwargs (request id: 2025121603272922424331453691962)\",\"type\":\"invalid_request_error\",\"param\":\"\",\"code\":null}}"} ``` ### ✔️ Error log _No response_
yindo added the bug label 2026-02-16 10:20:49 -05:00
yindo closed this issue 2026-02-16 10:20:49 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 15, 2025):

Hi @liukewia! I'm Dosu and I’m helping the dify-official-plugins team.

This error happens because the OpenAI-API-compatible plugin sends the chat_template_kwargs parameter to Azure GPT endpoints, but Azure's API does not recognize it and returns a 400 error. The plugin currently does not filter out unsupported parameters for Azure models—chat_template_kwargs is always included when "Agent Thought" is set to "Not Support" or similar modes, regardless of endpoint type. There is no user-facing configuration or workaround to prevent this; a code change is required.

To fix this, the plugin should detect if the target model is an Azure endpoint and remove chat_template_kwargs from the payload before making the API call. This logic should be added where the request is constructed, for example in the _invoke method of the OpenAI-compatible endpoint, by checking the app metadata or endpoint URL and conditionally excluding chat_template_kwargs when targeting Azure models. See the relevant code and explanation here.

Until this is patched in the plugin, Azure GPT models added via the OpenAI-compatible channel will continue to return this error if chat_template_kwargs is present. If you're comfortable editing code, you can implement this filtering yourself as a temporary fix. Otherwise, keep an eye out for plugin updates that address Azure parameter compatibility.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 15, 2025): <!-- Greeting --> Hi @liukewia! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify-official-plugins team. <!-- Answer --> This error happens because the OpenAI-API-compatible plugin sends the chat_template_kwargs parameter to Azure GPT endpoints, but Azure's API does not recognize it and returns a 400 error. The plugin currently does not filter out unsupported parameters for Azure models—chat_template_kwargs is always included when "Agent Thought" is set to "Not Support" or similar modes, regardless of endpoint type. There is no user-facing configuration or workaround to prevent this; a code change is required. To fix this, the plugin should detect if the target model is an Azure endpoint and remove chat_template_kwargs from the payload before making the API call. This logic should be added where the request is constructed, for example in the _invoke method of the OpenAI-compatible endpoint, by checking the app metadata or endpoint URL and conditionally excluding chat_template_kwargs when targeting Azure models. See the relevant code and explanation [here](https://github.com/langgenius/dify-official-plugins/blob/c426921b2fc9a84857741790431e5b9113723ae2/extensions/openai_compatible/endpoints/openai_compatible.py#L8-L66). Until this is patched in the plugin, Azure GPT models added via the OpenAI-compatible channel will continue to return this error if chat_template_kwargs is present. If you're comfortable editing code, you can implement this filtering yourself as a temporary fix. Otherwise, keep an eye out for plugin updates that address Azure parameter compatibility. <!-- 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/e9679c1d-b14d-452a-98ac-d9d66b188c58?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/e9679c1d-b14d-452a-98ac-d9d66b188c58?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/e9679c1d-b14d-452a-98ac-d9d66b188c58?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/e9679c1d-b14d-452a-98ac-d9d66b188c58?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/e9679c1d-b14d-452a-98ac-d9d66b188c58?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/e9679c1d-b14d-452a-98ac-d9d66b188c58?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/e9679c1d-b14d-452a-98ac-d9d66b188c58?feedback_type=other)</sup> [![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20error%20happens%20because%20the%20OpenAI-API-compatible%20plugin%20sends%20the%20chat_template_kwargs%20parameter%20to%20Azure%20GPT%20endpoints%2C%20but%20Azure%27s%20API%20does%20not%20recognize%20it%20and%20returns%20a%20400%20error.%20The%20plugin%20currently%20does%20not%20filter%20out%20unsupported%20parameters%20for%20Azure%20models%E2%80%94chat_template_kwargs%20is%20always%20included%20when%20%22Agent%20Thought%22%20is%20set%20to%20%22Not%20Support%22%20or%20similar%20modes%2C%20regardless%20of%20endpoint%20type.%20There%20is%20no%20user-facing%20configuration%20or%20workaround%20to%20prevent%20this%3B%20a%20code%20change%20is%20required.%0A%0ATo%20fix%20this%2C%20the%20plugin%20should%20detect%20if%20the%20target%20model%20is%20an%20Azure%20endpoint%20and%20remove%20chat_template_kwargs%20from%20the%20payload%20before%20making%20the%20API%20call.%20This%20logic%20should%20be%20added%20where%20the%20request%20is%20constructed%2C%20for%20example%20in%20the%20_invoke%20method%20of%20the%20OpenAI-compatible%20endpoint%2C%20by%20checking%20the%20app%20metadata%20or%20endpoint%20URL%20and%20conditionally%20excluding%20chat_template_kwargs%20when%20targeting%20Azure%20models.%20See%20the%20relevant%20code%20and%20explanation%20%5Bhere%5D%28https%3A//github.com/langgenius/dify-official-plugins/blob/c426921b2fc9a84857741790431e5b9113723ae2/extensions/openai_compatible/endpoints/openai_compatible.py%23L8-L66%29.%0A%0AUntil%20this%20is%20patched%20in%20the%20plugin%2C%20Azure%20GPT%20models%20added%20via%20the%20OpenAI-compatible%20channel%20will%20continue%20to%20return%20this%20error%20if%20chat_template_kwargs%20is%20present.%20If%20you%27re%20comfortable%20editing%20code%2C%20you%20can%20implement%20this%20filtering%20yourself%20as%20a%20temporary%20fix.%20Otherwise%2C%20keep%20an%20eye%20out%20for%20plugin%20updates%20that%20address%20Azure%20parameter%20compatibility.)&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/2263)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#878