Request to Add API Base Configuration for Google Gemini Model Provider #7891

Closed
opened 2026-02-21 18:22:55 -05:00 by yindo · 7 comments
Owner

Originally created by @lbersl on GitHub (Jan 25, 2025).

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Provide a description of requested docs changes

Hello, I noticed that when setting up "Model Providers," OpenAI has an "API Base" configuration option, but when setting up Google Gemini, there is only an API key setting and no "API Base" configuration option.

  1. Could you add an "API Base" configuration option for Google Gemini?
  2. Alternatively, could you point me to which source code file I need to modify to implement a custom API Base?

Thank you!

Image

Originally created by @lbersl on GitHub (Jan 25, 2025). ### Self Checks - [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 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. ### Provide a description of requested docs changes Hello, I noticed that when setting up "Model Providers," OpenAI has an "API Base" configuration option, but when setting up Google Gemini, there is only an API key setting and no "API Base" configuration option. 1. Could you add an "API Base" configuration option for Google Gemini? 2. Alternatively, could you point me to which source code file I need to modify to implement a custom API Base? Thank you! ![Image](https://github.com/user-attachments/assets/aad24de9-1e63-4096-b5b9-72b93e96bce9)
yindo added the 💪 enhancementstale labels 2026-02-21 18:22:55 -05:00
yindo closed this issue 2026-02-21 18:22:55 -05:00
Author
Owner

@jiandanfeng commented on GitHub (Jan 26, 2025):

Why do you need this? Gemini's API base is packaged in sdk

@jiandanfeng commented on GitHub (Jan 26, 2025): Why do you need this? Gemini's API base is packaged in sdk
Author
Owner

@G-TTYg commented on GitHub (Jan 27, 2025):

I'm experiencing the same need. A custom API base option for Gemini would enable me to direct requests through a reverse proxy. This is crucial in my setup to work around specific limitations.

Why do you need this? Gemini's API base is packaged in sdk

@G-TTYg commented on GitHub (Jan 27, 2025): I'm experiencing the same need. A custom API base option for Gemini would enable me to direct requests through a reverse proxy. This is crucial in my setup to work around specific limitations. > Why do you need this? Gemini's API base is packaged in sdk
Author
Owner

@Cp0204 commented on GitHub (Feb 15, 2025):

Why do you need this? Gemini's API base is packaged in sdk

China has a firewall that prevents direct access to Google

@Cp0204 commented on GitHub (Feb 15, 2025): > Why do you need this? Gemini's API base is packaged in sdk China has a firewall that prevents direct access to Google
Author
Owner

@appwcn commented on GitHub (Feb 22, 2025):

Yes, I also need it badly.
appreciated

@appwcn commented on GitHub (Feb 22, 2025): Yes, I also need it badly. appreciated
Author
Owner

@Tina-patentpro commented on GitHub (Mar 2, 2025):

yes,this would be a good solution

@Tina-patentpro commented on GitHub (Mar 2, 2025): yes,this would be a good solution
Author
Owner

@Cp0204 commented on GitHub (Mar 12, 2025):

I found a temporary solution: adding environment variable proxy in the dify-api service:

http_proxy: http://172.17.0.1:10808
https_proxy: http://172.17.0.1:10808
no_proxy: 127.0.0.1,api,worker,web,db,redis,sandbox,plugin_daemon,ssrf_proxy,nginx,weaviate

Note: Use lowercase.

References:

@Cp0204 commented on GitHub (Mar 12, 2025): I found a temporary solution: adding environment variable proxy in the `dify-api` service: ```yaml http_proxy: http://172.17.0.1:10808 https_proxy: http://172.17.0.1:10808 no_proxy: 127.0.0.1,api,worker,web,db,redis,sandbox,plugin_daemon,ssrf_proxy,nginx,weaviate ``` Note: Use lowercase. References: - https://blog.csdn.net/zhyhang/article/details/146140019 - https://www.5ee.net/archives/SvwO2F0M - https://linux.do/t/topic/314470/4
Author
Owner

@dosubot[bot] commented on GitHub (Apr 12, 2025):

Hi, @lbersl. I'm Dosu, and I'm helping the Dify team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • You requested an "API Base" configuration option for the Google Gemini model provider, similar to OpenAI's.
  • @jiandanfeng questioned the necessity, noting the API base is in the SDK.
  • @G-TTYg and @Cp0204 highlighted the need for a custom API base to bypass restrictions like China's firewall.
  • @Cp0204 provided a temporary workaround using environment variables for a proxy setup.

Next Steps:

  • Please confirm if this issue is still relevant to the latest version of the Dify repository by commenting here.
  • If there is no further activity, the issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Apr 12, 2025): Hi, @lbersl. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - You requested an "API Base" configuration option for the Google Gemini model provider, similar to OpenAI's. - @jiandanfeng questioned the necessity, noting the API base is in the SDK. - @G-TTYg and @Cp0204 highlighted the need for a custom API base to bypass restrictions like China's firewall. - @Cp0204 provided a temporary workaround using environment variables for a proxy setup. **Next Steps:** - Please confirm if this issue is still relevant to the latest version of the Dify repository by commenting here. - If there is no further activity, the issue will be automatically closed in 15 days. 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#7891