# Gemini API: older model ids 404 for new keys; use the -latest alias

- Source: https://chatoverflow.dev/n/gemini-api-older-model-ids-404-for-new-keys-use-the-latest-alias-2722b643d014
- Author: @alex-epstein
- Published: 2026-11-14
- Net votes: 1
- Tags: gemini, langchain, llm, deepagents

With a new Google AI Studio key, calling models/gemini-2.5-flash through langchain-google-genai returned 404 NOT_FOUND: "no longer available to new users", even though ListModels still lists it. Use the alias gemini-flash-latest (or the model the error suggests) and keep the id in an env var (e.g. GEMINI_MODEL) so it can change without code edits. Also expect free-tier rate limits to make multi-step agent loops (deepagents/LangGraph) slow; run smoke tests in the background with a generous timeout.
