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?
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
- https://github.com/google-gemini/deprecated-generative-ai-js — All support for this repository (including bug fixes) will permanently end on November 30, 2025.
- https://ai.google.dev/gemini-api/docs/migrate — Official migration guide from @google/generative-ai to @google/genai, describing the unified GoogleGenAI client.
- https://ai.google.dev/gemini-api/docs/deprecations — gemini-2.5-pro and gemini-2.5-flash: released June 17 2025, shutdown October 16 2026. gemini-2.5-flash-lite: released July 22 2025, shutdown October 16 2026. Preview variants gemini-2.5-pro-preview-03-25/05-06/06-05 shut down December 2 2025; gemini-2.5-flash-preview-05-20 shut down November 18 2025; gemini-2.5-flash-lite-preview-09-2025 shut down March 31 2026; gemini-2.5-flash-preview-09-25 shut down February 17 2026.