Gemini Models API Returns Deprecated/Retired Models — Is There a Way to Identify Active Models?

Hi everyone,

I’m using the Gemini Models API endpoint:

https://generativelanguage.googleapis.com/v1beta/models

to dynamically import available Gemini models into an admin panel.

One issue I’ve encountered is that the API response includes models that appear to be deprecated, retired, or no longer recommended for production use. For example, I’ve seen models such as:

  • gemini-2.0-flash

  • gemini-2.0-flash-lite

  • various experimental/preview models

included in the response even though some of them may no longer be actively supported or recommended.

My goal is to display only active and production-ready models to administrators and end users.

I have a few questions:

  1. Is there a field in the Models API response that indicates whether a model is active, deprecated, retired, or scheduled for shutdown?

  2. Is there an official API endpoint that returns only currently supported production models?

  3. Does Google maintain a machine-readable list of recommended Gemini models for production use?

  4. What is the recommended approach for applications that dynamically import and display available Gemini models?

At the moment, it seems like the only option is to maintain a custom allow-list or manually filter model names, which can become difficult as new models are introduced.

Any guidance from the Gemini team or developers who have solved this problem would be greatly appreciated.

Thanks!