mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
[Feature Request] Support 'max_completion_tokens' param in OpenAI-Compatible provider for O1-like models #935
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 @sunlongyu on GitHub (Jan 14, 2026).
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.
I am trying to integrate a custom model via the "OpenAI-API-Compatible" model provider in Dify.
My internal API endpoint wraps an OpenAI o1-series (reasoning) model, which enforces strict parameter validation. When Dify sends a request, it includes the
max_tokensparameter by default. However, the API rejects this request because newer reasoning models (like o1) requiremax_completion_tokensand explicitly forbid the usage ofmax_tokens.As a result, I receive a
400 Bad Requesterror and cannot use the model in Dify without setting up an external middleware proxy to manually swap the parameter names.2. Additional context or comments
Error Log received from the API:
@crazywoola commented on GitHub (Jan 14, 2026):
This should go into this repo.
@sunlongyu commented on GitHub (Jan 14, 2026):
您好,已经收到您的来信。
@dosubot[bot] commented on GitHub (Jan 30, 2026):
Hi, @sunlongyu. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.
Issue Summary:
Next Steps:
Thank you for your understanding and contribution!
@sunlongyu commented on GitHub (Jan 30, 2026):
您好,已经收到您的来信。
@dosubot[bot] commented on GitHub (Jan 30, 2026):
@crazywoola The user has confirmed that this issue regarding the 'max_completion_tokens' parameter in the OpenAI-Compatible provider for o1-series models is still relevant and needs attention. Could you please assist?
@sunlongyu commented on GitHub (Feb 2, 2026):
Yes, this issue is still highly relevant in the latest version.
Currently, the OpenAI-Compatible provider in Dify cannot support these models natively without setting up an external proxy to swap parameters, which is a significant friction point for users.
Please keep this open. We need native support for
max_completion_tokensor a "Reasoning Model" mode switch in the generic OpenAI provider settings.