cline icon indicating copy to clipboard operation
cline copied to clipboard

Google Gemini API Error: "Error fetching from https://generative... generateContent: fetch failed"

Open slayeryahu opened this issue 1 year ago • 10 comments

Hi, I use clash as my http/https proxy client. I need this proxy to access google gemini. Google Gemini is currently accessible through my browser, but it doesn't work in vscode claude dev (lastest version) image

image I have done the proxy config in the settings.

Begging your reply. Thank you!

slayeryahu avatar Sep 16 '24 01:09 slayeryahu

I will look into this as soon as I can! In the meantime can you try using OpenAI compatible and see if you can get it working that way?

saoudrizwan avatar Sep 16 '24 11:09 saoudrizwan

I have the same problem. Claude dev use Google Gemini request url is":generateContent", [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:generateContent: fetch failed. But I see Continue use"streamGenerateContent" is work, [https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:streamGenerateContent?key=your key], Continue can use Gemini, But Claude dev can't use Gemini, please check, thank you.

cuidezhu avatar Sep 17 '24 03:09 cuidezhu

I will look into this as soon as I can! In the meantime can you try using OpenAI compatible and see if you can get it working that way?

Sorry I can't use OPENAI's product. And my gemini api account was locked after testing claude dev....

slayeryahu avatar Sep 17 '24 10:09 slayeryahu

I will look into this as soon as I can! In the meantime can you try using OpenAI compatible and see if you can get it working that way?

Google said I can't use gemini with other competitive models, my project was banned forever.

slayeryahu avatar Sep 18 '24 02:09 slayeryahu

I will look into this as soon as I can! In the meantime can you try using OpenAI compatible and see if you can get it working that way?

I use litellm converting gemini api into openai compatible api, but only get error 400: no body

kaileysong avatar Sep 20 '24 15:09 kaileysong

I will look into this as soon as I can! In the meantime can you try using OpenAI compatible and see if you can get it working that way?

Is there a way to use OpenAI compatible without an API key? My proxy does not require an api key but if one is provided it ceases to work :c

degeneratehyperbola avatar Sep 20 '24 23:09 degeneratehyperbola

Hi, I am using clash as my http/https proxy client. I need this proxy to access google gemini. Currently it is possible to access Google Gemini through my browser, but it doesn't work in vscode claude dev (latest version) ! [image](https://private-user-images.githubusercontent.com/7860485/367636601-aa59b42e-bb9f-44f1-9a92-b5cded709c60.png?jwt= eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjcwNTg1ODgsIm5iZiI6MTcyNzA1ODI4OCwicGF0aCI6Ii83ODYwNDg1LzM2NzYzNjYwMS1hYTU5YjQyZS1iYjlmLTQ0ZjEtOWE5Mi1iNWNkZWQ3MDljNjAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkyMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MjNUMDIyNDQ4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZThmYjkyZGE4NzU5YWUwNGZlZGMxMDc5ZDI5ZGZmNGQwN2NmODJmNzg1MGFhYzA0MWE2MWI0MGRiOGZlYWYzNSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ .SQA-HhCLicr6gt1aN_hklyv2Lr8BWw-VP2k1vPnLCpM)

! [image](https://private-user-images.githubusercontent.com/7860485/367636796-550ac499-18e0-41f2-8012-4818499ebfc6.png?jwt= eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjcwNTg1ODgsIm5iZiI6MTcyNzA1ODI4OCwicGF0aCI6Ii83ODYwNDg1LzM2NzYzNjc5Ni01NTBhYzQ5OS0xOGUwLTQxZjItODAxMi00ODE4NDk5ZWJmYzYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkyMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MjNUMDIyNDQ4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ODRhZjY5Mzg0MzFiNDNhOGMwMmM5YmRiMzUxNzQ4NjczOTQwNGMzZjk2NjljOTMyODJhMzdlNjA4MGIzOGRjZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ .UFKHNo9xx5gbbV6CvccYBt_iQqGK42SuUr0yt8jqKAo) I have done the proxy configuration in the settings.

I would appreciate your response. Thanks!

I'm also experiencing this problem, please let me know how it's being handled now, thanks!

liliwen365 avatar Sep 23 '24 02:09 liliwen365

the same problem

wykthreed avatar Sep 27 '24 01:09 wykthreed

Maybe, it's caused by network problem. In my country, we need to set http proxy in Visual Studio Code to access google service. Other plugins works. However, Claude Dev has the problem. When I change network to another wifi (openwrt installed with shadowsocks), Claude Dev works! It seem that Claude Dev didn't use the http proxy set in Visual Studio Code. I'm on macOS.

wykthreed avatar Sep 27 '24 02:09 wykthreed

The same problem here , I'm using Pluckeye as a proxy!

mwalid207 avatar Dec 24 '24 15:12 mwalid207

Hi @slayeryahu , I'm doing some repo management and closing out any irreproducible or resolved Cline issues.

If you update to the newest version of Cline (3.17.15) or newer, do you still encounter this issue? I'll be closing this issue as stale, if I don't get a reply in 1 week.

kevinneung avatar Jun 21 '25 00:06 kevinneung

Thanks for reporting this proxy connectivity issue! This has been consolidated into #4355, which provides a comprehensive solution for HTTP proxy support across all API providers including Google Gemini.

celestial-vault avatar Jun 21 '25 19:06 celestial-vault