Adding o1 model with Azure Open ai not working #8132

Closed
opened 2026-02-21 18:24:07 -05:00 by yindo · 3 comments
Owner

Originally created by @hyojunada on GitHub (Feb 10, 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

0.15.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I am trying to add o1-mini to Dify. I was able to add it with my other server, which is on Dify 0.13.2
However with 0.15.2 I get this error

Error code: 400 - {'error': {'message': "Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.", 'type': 'invalid_request_error', 'param': 'max_tokens', 'code': 'unsupported_parameter'}}

✔️ Expected Behavior

o1 to be added

Actual Behavior

Got error

Originally created by @hyojunada on GitHub (Feb 10, 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 0.15.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I am trying to add o1-mini to Dify. I was able to add it with my other server, which is on Dify 0.13.2 However with 0.15.2 I get this error Error code: 400 - {'error': {'message': "Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.", 'type': 'invalid_request_error', 'param': 'max_tokens', 'code': 'unsupported_parameter'}} ### ✔️ Expected Behavior o1 to be added ### ❌ Actual Behavior Got error
yindo added the 🐞 bug label 2026-02-21 18:24:07 -05:00
yindo closed this issue 2026-02-21 18:24:07 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 10, 2025):

I found similar threads that might help you resolve the issue:

  1. Run faild: [openai] Bad Request Error, Error code: 400 - 'max_tokens' is not supported with this model. - This issue was closed by a pull request that added a parameter "reasoning_effort" and Openai o3-mini on February 06, 2025.

  2. [azure_openai] Bad Request Error, Error code: 400 - {'error': {'message': "Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.", 'type': 'invalid_request_error', 'param': 'max_tokens', 'code': 'unsupported_parameter'}} - This issue was resolved by a pull request that fixed the Azure OpenAI o1 max_completion_token error on November 12, 2024.

To resolve the error you're encountering, you should update your configuration to use 'max_completion_tokens' instead of 'max_tokens' in your model settings. The o1-mini model specifically requires the 'max_completion_tokens' parameter in Dify version 0.15.2 [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot[bot] commented on GitHub (Feb 10, 2025): <!-- Answer --> I found similar threads that might help you resolve the issue: 1. [Run faild: [openai] Bad Request Error, Error code: 400 - 'max_tokens' is not supported with this model.](https://github.com/langgenius/dify/issues/13242) - This issue was closed by a pull request that added a parameter "reasoning_effort" and Openai o3-mini on February 06, 2025. 2. [[azure_openai] Bad Request Error, Error code: 400 - {'error': {'message': "Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.", 'type': 'invalid_request_error', 'param': 'max_tokens', 'code': 'unsupported_parameter'}}](https://github.com/langgenius/dify/issues/9746) - This issue was resolved by a pull request that fixed the Azure OpenAI o1 max_completion_token error on November 12, 2024. To resolve the error you're encountering, you should update your configuration to use 'max_completion_tokens' instead of 'max_tokens' in your model settings. The o1-mini model specifically requires the 'max_completion_tokens' parameter in Dify version 0.15.2 <sup>[[1]](https://github.com/langgenius/dify/issues/12767)</sup>. <!-- 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/13b95651-6505-43d0-9ca5-b8d1b827d606?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/13b95651-6505-43d0-9ca5-b8d1b827d606?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/13b95651-6505-43d0-9ca5-b8d1b827d606?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/13b95651-6505-43d0-9ca5-b8d1b827d606?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/13b95651-6505-43d0-9ca5-b8d1b827d606?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/13b95651-6505-43d0-9ca5-b8d1b827d606?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Feb 10, 2025):

Duplicated

@crazywoola commented on GitHub (Feb 10, 2025): Duplicated
Author
Owner

@hyojunada commented on GitHub (Feb 11, 2025):

@crazywoola Can you tell me which thread it's duplicated to?

@hyojunada commented on GitHub (Feb 11, 2025): @crazywoola Can you tell me which thread it's duplicated to?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8132