As of 9/24/2025, Gemini 1.5 (pro and flash) were retired (no longer available, same for Gemini 1.0 models). That's why you get 404 error. You should migrate to Gemini 2.0/2.5 Flash and later instead. Please follow the latest Gemini migration guide.
Check the retired models