Error 400: 'stop' parameter not supported by o4-mini` model #13462

Closed
opened 2026-02-21 19:12:16 -05:00 by yindo · 5 comments
Owner

Originally created by @MitraSafarinejad on GitHub (Apr 28, 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

1.2.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I have updated the OpenAI plugin, which added two O4-Mini models. When I try to use both models, I encounter the following error:

[models] Bad Request Error, Error code: 400 - {'error': {'message': "Unsupported parameter: 'stop' is not supported with this model.", 'type': 'invalid_request_error', 'param': 'stop', 'code': 'unsupported_parameter'}}

Image

✔️ Expected Behavior

The model should work fine without returning an error.

Actual Behavior

The model returns a 400 Bad Request error with the message indicating that the stop parameter is not supported.

Originally created by @MitraSafarinejad on GitHub (Apr 28, 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 1.2.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I have updated the OpenAI plugin, which added two O4-Mini models. When I try to use both models, I encounter the following error: [models] Bad Request Error, Error code: 400 - {'error': {'message': "Unsupported parameter: 'stop' is not supported with this model.", 'type': 'invalid_request_error', 'param': 'stop', 'code': 'unsupported_parameter'}} ![Image](https://github.com/user-attachments/assets/6f7e2d01-7cb6-45ca-95ba-2b140c46e2d1) ### ✔️ Expected Behavior The model should work fine without returning an error. ### ❌ Actual Behavior The model returns a 400 Bad Request error with the message indicating that the stop parameter is not supported.
yindo closed this issue 2026-02-21 19:12:16 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 28, 2025):

The error you're encountering is due to the 'stop' parameter not being supported by the O4-Mini model. In the Dify codebase, the ModelConfigConverter class processes model configurations and removes unsupported parameters like 'stop' before finalizing the configuration [1].

To resolve this issue, you can modify the configuration to exclude the 'stop' parameter when using the O4-Mini model. This involves ensuring that the 'stop' parameter is not included in the completion parameters for these models. If you have control over the code where the model is invoked, you can adjust the parameters accordingly to prevent the 'stop' parameter from being passed to the O4-Mini model.

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 (Apr 28, 2025): <!-- Answer --> The error you're encountering is due to the 'stop' parameter not being supported by the O4-Mini model. In the Dify codebase, the `ModelConfigConverter` class processes model configurations and removes unsupported parameters like 'stop' before finalizing the configuration <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/app/app_config/easy_ui_based_app/model_config/converter.py)</sup>. To resolve this issue, you can modify the configuration to exclude the 'stop' parameter when using the O4-Mini model. This involves ensuring that the 'stop' parameter is not included in the completion parameters for these models. If you have control over the code where the model is invoked, you can adjust the parameters accordingly to prevent the 'stop' parameter from being passed to the O4-Mini model. <!-- 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/6ffba365-0d5d-4f74-ae35-a29345736cbb?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/6ffba365-0d5d-4f74-ae35-a29345736cbb?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/6ffba365-0d5d-4f74-ae35-a29345736cbb?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/6ffba365-0d5d-4f74-ae35-a29345736cbb?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/6ffba365-0d5d-4f74-ae35-a29345736cbb?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/6ffba365-0d5d-4f74-ae35-a29345736cbb?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/6ffba365-0d5d-4f74-ae35-a29345736cbb?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Apr 28, 2025):

Can you export the DSL? I tried the model you mentioned above, but I can not reproduce this error.

Image
@crazywoola commented on GitHub (Apr 28, 2025): Can you export the DSL? I tried the model you mentioned above, but I can not reproduce this error. <img width="1373" alt="Image" src="https://github.com/user-attachments/assets/f10ffe97-85e9-444d-8747-fa312a1dc7b7" />
Author
Owner

@MitraSafarinejad commented on GitHub (Apr 28, 2025):

I create an agent, here is my DSL

test mitra.zip

@MitraSafarinejad commented on GitHub (Apr 28, 2025): I create an agent, here is my DSL [test mitra.zip](https://github.com/user-attachments/files/19938657/test.mitra.zip)
Author
Owner

@crazywoola commented on GitHub (Apr 29, 2025):

Hello, I have upgrade the plugin in this pr https://github.com/langgenius/dify-official-plugins/pull/820.

Please upgrade openai to v0.0.22 later.

@crazywoola commented on GitHub (Apr 29, 2025): Hello, I have upgrade the plugin in this pr https://github.com/langgenius/dify-official-plugins/pull/820. Please upgrade openai to v0.0.22 later.
Author
Owner

@rty813 commented on GitHub (May 18, 2025):

@crazywoola I am using the openai-api-compatible plugin and the third-party o4 api, and this error is also reported. Can you backport it?

@rty813 commented on GitHub (May 18, 2025): @crazywoola I am using the `openai-api-compatible` plugin and the third-party o4 api, and this error is also reported. Can you backport it?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13462