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

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

Originally created by @202472150920 on GitHub (Dec 27, 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

Version1.11.2

Plugin version

0.1.2

Cloud or Self Hosted

Cloud

Steps to reproduce

  1. Install langgenius/openai_tool from marketplace
  2. Input authentication parameter
ChatAnywhere
OpenAI API Key: sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
OpenAI Base URL: https://api.chatanywhere.tech
Press Save

I found 2 issue about this bug: #1984 & #1326 , specially in #1984 , yuki-js had provide solutions, but it still not fixed in Version1.11.2.

dify-official-plugins/tools/openai/provider/openai.py

✔️ Error log

Image
Originally created by @202472150920 on GitHub (Dec 27, 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 Version1.11.2 ### Plugin version 0.1.2 ### Cloud or Self Hosted Cloud ### Steps to reproduce 1. Install langgenius/openai_tool from marketplace 2. Input authentication parameter ``` ChatAnywhere OpenAI API Key: sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx OpenAI Base URL: https://api.chatanywhere.tech Press Save ``` I found 2 issue about this bug: #1984 & #1326 , specially in [#1984](https://github.com/langgenius/dify-official-plugins/issues/1984) , [yuki-js](https://github.com/yuki-js) had provide solutions, but it still not fixed in Version1.11.2. [dify-official-plugins/tools/openai/provider/openai.py](https://github.com/langgenius/dify-official-plugins/blob/5893e9833566eca6dc3e782bd39a5557833cc487/tools/openai/provider/openai.py#L7-L20) ### ✔️ Error log <img width="392" height="244" alt="Image" src="https://github.com/user-attachments/assets/36917c7e-127a-4625-93fa-12ebdf683b38" />
yindo added the bug label 2026-02-16 10:20:55 -05:00
yindo closed this issue 2026-02-16 10:20:55 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 27, 2025):

Hi @202472150920! I'm Dosu and I’m helping the dify-official-plugins team.

The OpenAI Tools plugin in Dify v1.11.2 (plugin v0.1.2) does not use the custom base URL you enter for authentication. The code only passes the API key to the OpenAI client and ignores the base_url parameter, so custom endpoints like ChatAnywhere are not supported for authentication or validation right now. This is a known issue and is why you still see the 401 Unauthorized error even with the correct key and base URL. There are no official fixes or workarounds in the latest release, and no recent pull requests address this bug. For now, using custom OpenAI-compatible endpoints with this plugin is not possible without a code change.
See code reference

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 27, 2025): <!-- Greeting --> Hi @202472150920! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify-official-plugins team. <!-- Answer --> The OpenAI Tools plugin in Dify v1.11.2 (plugin v0.1.2) does not use the custom base URL you enter for authentication. The code only passes the API key to the OpenAI client and ignores the base_url parameter, so custom endpoints like ChatAnywhere are not supported for authentication or validation right now. This is a known issue and is why you still see the 401 Unauthorized error even with the correct key and base URL. There are no official fixes or workarounds in the latest release, and no recent pull requests address this bug. For now, using custom OpenAI-compatible endpoints with this plugin is not possible without a code change. [See code reference](https://github.com/langgenius/dify-official-plugins/blob/3d2d2f55a5dcbd4ae58567be900e71da1b5b15e3/tools/openai/provider/openai.py#L7-L20) <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/214b572c-3c17-4104-a861-31009a12a89b?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/214b572c-3c17-4104-a861-31009a12a89b?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/214b572c-3c17-4104-a861-31009a12a89b?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/214b572c-3c17-4104-a861-31009a12a89b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/214b572c-3c17-4104-a861-31009a12a89b?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/214b572c-3c17-4104-a861-31009a12a89b?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/214b572c-3c17-4104-a861-31009a12a89b?feedback_type=other)</sup> [![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%20OpenAI%20Tools%20plugin%20in%20Dify%20v1.11.2%20%28plugin%20v0.1.2%29%20does%20not%20use%20the%20custom%20base%20URL%20you%20enter%20for%20authentication.%20The%20code%20only%20passes%20the%20API%20key%20to%20the%20OpenAI%20client%20and%20ignores%20the%20base_url%20parameter%2C%20so%20custom%20endpoints%20like%20ChatAnywhere%20are%20not%20supported%20for%20authentication%20or%20validation%20right%20now.%20This%20is%20a%20known%20issue%20and%20is%20why%20you%20still%20see%20the%20401%20Unauthorized%20error%20even%20with%20the%20correct%20key%20and%20base%20URL.%20There%20are%20no%20official%20fixes%20or%20workarounds%20in%20the%20latest%20release%2C%20and%20no%20recent%20pull%20requests%20address%20this%20bug.%20For%20now%2C%20using%20custom%20OpenAI-compatible%20endpoints%20with%20this%20plugin%20is%20not%20possible%20without%20a%20code%20change.%20%20%0A%5BSee%20code%20reference%5D%28https%3A//github.com/langgenius/dify-official-plugins/blob/3d2d2f55a5dcbd4ae58567be900e71da1b5b15e3/tools/openai/provider/openai.py%23L7-L20%29)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/2342)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#909