mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-22 01:55:27 -04:00
Openrouter Plugin Cannot Add Openai O3 model #638
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 @Egoistsoul on GitHub (Sep 11, 2025).
Self Checks
Dify version
1.8.1
Plugin version
0.0.21
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Adding openai/o3 to Opentouter, and prompt:
Credentials validation failed with status code 400 and response body {"error":{"message":"Provider returned error","code":400,"metadata":{"raw":"{\n "error": {\n "message": "Invalid 'max_output_tokens': integer below minimum value. Expected a value >= 16, but got 5 instead.",\n "type": "invalid_request_error",\n "param": "max_output_tokens",\n "code": "integer_below_min_value"\n }\n}","provider_name":"OpenAI"}},"user_id":"user_2qHFUCzu98yat8kNon4VHRhiW5Z"}
✔️ Error log
No response
@dosubot[bot] commented on GitHub (Sep 11, 2025):
The error is caused by the value of
max_output_tokensbeing set below the minimum required (16) for the OpenAI o3 model. Dify enforces this limit during credential validation, and the plugin passes parameters through without modifying them. To resolve this, make sure that when adding the model, you setmax_output_tokens(or the equivalent field in the UI, sometimes labeled as "max tokens") to at least 16. If the UI or config defaults to a lower value, manually increase it before saving.Recent updates added model-specific parameter validation and schema-driven extraction, so if you are using an older plugin or Dify version, consider updating to the latest release to benefit from improved validation and configuration options PR #1477. For o3 models, also check if the streaming mode toggle is required or affects validation PR #1549.
If you still encounter issues, double-check the parameter names and values in your model configuration, as using deprecated or incorrect names (like
max_tokensinstead ofmax_output_tokensormax_completion_tokens) can also cause validation errors example.To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

@Egoistsoul commented on GitHub (Oct 22, 2025):
This issue still exist in the latest version of dify and openrouter plugin
@dosubot[bot] commented on GitHub (Oct 22, 2025):
@crazywoola The user reports that the issue with
max_output_tokensvalidation still exists in the latest versions of Dify and the OpenRouter plugin and requests further assistance. Could you please help look into this?@Egoistsoul commented on GitHub (Nov 12, 2025):
This issue still exist in the plugin latest version 0.0.26 and dify 1.9.2
@dosubot[bot] commented on GitHub (Nov 12, 2025):
@crazywoola The user reports that the issue still exists in plugin version 0.0.26 and dify 1.9.2 despite being closed as stale. Could you please take a look and assist?
@hiiamboris commented on GitHub (Jan 11, 2026):
Still there in OpenRouter 0.0.31. Hopelessly pathetic.
@hiiamboris commented on GitHub (Jan 11, 2026):
But the bug is not in the plugin, it's in the core.
@gzh-lee commented on GitHub (Jan 18, 2026):
dify/docker/volumes/plugin_daemon/cwd/langgenius/openai_api_compatible-0.0.30@XXXXXXX/.venv/lib/python3.12/site-packages/dify_plugin/interfaces/model/openai_compatible/llm.py
open folder:dify/docker/volumes/plugin_daemon/cwd/langgenius/ ,
find folder: openai_api_compatible-0.0.**@**********************
goto .venv/lib/python3.12/site-packages/dify_plugin/interfaces/model/openai_compatible
open llm.py, find:
validate_credentials_max_tokens = credentials.get("validate_credentials_max_tokens", 5) or 5
change 5 to 16