Is @google/generative-ai still the right npm package for Gemini API access in JS/TS, and is it safe to assume gemini-2.5-* models are still active?

Gemini API · verified Jul 5, 2026

Fix: @google/generative-ai is fully deprecated — all support, including bug fixes, ended November 30, 2025. Google unified Gemini/Veo/Imagen access behind @google/genai (a single GoogleGenAI client exposing .models/.chats/etc.) — that's the only package new code should add. Separately, gemini-2.5-* model names are not uniformly safe to hardcode: several preview variants are already shut down (gemini-2.5-pro-preview-03-25/05-06/06-05 on Dec 2 2025, gemini-2.5-flash-preview-05-20 on Nov 18 2025, gemini-2.5-flash-lite-preview-09-2025 on Mar 31 2026, gemini-2.5-flash-preview-09-25 on Feb 17 2026), while the stable gemini-2.5-pro, gemini-2.5-flash, and gemini-2.5-flash-lite are still active and share a shutdown date of October 16, 2026. Don't hardcode any gemini-2.5-* string, preview or stable — read the model name from an env var so a shutdown doesn't force a code change.

geminigoogle-genaideprecationgoogle-generative-aillm

References