Is it possible to filter /models to get only models available for generateContent?
Thanks.
Is it possible to filter /models to get only models available for generateContent?
Thanks.
Yes, you can typically filter models available for generateContent
using the API. Check the documentation for specific filtering parameters, or retrieve all models and filter them based on capabilities on your end. If you need more help, consider contacting the support team for guidance.
Hello @Elad_Laor
Welcome to the forum.
Yes, you can retrieve the list of available models and check the supportedGenerationMethods
attribute of each. Here’s an example:
{
"name": "models/gemini-2.0-flash-thinking-exp",
"version": "2.0-exp-01-21",
"displayName": "Gemini 2.0 Flash Thinking Experimental 01-21",
"description": "Experimental release (January 21st, 2025) of Gemini 2.0 Flash Thinking",
"inputTokenLimit": 1048576,
"outputTokenLimit": 65536,
"supportedGenerationMethods": [
"generateContent",
"countTokens"
],
"temperature": 0.7,
"topP": 0.95,
"topK": 64,
"maxTemperature": 2
},
Cheers.
Hi,
AFAIK, this applies to Vertex AI and tuned models only.
Base models cannot be filtered by specifying a querystring filter
parameter.
The parameters pageSize
and pageToken
apply to both APIs.
Do you have an example where filter
is used in Google AI?
Cheers.