OpenAI Tools plugin is not using base URL value entered for authentication #769

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

Originally created by @kamonabe3 on GitHub (Nov 2, 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.9.2

Plugin version

0.1.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

The openai_base_url and openai_organization_id parameters are not being used for authentication in the OpenAI Tools plugin.

https://github.com/langgenius/dify-official-plugins/blob/5893e9833566eca6dc3e782bd39a5557833cc487/tools/openai/provider/openai.py#L7-L20

Fixing this issue will make the plugin compatible with OpenAI-compatible APIs such as LiteLLM.
Additionally, it would be helpful either to allow specifying the model used for authentication or to clearly state in the documentation that the “gpt-4.1-nano” model is used for authentication.

The following code shows the proposed fix:

class OpenAIProvider(ToolProvider):
    def _validate_credentials(self, credentials: dict[str, Any]) -> None:
        try:
            openai_api_key = credentials["openai_api_key"]
            openai_organization = credentials.get("openai_organization_id")
            openai_base_url = credentials.get("openai_base_url")

            # Initialize OpenAI client with credentials
            client = OpenAI(
                api_key=openai_api_key,
                base_url=openai_base_url,
                organization=openai_organization,
            )

✔️ Error log

No response

Originally created by @kamonabe3 on GitHub (Nov 2, 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.9.2 ### Plugin version 0.1.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce The openai_base_url and openai_organization_id parameters are not being used for authentication in the OpenAI Tools plugin. https://github.com/langgenius/dify-official-plugins/blob/5893e9833566eca6dc3e782bd39a5557833cc487/tools/openai/provider/openai.py#L7-L20 Fixing this issue will make the plugin compatible with OpenAI-compatible APIs such as LiteLLM. Additionally, it would be helpful either to allow specifying the model used for authentication or to clearly state in the documentation that the “gpt-4.1-nano” model is used for authentication. The following code shows the proposed fix: ```python class OpenAIProvider(ToolProvider): def _validate_credentials(self, credentials: dict[str, Any]) -> None: try: openai_api_key = credentials["openai_api_key"] openai_organization = credentials.get("openai_organization_id") openai_base_url = credentials.get("openai_base_url") # Initialize OpenAI client with credentials client = OpenAI( api_key=openai_api_key, base_url=openai_base_url, organization=openai_organization, ) ``` ### ✔️ Error log _No response_
yindo added the bug label 2026-02-16 10:20:27 -05:00
yindo closed this issue 2026-02-16 10:20:27 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 18, 2025):

Hi, @kamonabe3. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported that in Dify v1.9.2, the OpenAI Tools plugin does not use the openai_base_url and openai_organization_id parameters for authentication.
  • This limitation affects compatibility with OpenAI-compatible APIs like LiteLLM.
  • You proposed a code fix to properly initialize the OpenAI client with these parameters.
  • You also requested support for specifying the authentication model or better documentation on the default "gpt-4.1-nano" model.
  • There has been no further activity or comments on this issue.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting here.
  • If I do not hear back within 5 days, I will automatically close this issue.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Nov 18, 2025): Hi, @kamonabe3. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that in Dify v1.9.2, the OpenAI Tools plugin does not use the `openai_base_url` and `openai_organization_id` parameters for authentication. - This limitation affects compatibility with OpenAI-compatible APIs like LiteLLM. - You proposed a code fix to properly initialize the OpenAI client with these parameters. - You also requested support for specifying the authentication model or better documentation on the default "gpt-4.1-nano" model. - There has been no further activity or comments on this issue. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting here. - If I do not hear back within 5 days, I will automatically close this issue. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#769